URLSession and Synchronous HTTP request

It might sound stupid(and most of the time it is) but there are situations when you want to make a synchronous request using URLSession. I faced the situation when I had to log both request and response together. Semaphores and Synchronous HTTP request A asynchronous request looks something like this To make it behave we … Read more

Ludo with Flutter for iOS and Android

I have created a basic Ludo game with flutter which runs on both iOS and Android without any UI glitches. The base is free to use and is released under MIT license. Source code is here but read along to understand what it does. Capabilities and Limitations Tokens can come out of Home Area only … Read more

Fatal error: Unexpectedly found nil while unwrapping an Optional value

So your code is crashing with EXC_BAD_INSTRUCTION and you are getting a error like Fatal error: Unexpectedly found nil while unwrapping an Optional value or Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value This crash arises when we attempt to forcefully or Implicitly unwrap an optional and that optional, as the name … Read more

Save custom objects into UserDefaults

In this post, I will discuss how to save a custom object in UserDefaults. We will use Codable and JSON to save and retrieve data from UserDefaults. Before we begin let me caution you UserDefaults are not your database. Use CoreData or Realm for all your heavy lifting. Make your class/Type conform to codable protocol … Read more

Uploading a Large file using Alamofire 5

Very large files can not be converted into data at once and moved around in variables. It is simply not possible as very large files could trigger memory warning and eventual crash. Now the question arises how do we upload very large files using Alamofire? Solution is simple just pass the file url to alamofire … Read more

App Crashes Only On Testflight Build Swift

If you are facing a situation that your app crashes only on TestFlight build then you need to follow following steps Add you apple account to your Xcode. You can do this by going to Xcode-> preferences->Accounts. Click on the + button and the same apple developer account which you are using for test flight. … Read more

Camera and UIImagePickerController to take photos with swift

You can easily integrate camera functionality in your application using UIImagePickerController which is built-in UIKit. It requires very few steps to do so. I am providing the basic steps below Make your viewcontroller calss conform to UIImagePickerControllerDelegate and UINavigationControllerDelegate Add extention to your viewcontroller Your code is almost done. Now add some button or function … Read more