This file contains hidden or 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 Int { | |
| enum RomanDigits: Int, CaseIterable { | |
| case I = 1 | |
| case IV = 4 | |
| case V = 5 | |
| case IX = 9 | |
| case X = 10 | |
| case XL = 40 | |
| case L = 50 | |
| case XC = 90 |
This file contains hidden or 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 <AWSAuthCore/AWSAuthCore.h> | |
| @interface AWSIdentityManager (Fixtures) | |
| @end |
This file contains hidden or 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
| @interface PINCodeView : UIView | |
| - (instancetype)initWithNumberOfDigits:(NSUInteger)digits | |
| keyboardType:(UIKeyboardType)keyboardType | |
| autocapitalizationType:(UITextAutocapitalizationType)autocapitalizationType; | |
| @property (nonatomic, copy) NSString *code; | |
| - (void)becameFirstResponder; | |
| @end |
This file contains hidden or 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
| - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { | |
| NSMethodSignature * __block signature = nil; | |
| [self.implementations enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { | |
| signature = [obj methodSignatureForSelector:sel]; | |
| *stop = (nil != signature); | |
| }]; | |
| return signature; | |
| } | |
| - (BOOL)respondsToSelector:(SEL)aSelector { |
This file contains hidden or 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
| enum UIState { | |
| case current | |
| case forecast(page: Int) | |
| } | |
| enum UIEvent { | |
| case turnCurrent | |
| case turnForecast | |
| case turnLeft | |
| case turnRight |
This file contains hidden or 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
| func setupObserving() { | |
| currentWeatherView.reactive.weatherFeatures <~ viewModel.weatherFeatures | |
| loadingIndicator.reactive.isAnimating <~ viewModel.isLoading | |
| segmentedControl.reactive.isEnabled <~ viewModel.isEnabledControl(for: Set([.turnCurrent, .turnForecast])) | |
| reactive.title <~ viewModel.title | |
| reactive.rightBarButtonItem <~ viewModel.isLoading.map { [weak self] (isLoading) -> UIBarButtonItem? in | |
| return isLoading ? self?.loadingBarButtonItem : self?.refreshBarButtonItem | |
| } |
This file contains hidden or 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
| 255, 1, 1, 1, 0 | |
| 2233, 0, 1, 1, 1 |
This file contains hidden or 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
| 255, 1, 1, 1, 0 | |
| 2233, 0, 1, 1, 1 |
This file contains hidden or 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 | |
| public protocol NibInstantiator { | |
| associatedtype Base | |
| func instantiate() -> Base | |
| } | |
| public extension NibInstantiator where Base: UIView { | |
| public func instantiate() -> Base { | |
| guard let view = |
This file contains hidden or 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
| enum AuthError: Error { | |
| case wrongAuthData, | |
| case wrongDeauthData | |
| } | |
| class AuthManager { | |
| let networkManager: // injected dependency | |
| func deauthenticateUser(user: User) -> SignalProducer<User, AuthError> { | |
| // perhaps go to network: | |
| return SignalProducer { (observer, disposable) in |