Permalink
Browse files

Added Contextual base class

  • Loading branch information...
1 parent 971001e commit d03b69ec645e2cbc9c2e61c715adfa99de213856 @cneuwirt committed Mar 9, 2014
@@ -63,7 +63,7 @@ - (void)setSignature:(NSMethodSignature *)signature
@implementation MKHandleMethod
{
MKHandleMethodBlock _didInvoke;
- BOOL _handled;
+ BOOL _handled;
}
+ (instancetype)withInvocation:(NSInvocation *)invocation
@@ -18,4 +18,5 @@
#import "UIViewController_RotationMixin.h"
#import "UINavigationController_RotationMixin.h"
#import "UIScrollView+Motion.h"
+#import "UIStoryboard+Naming.h"
#import "UIWindow+Rotation.h"
@@ -99,7 +99,8 @@ - (MKContext *)bindChildContextAndPopOnEnd:(UIViewController *)viewController ow
if (childContext)
{
- BOOL navBarHidden = self.navigationBarHidden;
+ BOOL toolbarHidden = self.toolbarHidden;
+ BOOL navBarHidden = self.navigationBarHidden;
@weakify(self, viewController);
[childContext subscribe:[MKContextObserver contextDidEnd:^(MKContext *context)
@@ -113,6 +114,7 @@ - (MKContext *)bindChildContextAndPopOnEnd:(UIViewController *)viewController ow
return;
[self setNavigationBarHidden:navBarHidden animated:YES];
+ [self setToolbarHidden:toolbarHidden animated:YES];
if ([self.viewControllers containsObject:viewController])
{
@@ -30,6 +30,9 @@
@end
+@interface MKContextual : NSObject <MKContextual>
+@end
+
/**
This class is an opaque mix-in that adds contextual behavior to any class. e.g.
[UIViewController mixinFrom:MKContextualMixin.class];
@@ -13,6 +13,18 @@
#import "MKMixin.h"
#import <objc/runtime.h>
+#pragma mark - MKContextual
+
+@implementation MKContextual
+
++ (void)initialize
+{
+ if (self == MKContextual.class)
+ [self mixinFrom:MKContextualMixin.class];
+}
+
+@end
+
#pragma mark - ContextualMixin methods
@interface MKContextualMixin () <MKContextual>
@@ -9,6 +9,7 @@
#import "MKContext.h"
#import "MKContextual.h"
#import "MKContextObserver.h"
+#import "MKContextualHelper.h"
#import "MKContext+Subscribe.h"
#import "MKContext+Traversal.h"
#import "MKCallbackHandler+Context.h"
@@ -9,7 +9,7 @@
#import "MKErrors.h"
#import "MKContextual.h"
-@interface MKEndContextOnError : NSObject <MKErrors, MKContextual>
+@interface MKEndContextOnError : MKContextual <MKErrors>
@end
@interface MKContext (MKContext_EndContextOnError)
@@ -10,16 +10,9 @@
#import "MKContext+Subscribe.h"
#import "UIAlertView+Block.h"
#import "MKDeferred.h"
-#import "MKMixin.h"
@implementation MKEndContextOnError
-+ (void)initialize
-{
- if (self == MKEndContextOnError.class)
- [MKEndContextOnError mixinFrom:MKContextualMixin.class];
-}
-
- (id<MKPromise>)reportError:(NSError *)error message:(NSString *)message
title:(NSString *)title context:(void *)context
{
@@ -7,6 +7,7 @@
//
#import "MKErrors.h"
+#import "MKErrorCallbackHandler.h"
#import "MKCallbackHandler+Recoverable.h"
#import "MKEndContextOnError.h"
#import "MKWellKnownErrorResults.h"
View
@@ -19,5 +19,5 @@
#import "MirukenConcurrency.h"
#import "MirukenContext.h"
#import "MirukenCocoa.h"
-#import "MKErrors.h"
-#import "MKValidation.h"
+#import "MirukenErrors.h"
+#import "MirukenValidation.h"
@@ -6,7 +6,7 @@
// Copyright (c) 2014 Craig Neuwirt. All rights reserved.
//
-#import "MKValidate.h"
+#import "MKValidation.h"
#import "MKValidationResult.h"
#import "MKValidationErrors.h"
#import "NSError+MKValidation.h"

0 comments on commit d03b69e

Please sign in to comment.