Skip to content

Instantly share code, notes, and snippets.

View MartinMoizard's full-sized avatar

Martin Moizard MartinMoizard

View GitHub Profile
protocol ViewModelType {
associatedtype Input
associatedtype Output
func transform(input: Input) -> Output
}
@MartinMoizard
MartinMoizard / ViewModelType.swift
Last active August 22, 2017 14:26
Basic ViewModelType
protocol ViewModelType {
associatedtype Input
associatedtype Output
}
@MartinMoizard
MartinMoizard / uncrustify.cfg
Created January 7, 2015 11:10
Uncrustify config file for pretty Objc
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.4.3 (252)
#
# Alignment
# ---------
## Alignment
@MartinMoizard
MartinMoizard / gist:6537467
Created September 12, 2013 13:37
Category on UIViewController: recursive function to present a modal View Controller anywhere in the application. Example: [self.window.rootViewController presentViewControllerFromVisibleViewController:myViewController]; Works with application using only UINavigationController and modal views. Can be enhanced to handle UITabBarController or other…
- (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];
}