Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Contextual base class

  • Loading branch information...
commit d03b69ec645e2cbc9c2e61c715adfa99de213856 1 parent 971001e
@cneuwirt authored
View
2  Miruken/Callbacks/MKHandleMethod.m
@@ -63,7 +63,7 @@ - (void)setSignature:(NSMethodSignature *)signature
@implementation MKHandleMethod
{
MKHandleMethodBlock _didInvoke;
- BOOL _handled;
+ BOOL _handled;
}
+ (instancetype)withInvocation:(NSInvocation *)invocation
View
1  Miruken/Cocoa/MirukenCocoa.h
@@ -18,4 +18,5 @@
#import "UIViewController_RotationMixin.h"
#import "UINavigationController_RotationMixin.h"
#import "UIScrollView+Motion.h"
+#import "UIStoryboard+Naming.h"
#import "UIWindow+Rotation.h"
View
4 Miruken/Cocoa/UINavigationController_ContextualMixin.m
@@ -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])
{
View
3  Miruken/Context/MKContextual.h
@@ -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];
View
12 Miruken/Context/MKContextual.m
@@ -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>
View
1  Miruken/Context/MirukenContext.h
@@ -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"
View
2  Miruken/Error/MKEndContextOnError.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)
View
7 Miruken/Error/MKEndContextOnError.m
@@ -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
{
View
1  Miruken/Error/MirukenErrors.h
@@ -7,6 +7,7 @@
//
#import "MKErrors.h"
+#import "MKErrorCallbackHandler.h"
#import "MKCallbackHandler+Recoverable.h"
#import "MKEndContextOnError.h"
#import "MKWellKnownErrorResults.h"
View
4 Miruken/Miruken.h
@@ -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"
View
2  Miruken/Validation/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"
Please sign in to comment.
Something went wrong with that request. Please try again.