Upload
radexp
View
329
Download
1
Embed Size (px)
Citation preview
Radek����������� ������������������ Pietruszewski
radex.io����������� ������������������ •����������� ������������������ @radexp
“Programs must be written for people to read, and only incidentally for machines to execute”
— Structure and Interpretation of Computer Programs
naming things
stringByReplacingOccurrencesOfString:withString:
performSelectorOnMainThread:withObject:waitUntilDone:
tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:
NSUserActivity(activityType: "hash_state") activity.userInfo = ["hash": hash] activity = NSURL(string: fallbackURL) activity.becomeCurrent() currentActivity = activity
; ; ; ; ;
[[NSWindow alloc] initWithContentRect: frame styleMask: NSTitledWindowMask backing: NSBackingStoreBuffered defer: NO screen: nil]
[[NSWindow alloc] initWithContentRect: frame styleMask: NSTitledWindowMask backing: NSBackingStoreBuffered defer: NO screen: nil]
init( contentRect: NSRect, styleMask: NSWindowMask = .Titled, backing: NSBackingStoreType = .Buffered, defer: Bool = false, screen: NSScreen? = nil)
[[NSWindow alloc] initWithContentRect: frame styleMask: NSTitledWindowMask backing: NSBackingStoreBuffered defer: NO screen: nil]
[NSTimer scheduledTimerWithTimeInterval: 1.0 target: self selector: @selector(foo:) userInfo: nil repeats: YES]
. . .
- (void) foo: (NSTimer *timer) { NSLog(@“Hello world!”)}
radex.io/swift/nstimer
NSTimer.schedule(interval: 1.0, target: self, selector: "foo:", userInfo: nil, repeats: true)
func foo(timer: NSTimer) { println("Hello world") }
radex.io/swift/nstimer
NSTimer.schedule(interval: 1.0, userInfo: nil, repeats: true) { println("Hello world") }
radex.io/swift/nstimer
[NSTimer scheduledTimerWithTimeInterval: 1.0 target: self selector: @selector(foo:) userInfo: nil repeats: YES]
. . .
- (void) foo: (NSTimer *timer) { NSLog(@“Hello world!”)}
radex.io/swift/nstimer