How to import Objective-C framework in Swift framework

In a normal swift project we would create a bridging-header and import our objective-C framework in the bridging-header. In the case of a framework you will need to create a custom swift module. Let’s say you have an objective-C framework called MyFramework. Firstly, add your framework to the project: Then you need to add an … Continue reading How to import Objective-C framework in Swift framework

Resign an IPA file including frameworks

Run these commands from the terminal in the folder where you have YOUR_IPA.ipa file. unzip -q YOUR_IPA.ipa rm -rf Payload/ rm -rf Payload/ codesign -f -s "iPhone Distribution: XXX (XXXX)" Payload/ security cms -D -i PRODUCTION.mobileprovision > pr.plist /usr/libexec/PlistBuddy -x -c 'Print :Entitlements' pr.plist > YOUR_Plist.plist codesign -f -s "iPhone Distribution: XXX (XXXX)" --entitlements YOUR_Plist.plist Payload/ zip … Continue reading Resign an IPA file including frameworks

Safe area fix guide for earlier versions of iOS

Safe area layout is introduced in iOS11 but what can we do if we are supporting < iOS 11 and we have a xib view that is initiated in a ViewController and somehow the upper part of the xib view appears behind the NavigationBar??? To fix this, simply add this line in your viewDidLoad. self.edgesForExtendedLayout … Continue reading Safe area fix guide for earlier versions of iOS

Embed a UIViewController in a UINavigationController Programmatically

We know how to embed a ViewController in a NavigationController in Storyboard. However, I came across a scenario where I had to initiate it programmatically. The code: let viewController = MyViewController() let nav = UINavigationController(rootViewController: viewController) self.navigationController?.present(nav, animated: true, completion: nil)

Unique ID on iOS Devices

Problem! We all know now that identifierForVendor doesn't remain unique on iOS Devices. It changes when the user deletes all of the apps from the same vendor. According to Apple: The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value … Continue reading Unique ID on iOS Devices