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
- (id)init | |
{ | |
if (self = [super initNibName:nil bundle:nil]) { | |
[[[[self whenViewDidLoad] then:^(id result, NSError *error) { | |
return [self.loginButton whenTouchDown]; | |
}] then:^(id result, NSError *error) { | |
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 DNSession : NSObject<NSCopying, NSCoding> | |
@property (copy) NSString *authToken; | |
@property (copy) NSString *userIdentifier; | |
+ (instancetype)defaultSession; | |
- (instancetype)initWithConfiguration:(NSDictionary *)options; | |
@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
MVMUM Architecture (View ViewModel UseCase Model) | |
V > VM > UC > M ( i.e. direction of dependency) | |
<= direct of flow control | |
=> increasing relevant to domain (i.e. plain object) | |
<= increasing relevant to framework/environment (i.e. platform objects with side effect e.g. native GUI, database) | |
Example: (user login screen) |
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
override func sendEvent(_ event: UIEvent) { | |
NSLog("sendEvent \(event)") | |
super.sendEvent(event) | |
var vc = keyWindow!.rootViewController! | |
while vc.presentedViewController != nil { | |
vc = vc.presentedViewController! | |
} | |
// Find hit view | |
if let view = vc.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
// | |
// ViewController.m | |
// DemoScrolling | |
// | |
// Created by Simon Pang on 30/5/2018. | |
// Copyright © 2018 Simon Pang. All rights reserved. | |
// | |
#import "ViewController.h" |
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
// | |
// RxSwiftMultithreadTests.swift | |
// GoodNotesTests | |
// | |
// Created by Simon Pang on 27/11/2018. | |
// Copyright © 2018 Time Base Technology Limited. All rights reserved. | |
// | |
import XCTest | |
import RxSwift |
OlderNewer