Skip to content

Commit

Permalink
Moved Demo project to Sample/
Browse files Browse the repository at this point in the history
Reorganised project
Updated travis for new project location
  • Loading branch information
Ashton-W committed Mar 20, 2015
1 parent 17bb9d8 commit ce7b75d
Show file tree
Hide file tree
Showing 53 changed files with 117 additions and 185 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: objective-c
before_install:
- brew outdated xctool || brew upgrade xctool
xcode_workspace: CRToastDemo.xcworkspace
# xcode_project: CRToastDemo.xcodeproj
- brew update
- brew reinstall xctool
- gem update cocoapods
xcode_workspace: Example/CRToastDemo.xcworkspace
xcode_scheme: CRToastTests
xcode_sdk:
- iphonesimulator7.0
Expand Down
11 changes: 6 additions & 5 deletions CRToast/CRToast.m
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ + (void)setDefaultOptions:(NSDictionary*)defaultOptions {

#pragma mark - Notification View Helpers

- (UIView*)notificationView {
- (UIView *)notificationView {
return self.privateNotificationView;
}

Expand All @@ -447,7 +447,7 @@ - (CGRect)notificationViewAnimationFrame2 {
return CRNotificationViewFrame(self.notificationType, self.outAnimationDirection, self.preferredHeight);
}

- (UIView*)statusBarView {
- (UIView *)statusBarView {
return self.privateStatusBarView;
}

Expand Down Expand Up @@ -494,7 +494,7 @@ - (void)tapGestureRecognizerTapped:(CRToastTapGestureRecognizer*)tapGestureRecog

#pragma mark - Overrides

- (NSArray*)gestureRecognizersForInteractionResponder:(NSArray*)interactionResponders {
- (NSArray *)gestureRecognizersForInteractionResponder:(NSArray*)interactionResponders {
NSMutableArray *gestureRecognizers = [@[] mutableCopy];
for (CRToastInteractionResponder *interactionResponder in [kCRInteractionResponders arrayByAddingObjectsFromArray:interactionResponders]) {
if (CRToastInteractionResponderIsGenertic(interactionResponder.interactionType)) {
Expand All @@ -508,7 +508,7 @@ - (NSArray*)gestureRecognizersForInteractionResponder:(NSArray*)interactionRespo
return [NSArray arrayWithArray:gestureRecognizers];
}

- (NSArray*)gestureRecognizers {
- (NSArray *)gestureRecognizers {
return _options[kCRToastInteractionRespondersKey] ?
_gestureRecognizers ?: [self gestureRecognizersForInteractionResponder:_options[kCRToastInteractionRespondersKey]] :
[self gestureRecognizersForInteractionResponder:kCRInteractionResponders];
Expand Down Expand Up @@ -658,7 +658,7 @@ - (UIView *)backgroundView {
return _options[kCRToastBackgroundViewKey];
}

- (UIImage*)image {
- (UIImage *)image {
return _options[kCRToastImageKey] ?: kCRImageDefault;
}

Expand All @@ -673,6 +673,7 @@ - (CRToastAccessoryViewAlignment)imageAlignment {
- (BOOL)showActivityIndicator {
return _options[kCRToastShowActivityIndicatorKey] ? [_options[kCRToastShowActivityIndicatorKey] boolValue] : kCRShowActivityIndicatorDefault;
}

- (UIActivityIndicatorViewStyle)activityIndicatorViewStyle {
return _options[kCRToastActivityIndicatorViewStyleKey] ? [_options[kCRToastActivityIndicatorViewStyleKey] integerValue] : kCRActivityIndicatorViewStyleDefault;
}
Expand Down
4 changes: 0 additions & 4 deletions CRToast/CRToastLayoutHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,3 @@ static UIView *CRStatusBarSnapShotView(BOOL underStatusBar) {
[[UIApplication sharedApplication].keyWindow.rootViewController.view snapshotViewAfterScreenUpdates:YES] :
[[UIScreen mainScreen] snapshotViewAfterScreenUpdates:YES];
}
#pragma clang diagnostic pop

@interface CRToastLayoutHelpers : NSObject
@end
2 changes: 1 addition & 1 deletion CRToast/CRToastManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ - (void)displayNotification:(CRToast*)notification {
CGRect containerFrame = CRGetNotificationContainerFrame(CRGetDeviceOrientation(), notificationSize);

CRToastViewController *rootViewController = (CRToastViewController*)_notificationWindow.rootViewController;
[rootViewController statusBarStyle:notification.statusBarStyle];
rootViewController.statusBarStyle = notification.statusBarStyle;
rootViewController.autorotate = notification.autorotate;
rootViewController.notification = notification;

Expand Down
3 changes: 1 addition & 2 deletions CRToast/CRToastViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@property (nonatomic, assign) BOOL autorotate;
@property (nonatomic, weak) CRToast *notification;
@property (nonatomic, weak) UIView *toastView;

- (void)statusBarStyle:(UIStatusBarStyle)newStatusBarStyle;
@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;

@end
25 changes: 11 additions & 14 deletions CRToast/CRToastViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ @implementation CRToastContainerView
@end

#pragma mark - CRToastViewController
@interface CRToastViewController ()
@end

@implementation CRToastViewController

UIStatusBarStyle statusBarStyle;

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
Expand All @@ -30,21 +26,23 @@ - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibB
return self;
}

- (BOOL)prefersStatusBarHidden {
return [UIApplication sharedApplication].statusBarHidden;
- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle {
_statusBarStyle = statusBarStyle;
[self setNeedsStatusBarAppearanceUpdate];
}

- (UIStatusBarStyle)preferredStatusBarStyle {
return statusBarStyle;
#pragma mark UIViewController

- (BOOL)shouldAutorotate {
return _autorotate;
}

- (void)statusBarStyle:(UIStatusBarStyle)newStatusBarStyle {
statusBarStyle = newStatusBarStyle;
[self setNeedsStatusBarAppearanceUpdate];
- (BOOL)prefersStatusBarHidden {
return [UIApplication sharedApplication].statusBarHidden;
}

- (BOOL)shouldAutorotate {
return _autorotate;
- (UIStatusBarStyle)preferredStatusBarStyle {
return self.statusBarStyle;
}

- (void)loadView {
Expand All @@ -60,5 +58,4 @@ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInte
}
}


@end

This file was deleted.

41 changes: 0 additions & 41 deletions CRToastDemo.xcworkspace/xcshareddata/CRToastDemo.xccheckout

This file was deleted.

Loading

0 comments on commit ce7b75d

Please sign in to comment.