Top "Swift2" questions

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

Swift: How to get everything after a certain set of characters

Given the following string: var snippet = "1111 West Main Street Beverly Hills, CA 90210 Phone: 123.456.7891" How can I extract everything that comes …

swift swift2
How to get a subArray from Swift 2.0

I keep trying to search for the proper way to get a sub array in Swift but I am missing …

arrays swift2 sub-array
Pass data between ViewController and ContainerViewController

I'm working on an app, and need to pass data between view and containerView. I need to send data and …

swift swift2 segue uistoryboardsegue swift-protocols
FBSOpenApplicationErrorDomain error 1

I'm trying to run my iOS app that was migrated from Swift 1.2 to Swift 2.0 in Xcode 7 using iPhone Simulator (any), …

ios xcode ios-simulator swift2 xcode7
Swift: How to use for-in loop with an optional?

What's the proper way to use for-in loop with an optional? Right now I always perform an optional binding before …

swift2 optional for-in-loop
Use of unresolved identifier 'FIRAuth' (Swift 2, Firebase 3.x)

Updating to the new firebase. Created a new signin VC and everything was working fine in terms of no errors. …

ios firebase swift2 xcode7 firebase-authentication
better way to get the name of the day on ios swift

i take the name of the day like this func loadDayName(forDate date: NSDate) -> String{ let myComponents = calendar.…

ios swift cocoa swift2
Calling protocol default implementation from regular method

I'm wondering if it's possible to achieve such a thing. I have a Playground like this: protocol Foo { func testPrint() } …

swift oop protocols swift2
Optional Int in Realm

I am trying to use an Optional Int in Realm and am getting an old error I think. Code dynamic …

swift int swift2 realm optional
How to size a UIStackView depending on its content?

I would like to have a similar behavior than the <Table> HTML tag, in the sense where the …

ios uitableview swift2 height uistackview