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 <AWSAuthCore/AWSAuthCore.h> | |
@interface AWSIdentityManager (Fixtures) | |
@end |
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
@interface PINCodeView : UIView | |
- (instancetype)initWithNumberOfDigits:(NSUInteger)digits | |
keyboardType:(UIKeyboardType)keyboardType | |
autocapitalizationType:(UITextAutocapitalizationType)autocapitalizationType; | |
@property (nonatomic, copy) NSString *code; | |
- (void)becameFirstResponder; | |
@end |
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
- (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 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 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 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 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 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 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 |
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
enum TestError: Swift.Error { | |
case uploadFailed | |
} | |
class Album { | |
let pages: [Page] = [] | |
} | |
class Page {} | |
class UploadServiceImpl { | |
private(set) lazy var addAction = Action<Album, Void, TestError>(execute:self.addActionBlock) | |
private lazy var pageAction = Action<Page, Void, TestError>(execute:self.pageActionBlock) |