WWDC 2001 2002 2003 2004 2007 2008 2009 2010 2011 2012 2013
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
source "./dock_functions.sh" | |
declare -a apps=( | |
'/System/Applications/Utilities/Terminal.app' | |
'/System/Applications/Music.app' | |
'/Applications/Google Chrome.app' | |
'/Applications/PhpStorm.app' | |
'/Applications/Visual Studio Code.app' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class ObservationToken: NSObject {} | |
class Observable<ValueType> { | |
private(set) var value: ValueType | |
func update(_ newValue: ValueType) { | |
let oldValue = value | |
value = newValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIFont { | |
var withMonospacedDigits: UIFont { | |
let featureSettings = [ | |
UIFontDescriptor.FeatureKey.featureIdentifier: kNumberSpacingType, | |
UIFontDescriptor.FeatureKey.typeIdentifier: kMonospacedNumbersSelector | |
] | |
let descriptorAttributes = [ | |
UIFontDescriptor.AttributeName.featureSettings: featureSettings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIView { | |
func firstSuperview<T>(where predicate: (T) -> Bool) -> T? where T: UIView { | |
if let superview = superview as? T, predicate(superview) { | |
return superview | |
} | |
return superview?.firstSuperview(where: predicate) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
func doSomething() {} | |
func howDoesThisWork() { | |
// Nested function that references `self` implicitly. | |
func performDoSomething() { |