Swift 2.0 you can initialize Integer using constructor
var stringNumber = "1234"
var numberFromString = Int(stringNumber)
More Related Contents:
- Overriding methods in Swift extensions
- Swift: guard let vs if let
- .toInt() removed in Swift 2?
- Return instancetype in Swift
- Swift 2 – UnsafeMutablePointer to object
- Swift do-try-catch syntax
- The “++” and “–” operators have been deprecated Xcode 7.3
- Differences in NSDateComponents syntax?
- Swift 2 ( executeFetchRequest ) : error handling
- Swift 2 – Pattern matching in “if”
- Extend array types using where clause in Swift
- Is it possible to replicate Swifts automatic numeric value bridging to Foundation (NSNumber) for (U)Int8/16/32/64 types?
- Calling protocol default implementation from regular method
- Fix warning “C-style for Statement is deprecated” in Swift 3
- fatal error: swapping a location with itself is not supported with Swift 2.0
- Why is Equatable not defined for optional arrays
- Generic function taking a type name in Swift
- Selecting global or object print function
- Swift 2.0 : ‘enumerate’ is unavailable: call the ‘enumerate()’ method on the sequence
- Any reason not use use a singleton “variable” in Swift?
- try, try! & try? what’s the difference, and when to use each?
- print without newline in swift
- Convert Swift Array to Dictionary with indexes [duplicate]
- Iterate through a String Swift 2.0
- How do you enumerate OptionSetType in Swift?
- Convert Character to Int in Swift 2.0
- Whats the Swift animate WithDuration syntax?
- How to convert a binary to decimal in Swift?
- NSDate() or Date() shows the wrong time
- How to store 1.66 in NSDecimalNumber