邂逅 swift , 你需知道的 n 件事

Post on 23-Jan-2018

1.558 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

𝓃

Github Playground

http://ppt.cc/ktbTe

Github

Social

e.g. https://www.github.com/gradyzhuo

e.g. https://www.facebook.com/gradyzhuo

iOS 4 Flingy, Swift 1

Flingy on AppStore(U.S. Only)

UI !

iOS der! 😜

Grady Zhuo

ˇ ˋ ˇ

func () ->

•Swift Xcode

– Xcode

func () -> {

}

Xcode 7.0 iOS 7.0

• i.g. Xcode 6.4 Xcode 7.0

• Swift

func Xcode () -> {

}

error convert convert …

PS. 100 Error …

func SwiftSyntaxUpgrade() -> {

}

• Swift

iBooks Documentation

func () -> {

}

• Struct Apple Pointer Unsafe

– UnsafePointer

– UnsafeMutablePointer

– UnsafeBufferPointer

– UnsafeMutableBufferPointer

• Playground

– C C Array Swift C Array

–NSInteger index[4] = {0, 1, 2, 3};

–printf("%ld, %ld, %ld, %ld\n", index[0], index[1], index[2], index[3]);

func Pointer () -> {

}

… …

Swift

• Swift Open Source Swift 1.2 Swift

Cocoa Foundation

– NSSet -> Set<T>

– @try @catch -> do try catch

– NSError -> ErrorType (protocol)

• OpenSource Syntax…

• Apple Swift Blog Swift2.0 in Swift Blog by Apple Inc.

# In addition to new features, the big news is that Apple

will be making Swift open source later this year.

let OpenSource = Swift(syntaxRate : .Slow )

• Apple Swift

– Swift. A modern programming language that is safe , fast, and interactive.

• Code,

– Optional( ) nil

– if {}

– Switch case

– Pointer ( )

func Objective-C () -> Bool {

return true }

• iOS / OSX

• Server

• Linux

• ● ● ●

func () -> AnyObject? {

}

Class, Struct and Enum

Q & A

top related