Top "Swift3" questions

Use this tag only for questions directly related to changes in version 3 of Apple's Swift programming language.

Attempt to insert non-property list object when trying to save a custom object in Swift 3

I have a simple object which conforms to the NSCoding protocol. import Foundation class JobCategory: NSObject, NSCoding { var id: Int …

ios swift swift3 nsuserdefaults nscoding
Download File Using Alamofire 4.0 (Swift 3)

In older version of Alamofire. This is how I download file let destinationPath = Alamofire.Request.suggestedDownloadDestination( directory: .documentDirectory, domain: .userDomainMask); …

ios swift swift3 alamofire alamofireimage
Accessing code in Swift 3 Error

New in Xcode 8 beta 4, NSError is bridged to the Swift Error protocol type. This affects StoreKit when dealing with failed …

swift swift3
How do you create custom notifications in Swift 3?

In Objective-C, a custom notification is just a plain NSString, but it's not obvious in the WWDC version of Swift 3 …

swift nsnotificationcenter nsnotifications nsnotification swift3
Working with NSNumber & Integer values in Swift 3

I am trying to convert my project to Swift 3.0 however I am having two error messages when working with NSNumber …

ios swift int swift3 nsnumber
Swift 3 for loop with increment

How do I write the following in Swift3? for (f = first; f <= last; f += interval) { n += 1 } This is my …

swift swift3
Selector in swift3

Why doesn't this work in swift 3 ? It crashes at runtime saying: '-[my_app_name.displayOtherAppsCtrl tap:]: unrecognized selector sent …

ios selector swift3
Type Int does not conform to protocol sequence

I have the following code in Swift 3: var numbers = [1,2,1] for number in numbers.count - 1 { // error if numbers[number] < …

arrays swift swift3 sequence for-in-loop
Remove Last Two Characters in a String

Is there a quick way to remove the last two characters in a String in Swift? I see there is …

ios swift string swift3
Quitting app causes error "Message from debugger: Terminated due to signal 9"

I'm writing a basic music player app but having some problems when it comes to handling the app state transitions. …

ios xcode swift3 mpmediaplayercontroller