Might be handy when estimating work.
- Open Terminal
- cd to your Xcode project
- Execute the following when inside your target project:
tell application "System Preferences" | |
set current pane to pane "com.apple.preference.keyboard" | |
tell application "System Events" | |
tell tab group 1 of window "Keyboard" of process "System Preferences" | |
click checkbox "Use all F1, F2, etc. keys as standard function keys" | |
end tell | |
end tell | |
end tell |
typealias Property<Value, ID> = GenericProperty<Value, ID, Void> | |
typealias CollectionProperty<Value, ID> = GenericProperty<Value, ID, CollectionChange> | |
struct GenericProperty<Value, ID, ChangeInfo> { | |
private var _value: Value | |
var value: Value { | |
get { return _value } | |
set { set(newValue) } | |
} |
public class Channel<Value> { | |
private class Subscription { | |
weak var object: AnyObject? | |
private let notifyBlock: (Value) -> Void | |
private let queue: DispatchQueue | |
var isValid: Bool { | |
return object != nil |
enum Theme: String { | |
case light, dark | |
} | |
protocol UserSettingsDelegate { | |
func themeDidChange(_ theme: Theme) | |
} | |
class UserSettings { | |
enum Theme: String { | |
case light, dark | |
} | |
class UserSettings { | |
static let shared = UserSettings(notificationCenter: .default) | |
let notificationCenter: NotificationCenter | |
var theme: Theme = .light { |
enum Theme: String { | |
case light, dark | |
} | |
class UserSettings { | |
enum Message { | |
case didUpdateTheme(Theme) | |
} | |
protocol MovieListView: MovieListViewModelDelegate { | |
private var viewModel: MovieListViewModel | |
func updateWithMovies(_ movies: [Movie]) | |
func didTapOnReload() | |
func didTapOnMovie(at index: Int) | |
func showDetailView(for movie: Movie) | |
} | |
protocol MovieListViewModelDelegate: class { | |
func viewModelDidUpdate(_ model: MovieListViewModel) |
protocol MovieListView: MovieListPresenterDelegate { | |
private var presenter: MovieListPresenter | |
func didTapOnReload() | |
func didTapOnMovie(at index: Int) | |
func showDetailView(for movie: Movie) | |
} | |
protocol MovieListPresenterDelegate { | |
func updateWithMoviePresentations(_ movies: [MoviePresentation]) | |
} |
protocol MovieListView: MovieListPresenterDelegate { | |
private var presenter: MovieListPresenter | |
func didTapOnReload() | |
func didTapOnMovie(at index: Int) | |
} | |
protocol MovieListPresenterDelegate { | |
func updateWithMoviePresentations(_ movies: [MoviePresentation]) | |
} |