forked from CoderMJLee/MJRefresh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
44 changed files
with
325 additions
and
184 deletions.
There are no files selected for viewing
294 changes: 160 additions & 134 deletions
294
MJRefreshExample/MJRefreshExample.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+9.47 KB
(110%)
...le.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
MJRefreshExample/MJRefreshExample/Classes/First/MJExampleWindow.m
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 @@ | ||
// | ||
// MJExampleWindow.m | ||
// MJRefreshExample | ||
// | ||
// Created by MJ Lee on 15/8/17. | ||
// Copyright (c) 2015年 小码哥. All rights reserved. | ||
// | ||
|
||
#import "MJExampleWindow.h" | ||
#import "MJTempViewController.h" | ||
|
||
@implementation MJExampleWindow | ||
|
||
static UIWindow *window_; | ||
+ (void)show | ||
{ | ||
window_ = [[UIWindow alloc] init]; | ||
CGFloat width = 150; | ||
CGFloat x = [UIScreen mainScreen].bounds.size.width - width - 10; | ||
window_.frame = CGRectMake(x, 0, width, 25); | ||
window_.windowLevel = UIWindowLevelAlert; | ||
window_.hidden = NO; | ||
window_.alpha = 0.5; | ||
window_.rootViewController = [[MJTempViewController alloc] init]; | ||
window_.backgroundColor = [UIColor clearColor]; | ||
} | ||
@end |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
MJRefreshExample/MJRefreshExample/Classes/First/MJTempViewController.h
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,18 @@ | ||
// | ||
// MJTempViewController.h | ||
// MJRefreshExample | ||
// | ||
// Created by MJ Lee on 15/9/22. | ||
// Copyright © 2015年 小码哥. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface MJTempViewController : UIViewController | ||
|
||
+ (instancetype)sharedInstance; | ||
|
||
@property (assign, nonatomic) UIStatusBarStyle statusBarStyle; | ||
@property (assign, nonatomic) BOOL statusBarHidden; | ||
|
||
@end |
94 changes: 94 additions & 0 deletions
94
MJRefreshExample/MJRefreshExample/Classes/First/MJTempViewController.m
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,94 @@ | ||
// | ||
// MJTempViewController.m | ||
// MJRefreshExample | ||
// | ||
// Created by MJ Lee on 15/9/22. | ||
// Copyright © 2015年 小码哥. All rights reserved. | ||
// | ||
|
||
#import "MJTempViewController.h" | ||
|
||
@interface MJTempViewController () | ||
|
||
@end | ||
|
||
@implementation MJTempViewController | ||
#pragma mark - 单例 | ||
static id instance_; | ||
|
||
+ (instancetype)sharedInstance | ||
{ | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
instance_ = [[self alloc] init]; | ||
}); | ||
return instance_; | ||
} | ||
|
||
+ (instancetype)allocWithZone:(struct _NSZone *)zone | ||
{ | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
instance_ = [super allocWithZone:zone]; | ||
}); | ||
return instance_; | ||
} | ||
|
||
#pragma mark - 初始化 | ||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
|
||
self.statusBarStyle = UIStatusBarStyleLightContent; | ||
|
||
self.view.backgroundColor = [UIColor clearColor]; | ||
|
||
UISegmentedControl *control = [[UISegmentedControl alloc] initWithItems:@[@"示例1", @"示例2", @"示例3"]]; | ||
control.tintColor = [UIColor orangeColor]; | ||
control.frame = self.view.bounds; | ||
control.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; | ||
control.selectedSegmentIndex = 0; | ||
[control addTarget:self action:@selector(contorlSelect:) forControlEvents:UIControlEventValueChanged]; | ||
[self.view addSubview:control]; | ||
} | ||
|
||
- (void)contorlSelect:(UISegmentedControl *)control | ||
{ | ||
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; | ||
keyWindow.rootViewController = [keyWindow.rootViewController.storyboard instantiateViewControllerWithIdentifier:[NSString stringWithFormat:@"%zd", control.selectedSegmentIndex]]; | ||
|
||
if (control.selectedSegmentIndex == 0) { | ||
self.statusBarStyle = UIStatusBarStyleLightContent; | ||
self.statusBarHidden = NO; | ||
} else if (control.selectedSegmentIndex == 1) { | ||
self.statusBarHidden = YES; | ||
} else if (control.selectedSegmentIndex == 2) { | ||
self.statusBarStyle = UIStatusBarStyleDefault; | ||
self.statusBarHidden = NO; | ||
} | ||
} | ||
|
||
- (UIStatusBarStyle)preferredStatusBarStyle | ||
{ | ||
return self.statusBarStyle; | ||
} | ||
|
||
- (BOOL)prefersStatusBarHidden | ||
{ | ||
return self.statusBarHidden; | ||
} | ||
|
||
- (void)setStatusBarHidden:(BOOL)statusBarHidden | ||
{ | ||
_statusBarHidden = statusBarHidden; | ||
|
||
[self setNeedsStatusBarAppearanceUpdate]; | ||
} | ||
|
||
- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle | ||
{ | ||
_statusBarStyle = statusBarStyle; | ||
|
||
[self setNeedsStatusBarAppearanceUpdate]; | ||
} | ||
|
||
@end |
37 changes: 0 additions & 37 deletions
37
MJRefreshExample/MJRefreshExample/Classes/MJExampleWindow.m
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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,12 @@ | ||
// | ||
// PrefixHeader.pch | ||
// MJRefreshExample | ||
// | ||
// Created by MJ Lee on 15/9/22. | ||
// Copyright © 2015年 小码哥. All rights reserved. | ||
// | ||
|
||
#ifndef PrefixHeader_pch | ||
#define PrefixHeader_pch | ||
#import "MJTempViewController.h" | ||
#endif /* PrefixHeader_pch */ |