This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
/* | |
This tips is extremely useful when you test your CoreData app in Unit Test. | |
*/ | |
// iOS app is an executable bundle, means the `main` method is | |
// included inside app bundle, so `mainBundle` returns the app bundle | |
// | |
// See doc at https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003624 | |
NSBundle *appBundle = [NSBundle mainBundle]; |
class Thunder { } | |
class Fire { } | |
protocol Pokemon { | |
typealias PokemonType | |
func attack(move:PokemonType) | |
} | |
struct Pikachu: Pokemon { | |
typealias PokemonType = Thunder |
import UIKit | |
// If you enjoyed this talk (video link will be up soon), then you might also enjoy our book Advanced Swift: http://www.objc.io/books/advanced-swift | |
struct Person { | |
let name: String | |
let city: String | |
} | |
let people = [ |
import Cocoa | |
import MASShortcut | |
func pow() { | |
let rect = NSScreen.mainScreen()?.frame | |
let window = NSWindow(contentRect: rect!, styleMask: NSBorderlessWindowMask, backing: .Buffered, `defer`: false) | |
window.backgroundColor = NSColor.clearColor() | |
window.opaque = false | |
window.alphaValue = 1 | |
window.makeKeyAndOrderFront(NSApplication.sharedApplication()) |
extension Signal where Error == NoError { | |
public func sample(each timeInterval: DispatchTimeInterval, | |
on scheduler: DateScheduler = QueueScheduler()) -> Signal<[Value], NoError> { | |
return Signal<[Value], NoError> { observer in | |
let valueHolder : MutableProperty<[Value]> = MutableProperty<Value>([]) | |
let disposable = CompositeDisposable() | |
var sampler: Signal<(), NoError>? = nil | |
disposable += timer(interval: until, on: QueueScheduler()).startWithSignal { signal, _ in | |
signal = innerSignal.map { _ in () } | |
} |
Author: Chris Lattner