openURL: deprecated in iOS 10

Write like this. Handle completionHandler UIApplication *application = [UIApplication sharedApplication]; NSURL *URL = [NSURL URLWithString:@”http://www.google.com”]; [application openURL:URL options:@{} completionHandler:^(BOOL success) { if (success) { NSLog(@”Opened url”); } }]; Without handling completionHandler [application openURL:URL options:@{} completionHandler:nil]; Swift Equivalent:- open(_:options:completionHandler:) UIApplication.shared.open(url)

What does deployment target mean?

Lets say you have set minimum deployment target to iOS 9. This means your application is compatible for iOS 9 and above devices. The application won’t run on below 9.0 devices but can run on any iOS version greater than iOS 9.0.

Add Local Notification in iOS 10 – Swift 3

You need to register for Notification…I tried and this works. func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. let center = UNUserNotificationCenter.current() center.requestAuthorization([.alert, .sound]) { (granted, error) in // Enable or disable features based on authorization. } return true } Edit: You dont need … Read more

Model is running iOS 10.2 (14C92), which may not be supported by this version of Xcode

If somebody facing similar issue with Xcode 9.1 Open directory: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport Create new folder “11.2 (15C107)” (or “10.3 (14E269)” for older versions, depends on what exactly are you missing) Paste files from provided google drive folder 11.2 (15C107) (or 10.3 (14E269) if you need older files) Restart Xcode For other iOS versions you may check … Read more

Take a photo and save to photo library in Swift

Use below code for an image taken from Photo Gallery and save inside photo library. Code Support for Swift 3.1 & 4.0 version: First, we have to do the setup for Permissions inside Project’s .plist file:- 1) Camera <key>NSCameraUsageDescription</key> <string>This app will use camera.</string> 2) Photo Library <key>NSPhotoLibraryUsageDescription</key> <string>You can select photos to attach to … Read more

Xcode 8 generates broken NSManagedObject subclasses for iOS 10

I finally got mine to work. Here is what I did. (Flights is one of my entities) I setup the xcdatamodeld as follows And then the entity as Then I used Editor -> Create NSManagedObject Subclass This creates two files for my flights entity Flights+CoreDataProperties.swift Flights+CoreDataClass.swift I renamed Flights+CoreDataClass.swift to Flights.swift Flights.swift is just import … Read more