Top "Swift2.2" questions

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

#warning: C-style for statement is deprecated and will be removed in a future version of Swift

I just download a new Xcode (7.3) with swift 2.2. It has a warning: C-style for statement is deprecated and will be …

ios objective-c swift swift2.2
How to convert Int to String.CharacterView.Index

This is driving me nuts. In Swift 2.2, it makes it impossible to subscript String with Int. For example: let myString = "…

string swift2 subscript swift2.2
How to invoke a class method using performSelector() on AnyClass in Swift?

In ObjC you could simply invoke a class method using the class method from NSObject. [Machine performSelector:@selector(calculate:) withObject:…

ios swift reflection performselector swift2.2
Cannot convert value of type 'JSON' to expected argument type 'JSON'

Below is the code, //Controller.swift struct MyObject { init(myJson: JSON) { // some code here } } //unittest.swift let json = JSON("{}") let …

ios swift swifty-json xcode7.3 swift2.2
Trailing where clause for extension of non-generic type

I have the following code: func registerNotification(name:String, selector:Selector) { NSNotificationCenter.defaultCenter().addObserver(self, selector: selector, name: name, object: …

ios swift swift2 protocol-extension swift2.2