Author Archives: admin

The application bundle does not contain a valid identifier

On rare occasions Xcode will refuse to run your app on a device and you will come across this error The application bundle does not contain a valid identifier. Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402653108 Xcode One of these three steps given below will resolve the issue for you Clear Derived Data… Read more »

Shuffle an array in Swift

      No Comments on Shuffle an array in Swift

Swift now comes with built in shuffle functionality. Swift provides two methods shuffle() shuffled() shuffle() Shuffle reorders a collection in place. After calling shuffle on the collection the original collection is changed/reordered Since shuffle() is mutating in nature you cannot use it with constant declared using let keyword. It has… Read more »

Your application has presented a UIAlertController of style UIAlertControllerStyleActionSheet

This happens when you try to present a action sheet in iPad. Luckily you can make your action sheet work across iPhone and iPad without writing different code for specific platform.Using popoverPresentationController?.sourceView an example code is given below This will remove the crash and you will achieve desired behaviour in… Read more »

Convert Swift Collection to String

      No Comments on Convert Swift Collection to String

It might happen that you need to convert a swift Set,Array,Dictionary to string. It might be because you want to log or might just want plain string. It is very easy to Convert Swift Collections to String by using description. Try the above code in the playground. No mapping and… Read more »

URLSession and Synchronous HTTP request

      No Comments on 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… Read more »

Ludo with Flutter for iOS and Android

      No Comments on 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… 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… Read more »

Save custom objects into UserDefaults

      No Comments on 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… Read more »

Uploading a Large file using Alamofire 5

      No Comments on 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… Read more »