Top "Swift3" questions

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

Change Status Bar Background Color in Swift 3

In XCode 7.3.x ill changed the background Color for my StatusBar with: func setStatusBarBackgroundColor(color: UIColor) { guard let statusBar = UIApplication.…

ios swift swift3 statusbar uistatusbar
print without newline in swift

In swift 2.0, print() automatically adds a newline character. In swift 1.2, println() and print() used to be separate functions. So how …

swift swift3 swift2
The "++" and "--" operators have been deprecated Xcode 7.3

I am looking at Xcode 7.3 notes and I notice this issue. The ++ and -- operators have been deprecated Could some …

swift swift2 increment swift3 decrement
Bundle.main.path(forResource:ofType:inDirectory:) returns nil

Try not to laugh or cry -- I'm just getting back into coding after 20 years out... I've spent more than 4 …

ios swift macos file swift3
upload image to server using Alamofire

this is my code that I want to upload image to server using Alamofire, it not error but it can't …

swift3 alamofire
How to provide a localized description with an Error type in Swift?

I am defining a custom error type with Swift 3 syntax and I want to provide a user-friendly description of the …

swift swift3 error-handling nslocalizedstring
Swift 3 saving and retrieving custom object from userDefaults

I have this in Playground using Swift 3, Xcode 8.0: import Foundation class Person: NSObject, NSCoding { var name: String var age: Int …

ios swift xcode swift3 nscoding
Type 'Any' Has no Subscript Members in xcode 8 Swift 3

My App is supposed to go to a specific location to pull down the website it needs to load. In 2.3 …

ios json swift swift3 xcode8
Swift 3 - How to verify class type of object

This line of code used to work with Swift 2, but now is incorrect in Swift 3. if gestureRecognizer.isMember(of: UITapGestureRecognizer) { } …

ios swift3 casting type-inference
Generics in Swift - "Generic parameter 'T' could not be inferred

I'd like to return a UIViewController conforming to MyProtocol from a method, so I'm using the method signature: func myMethod&…

ios generics swift3