Everything you ever wanted to know about Swift but were afraid to ask!
This presentation covers:
- Why developers should care about Swift.
- An overview of the languages features.
- A more detailed look at some of the features.
- The Swift sever work group.
- Kitura.
iOS team can own the backend. Backends can evolve to fit unique requirements App requirements can be realised quicker Fast startup Low memory Interoperability
a value may be absent and represent two possible states: A value exists and can be accessed by unwrapping. var name: String? = “Matt” if let name = name { print(name) }
a value may be absent and represent two possible states: A value exists and can be accessed by unwrapping. No value exists var name: String? = “Matt” if let name = name { print(name) } var name: String? = nil
process for querying and calling properties that may be nil. If the optional property has a value the query or call is successful. If the property is nil the operation returns nil
process for querying and calling properties that may be nil. If the optional property has a value the query or call is successful. If the property is nil the operation returns nil class Bike { var bell: Bell? }
process for querying and calling properties that may be nil. If the optional property has a value the query or call is successful. If the property is nil the operation returns nil class Bike { var bell: Bell? } func ringBell() { guard let bell = self.bell else { return } bell.sound() }
process for querying and calling properties that may be nil. If the optional property has a value the query or call is successful. If the property is nil the operation returns nil class Bike { var bell: Bell? } func ringBell() { guard let bell = self.bell else { return } bell.sound() } class Bike { var bell: Bell? } func ringBell() { self.bell?.sound() }
var engineSize: Int func alert() { // Sound horn } } class Moped: MotorisedBike { var manufacturer: String } protocol Bike { func alert() } class Moped: Bike { func alert() { // Sound horn } } class Bicycle: Bike { func alert() { // Ring bell } } Inheritance Protocol
type that defines common behaviour to be applied to any other struct IntStack { var stack = [Int]() mutating func push(_ item: Int) { stack.append(item) } mutating func pop() -> Int { return stack.removeLast() } }
type that defines common behaviour to be applied to any other struct IntStack { var stack = [Int]() mutating func push(_ item: Int) { stack.append(item) } mutating func pop() -> Int { return stack.removeLast() } } struct Stack<Element> { var stack = [Element]() mutating func push(_ item: Element) { stack.append(item) } mutating func pop() -> Element { return stack.removeLast() } } let intStack = Stack<Int>() let stringStack = Stack<String>()
Work Group? A group that promotes the use of Swift for developing and deploying server applications Members consist of: - Apple - IBM Kitura team - Vapor team
Work Group? A group that promotes the use of Swift for developing and deploying server applications Members consist of: - Apple - IBM Kitura team - Vapor team Uses the Swift Server Forum for general discussion
Work Group? A group that promotes the use of Swift for developing and deploying server applications Members consist of: - Apple - IBM Kitura team - Vapor team Uses the Swift Server Forum for general discussion What does the Swift Server Work Group do?
Work Group? A group that promotes the use of Swift for developing and deploying server applications Members consist of: - Apple - IBM Kitura team - Vapor team Uses the Swift Server Forum for general discussion What does the Swift Server Work Group do? Defines and prioritises efforts that address the needs of the Swift Server community.
Work Group? A group that promotes the use of Swift for developing and deploying server applications Members consist of: - Apple - IBM Kitura team - Vapor team Uses the Swift Server Forum for general discussion What does the Swift Server Work Group do? Defines and prioritises efforts that address the needs of the Swift Server community. Runs an incubation process intended to reduce duplication of effort and promote compatibility and good practice.
Work Group? A group that promotes the use of Swift for developing and deploying server applications Members consist of: - Apple - IBM Kitura team - Vapor team Uses the Swift Server Forum for general discussion What does the Swift Server Work Group do? Defines and prioritises efforts that address the needs of the Swift Server community. Runs an incubation process intended to reduce duplication of effort and promote compatibility and good practice. Provides feedback on language features needed by the server community to the Swift Core team.