Skip to main content

Posts

2024


Create a NuGet package

·1161 words·6 mins
Whether you are working alone or in a company, duplicating code is never a good practice. It is one of the first rules in computer science: when you create something, you reuse it, consolidate it, but avoid recreating it, except in rare cases. Our goal here is to create reusable libraries that can be easily integrated into any project or other library. We will not address the issue of code obfuscation here.

2023


Hello Huston ... We have a problem

·308 words·2 mins
But what is this error? Have you ever had that moment, in front of your debugger, when you look at the error message, remember what you’ve just done that last modification and … nothing. Nothing makes sense. via GIPHY Just today I experienced such a moment. I’m currently working on a new application in .NET MAUI. I was making a generic class for managing the application’s pages. I was implementing this in a real case and the BOOM 💥 I get this error displayed on my Visual Studio :

Using a SwiftUI view in UIKit

·812 words·4 mins
It’s no longer news that SwiftUI is part of our iOS developer ecosystem. We have more and more opportunities with this technology and it’s high time to project ourselves with it. So when we create a new graphical component, we always ask ourselves: do I create it in SwiftUI so that it’s compatible with the future? Or do I do it with my good old UIKit to make sure I’ve got everything right?

A new language is available! 🇫🇷

·186 words·1 min
We take the same and we start again #As you already know I am a French mobile developer and I like to share with you all my knowledge in this field. In order to reach as many people as possible I have written most of the time in English. But I find that the iOS, Android and .NET community lacks some resources in our beautiful language. That’s why I decided to provide my articles always in English for the greatest number but also in French!

2022


Convert a closure or a delegate to async / await

·1325 words·7 mins
With Swift 5.5 and the SE-0296 it is now possible to use async / await as in many languages such as C#, Typescript, Javascript or even Rust. Until now we handled asynchronism in three different ways: the delegated as Apple does a lot, closures (also called completionHandler) as many do or with RxSwift or other libraries like Promise. But with the arrival of async / await it is no longer necessary to go through all that.

assert, precondition and fatalError

·1459 words·7 mins
Have you ever crashed your application on purpose? Who would want to do that? What if I told you that there are tools for that and that it can be very useful, do you believe me? Let’s take a look at it together! assert #If you come from languages like C or C++, assert will be the keyword you are most familiar with. And for good reason, it does exactly the same thing as an assert in C.

Swift: defer

·724 words·4 mins
The keyword defer in Swift is not often encountered. Especially when you start developing. Nevertheless it has a certain usefulness and can be very useful. Definition #defer is a Swift keyword used to define code to execute before leaving the current scope: func changeTitle(_ title: String) { defer { print("After") } print("Before") myTitleLabel.text = title } At first sight and if we only consider the order in which the instructions are written, we could believe that we will have the following output:

Swift: static func VS class func

·449 words·3 mins
Recently I was confronted with a code where I saw for the first time the keyword class func. And I must admit, I had no idea what it was about. But as usual I remedied the situation and I wanted to share my discovery with you. static func #You should already be familiar with static func. If like me you started with languages like C# or Java you already had the opportunity to meet it.

iOS: Executable not found 😨

·294 words·2 mins
I’m sure that like me, you have already had strange errors with XCode. What do I mean by “strange”? Well, the error is not clear and does not seem possible. Let me explain. Error #I was developing a new SwiftUI application when I got the following error when launching the application on an emulator: Error: Executable Not found How can the compilation be successful while not finding the executable? Very strange I think.

Swift: weak and unowned

·1389 words·7 mins
In a previous article I told you about the keyword @escaping which is very useful in case of a scope change. If you want to know more about it, I invite you to read the article I previously wrote here :Swift: @escaping. But the change of scope leads to other consequences for the values “shared” potentially by the two scopes. Before talking about weak and unowned it is important to go back to some important notions.