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
- (void)presentViewControllerFromVisibleViewController:(UIViewController *)viewControllerToPresent | |
{ | |
if ([self isKindOfClass:[UINavigationController class]]) { | |
UINavigationController *navController = (UINavigationController *)self; | |
[navController.topViewController presentViewControllerFromVisibleViewController:viewControllerToPresent]; | |
} else if (self.presentedViewController) { | |
[self.presentedViewController presentViewControllerFromVisibleViewController:viewControllerToPresent]; | |
} else { | |
[self presentModalViewController:viewControllerToPresent animated:YES]; | |
} |
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
# | |
# Uncrustify Configuration File | |
# File Created With UncrustifyX 0.4.3 (252) | |
# | |
# Alignment | |
# --------- | |
## Alignment |
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
protocol ViewModelType { | |
associatedtype Input | |
associatedtype Output | |
} |
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
protocol ViewModelType { | |
associatedtype Input | |
associatedtype Output | |
func transform(input: Input) -> Output | |
} |
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
final class SayHelloViewModel: ViewModelType { | |
struct Input { | |
let name: Observable<String> | |
let validate: Observable<Void> | |
} | |
struct Output { | |
let greeting: Driver<String> | |
} |
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
final class SayHelloViewController: UIViewController { | |
@IBOutlet weak var nameTextField: UITextField! | |
@IBOutlet weak var validateButton: UIButton! | |
@IBOutlet weak var greetingLabel: UILabel! | |
private let viewModel = SayHelloViewModel() | |
private let bag = DisposeBag() | |
override func viewDidLoad() { |
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
/// TableViewCells | |
final class TextFieldCell: UITableViewCell { | |
@IBOutlet weak var nameTextField: UITextField! | |
} | |
final class ButtonCell: UITableViewCell { | |
@IBOutlet weak var validateButton: UIButton! | |
} | |
final class GreetingCell: UITableViewCell { |
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
protocol ViewModelType { | |
associatedtype Input | |
associatedtype Output | |
var input: Input { get } | |
var output: Output { get } | |
} |
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
final class SayHelloViewModel: ViewModelType { | |
let input: Input | |
let output: Output | |
struct Input { | |
let name: AnyObserver<String> | |
let validate: AnyObserver<Void> | |
} | |
struct Output { |
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
/// Every view interacting with a `SayHelloViewModel` instance can conform to this. | |
protocol SayHelloViewModelBindable { | |
var disposeBag: DisposeBag? { get } | |
func bind(to viewModel: SayHelloViewModel) | |
} | |
/// TableViewCells | |
final class TextFieldCell: UITableViewCell, SayHelloViewModelBindable { | |
@IBOutlet weak var nameTextField: UITextField! | |
var disposeBag: DisposeBag? |
OlderNewer