-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made a convenient way to access a containing storyboard link.
Fixes issue #9.
- Loading branch information
Showing
7 changed files
with
69 additions
and
16 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
PODS: | ||
- KIF (2.0.0) | ||
- RBStoryboardLink (0.0.6) | ||
- RBStoryboardLink (0.0.8) | ||
|
||
DEPENDENCIES: | ||
- KIF (~> 2.0) | ||
- RBStoryboardLink (from `..`) | ||
- RBStoryboardLink (from `../RBStoryboardLink.podspec`) | ||
|
||
EXTERNAL SOURCES: | ||
RBStoryboardLink: | ||
:path: .. | ||
:path: ../RBStoryboardLink.podspec | ||
|
||
SPEC CHECKSUMS: | ||
KIF: ff3b46deb62ce3f8e99c6a2c786729e1eea241ba | ||
RBStoryboardLink: f0f6cbc78a87c853d038017be4231e6e574c97ae | ||
RBStoryboardLink: 1bcff9be9fa9de9d66ea10518a327be1af729d03 | ||
|
||
COCOAPODS: 0.28.0 | ||
COCOAPODS: 0.29.0 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
PODS: | ||
- KIF (2.0.0) | ||
- RBStoryboardLink (0.0.6) | ||
- RBStoryboardLink (0.0.8) | ||
|
||
DEPENDENCIES: | ||
- KIF (~> 2.0) | ||
- RBStoryboardLink (from `..`) | ||
- RBStoryboardLink (from `../RBStoryboardLink.podspec`) | ||
|
||
EXTERNAL SOURCES: | ||
RBStoryboardLink: | ||
:path: .. | ||
:path: ../RBStoryboardLink.podspec | ||
|
||
SPEC CHECKSUMS: | ||
KIF: ff3b46deb62ce3f8e99c6a2c786729e1eea241ba | ||
RBStoryboardLink: f0f6cbc78a87c853d038017be4231e6e574c97ae | ||
RBStoryboardLink: 1bcff9be9fa9de9d66ea10518a327be1af729d03 | ||
|
||
COCOAPODS: 0.28.0 | ||
COCOAPODS: 0.29.0 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// UIViewController+RBStoryboardLink.h | ||
// Pods | ||
// | ||
// Created by Robert Brown on 1/25/14. | ||
// | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@class RBStoryboardLink; | ||
|
||
|
||
@interface UIViewController (RBStoryboardLink) | ||
|
||
/// Returns the storyboard link this view controller is contained in, if any. | ||
- (RBStoryboardLink *)rbsl_storyboardLink; | ||
|
||
/** | ||
* If the view controller is within a storyboard link, the link is returned. | ||
* If not, `self` is returned. The intent is to access certain visual elements | ||
* (such as `toolbarItems`) on the proper view controller when it's unknown if | ||
* the view controller is contained in a link. | ||
*/ | ||
- (UIViewController *)rbsl_targetViewController; | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// UIViewController+RBStoryboardLink.m | ||
// Pods | ||
// | ||
// Created by Robert Brown on 1/25/14. | ||
// | ||
// | ||
|
||
#import "UIViewController+RBStoryboardLink.h" | ||
#import "RBStoryboardLink.h" | ||
|
||
@implementation UIViewController (RBStoryboardLink) | ||
|
||
- (RBStoryboardLink *)rbsl_storyboardLink { | ||
|
||
if ([self isKindOfClass:[RBStoryboardLink class]]) | ||
return (RBStoryboardLink *)self; | ||
|
||
return [self.parentViewController rbsl_storyboardLink]; | ||
} | ||
|
||
- (UIViewController *)rbsl_targetViewController { | ||
return [self rbsl_storyboardLink] ?: self; | ||
} | ||
|
||
@end |