Skip to content

Commit 47d47f2

Browse files
committed
Merge pull request #350 from mutualmobile/remove_ios6
Removed pre iOS 7 support
2 parents 1b2fdc0 + eb3350a commit 47d47f2

12 files changed

Lines changed: 79 additions & 228 deletions

KitchenSink/ExampleFiles/MMAppDelegate.m

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,15 @@ -(BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(
4646

4747
UINavigationController * navigationController = [[MMNavigationController alloc] initWithRootViewController:centerViewController];
4848
[navigationController setRestorationIdentifier:@"MMExampleCenterNavigationControllerRestorationKey"];
49-
if(OSVersionIsAtLeastiOS7()){
50-
UINavigationController * rightSideNavController = [[MMNavigationController alloc] initWithRootViewController:rightSideDrawerViewController];
51-
[rightSideNavController setRestorationIdentifier:@"MMExampleRightNavigationControllerRestorationKey"];
52-
UINavigationController * leftSideNavController = [[MMNavigationController alloc] initWithRootViewController:leftSideDrawerViewController];
53-
[leftSideNavController setRestorationIdentifier:@"MMExampleLeftNavigationControllerRestorationKey"];
54-
self.drawerController = [[MMDrawerController alloc]
55-
initWithCenterViewController:navigationController
56-
leftDrawerViewController:leftSideNavController
57-
rightDrawerViewController:rightSideNavController];
58-
[self.drawerController setShowsShadow:NO];
59-
}
60-
else{
61-
self.drawerController = [[MMDrawerController alloc]
62-
initWithCenterViewController:navigationController
63-
leftDrawerViewController:leftSideDrawerViewController
64-
rightDrawerViewController:rightSideDrawerViewController];
65-
}
49+
UINavigationController * rightSideNavController = [[MMNavigationController alloc] initWithRootViewController:rightSideDrawerViewController];
50+
[rightSideNavController setRestorationIdentifier:@"MMExampleRightNavigationControllerRestorationKey"];
51+
UINavigationController * leftSideNavController = [[MMNavigationController alloc] initWithRootViewController:leftSideDrawerViewController];
52+
[leftSideNavController setRestorationIdentifier:@"MMExampleLeftNavigationControllerRestorationKey"];
53+
self.drawerController = [[MMDrawerController alloc]
54+
initWithCenterViewController:navigationController
55+
leftDrawerViewController:leftSideNavController
56+
rightDrawerViewController:rightSideNavController];
57+
[self.drawerController setShowsShadow:NO];
6658
[self.drawerController setRestorationIdentifier:@"MMDrawer"];
6759
[self.drawerController setMaximumRightDrawerWidth:200.0];
6860
[self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
@@ -78,13 +70,12 @@ -(BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(
7870
}
7971
}];
8072
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
81-
if(OSVersionIsAtLeastiOS7()){
82-
UIColor * tintColor = [UIColor colorWithRed:29.0/255.0
83-
green:173.0/255.0
84-
blue:234.0/255.0
85-
alpha:1.0];
86-
[self.window setTintColor:tintColor];
87-
}
73+
74+
UIColor * tintColor = [UIColor colorWithRed:29.0/255.0
75+
green:173.0/255.0
76+
blue:234.0/255.0
77+
alpha:1.0];
78+
[self.window setTintColor:tintColor];
8879
[self.window setRootViewController:self.drawerController];
8980

9081
return YES;

KitchenSink/ExampleFiles/MMDrawerControllerKitchenSink-Prefix.pch

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,4 @@
1111
#ifdef __OBJC__
1212
#import <UIKit/UIKit.h>
1313
#import <Foundation/Foundation.h>
14-
#endif
15-
16-
17-
static BOOL OSVersionIsAtLeastiOS7() {
18-
return (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1);
19-
}
14+
#endif

KitchenSink/ExampleFiles/MMExampleCenterTableViewController.m

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,12 @@ - (void)viewDidLoad
7676
[self setupLeftMenuButton];
7777
[self setupRightMenuButton];
7878

79-
if(OSVersionIsAtLeastiOS7()){
80-
UIColor * barColor = [UIColor
81-
colorWithRed:247.0/255.0
82-
green:249.0/255.0
83-
blue:250.0/255.0
84-
alpha:1.0];
85-
[self.navigationController.navigationBar setBarTintColor:barColor];
86-
}
87-
else {
88-
UIColor * barColor = [UIColor
89-
colorWithRed:78.0/255.0
90-
green:156.0/255.0
91-
blue:206.0/255.0
92-
alpha:1.0];
93-
[self.navigationController.navigationBar setTintColor:barColor];
94-
}
79+
UIColor * barColor = [UIColor
80+
colorWithRed:247.0/255.0
81+
green:249.0/255.0
82+
blue:250.0/255.0
83+
alpha:1.0];
84+
[self.navigationController.navigationBar setBarTintColor:barColor];
9585

9686

9787
MMLogoView * logo = [[MMLogoView alloc] initWithFrame:CGRectMake(0, 0, 29, 31)];

KitchenSink/ExampleFiles/MMExampleSideDrawerViewController.m

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,18 @@ - (void)viewDidLoad
3232
{
3333
[super viewDidLoad];
3434

35-
if(OSVersionIsAtLeastiOS7()){
36-
_tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
37-
}
38-
else {
39-
_tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
40-
}
35+
_tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
4136

4237
[self.tableView setDelegate:self];
4338
[self.tableView setDataSource:self];
4439
[self.view addSubview:self.tableView];
4540
[self.tableView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
4641

4742
UIColor * tableViewBackgroundColor;
48-
if(OSVersionIsAtLeastiOS7()){
49-
tableViewBackgroundColor = [UIColor colorWithRed:110.0/255.0
50-
green:113.0/255.0
51-
blue:115.0/255.0
52-
alpha:1.0];
53-
}
54-
else {
55-
tableViewBackgroundColor = [UIColor colorWithRed:77.0/255.0
56-
green:79.0/255.0
57-
blue:80.0/255.0
58-
alpha:1.0];
59-
}
43+
tableViewBackgroundColor = [UIColor colorWithRed:110.0/255.0
44+
green:113.0/255.0
45+
blue:115.0/255.0
46+
alpha:1.0];
6047
[self.tableView setBackgroundColor:tableViewBackgroundColor];
6148

6249
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
@@ -322,24 +309,14 @@ -(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSIntege
322309

323310
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
324311
MMSideDrawerSectionHeaderView * headerView;
325-
if(OSVersionIsAtLeastiOS7()){
326-
headerView = [[MMSideDrawerSectionHeaderView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 56.0)];
327-
}
328-
else {
329-
headerView = [[MMSideDrawerSectionHeaderView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 23.0)];
330-
}
312+
headerView = [[MMSideDrawerSectionHeaderView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 56.0)];
331313
[headerView setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
332314
[headerView setTitle:[tableView.dataSource tableView:tableView titleForHeaderInSection:section]];
333315
return headerView;
334316
}
335317

336318
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
337-
if(OSVersionIsAtLeastiOS7()){
338-
return 56.0;
339-
}
340-
else {
341-
return 23.0;
342-
}
319+
return 56.0;
343320
}
344321

345322
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

KitchenSink/ExampleFiles/MMExampleViewController.m

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
3838
- (void)viewDidLoad
3939
{
4040
[super viewDidLoad];
41-
if(OSVersionIsAtLeastiOS7()){
42-
[[NSNotificationCenter defaultCenter]
43-
addObserver:self
44-
selector:@selector(contentSizeDidChangeNotification:)
45-
name:UIContentSizeCategoryDidChangeNotification
46-
object:nil];
47-
}
41+
[[NSNotificationCenter defaultCenter]
42+
addObserver:self
43+
selector:@selector(contentSizeDidChangeNotification:)
44+
name:UIContentSizeCategoryDidChangeNotification
45+
object:nil];
4846
}
4947

5048
- (void)dealloc{

KitchenSink/ExampleFiles/MMSideDrawerSectionHeaderView.m

Lines changed: 19 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,12 @@ - (id)initWithFrame:(CGRect)frame
3333
if (self) {
3434
// Initialization code
3535

36-
if(OSVersionIsAtLeastiOS7()){
37-
[self setBackgroundColor:[UIColor colorWithRed:110./255.0
38-
green:113.0/255.0
39-
blue:115.0/255.0
40-
alpha:1.0]];
41-
}
42-
else {
43-
[self setBackgroundColor:[UIColor colorWithRed:77.0/255.0
44-
green:79.0/255.0
45-
blue:80.0/255.0
46-
alpha:1.0]];
47-
}
36+
[self setBackgroundColor:[UIColor colorWithRed:110./255.0
37+
green:113.0/255.0
38+
blue:115.0/255.0
39+
alpha:1.0]];
4840

49-
if(OSVersionIsAtLeastiOS7()){
50-
_label = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(self.bounds)-28,CGRectGetWidth(self.bounds)-30, 22)];
51-
}
52-
else {
53-
_label = [[UILabel alloc] initWithFrame:CGRectInset(self.bounds, 10.0, 2.0)];
54-
}
41+
_label = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(self.bounds)-28,CGRectGetWidth(self.bounds)-30, 22)];
5542

5643

5744
if([[UIFont class] respondsToSelector:@selector(preferredFontForTextStyle:)]){
@@ -66,10 +53,6 @@ - (id)initWithFrame:(CGRect)frame
6653
green:206.0/255.0
6754
blue:209.0/255.0
6855
alpha:1.0]];
69-
if(OSVersionIsAtLeastiOS7() == NO){
70-
[self.label setShadowOffset:CGSizeMake(0, 1)];
71-
[self.label setShadowColor:[[UIColor blackColor] colorWithAlphaComponent:.5]];
72-
}
7356
[self.label setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleTopMargin];
7457
[self addSubview:self.label];
7558
[self setClipsToBounds:NO];
@@ -84,79 +67,20 @@ -(void)setTitle:(NSString *)title{
8467

8568
-(void)drawRect:(CGRect)rect{
8669
//// General Declarations
87-
if(OSVersionIsAtLeastiOS7()== NO){
88-
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
89-
CGContextRef context = UIGraphicsGetCurrentContext();
90-
91-
//// Color Declarations
92-
UIColor* color = [UIColor colorWithRed: 0.373 green: 0.388 blue: 0.404 alpha: 1];
93-
UIColor* color2 = [UIColor colorWithRed: 0.216 green: 0.231 blue: 0.243 alpha: 1];
94-
UIColor* color3 = [UIColor colorWithRed: 0.451 green: 0.463 blue: 0.475 alpha: 1];
95-
UIColor* color4 = [UIColor colorWithRed: 0.184 green: 0.2 blue: 0.212 alpha: 1];
96-
UIColor* fillColor2 = [UIColor colorWithRed: 0.373 green: 0.388 blue: 0.404 alpha: 0];
97-
98-
//// Gradient Declarations
99-
NSArray* gradient2Colors = [NSArray arrayWithObjects:
100-
(id)color.CGColor,
101-
(id)fillColor2.CGColor, nil];
102-
CGFloat gradient2Locations[] = {0, 1};
103-
CGGradientRef gradient2 = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef)gradient2Colors, gradient2Locations);
104-
105-
//// Frames
106-
CGRect frame = CGRectMake(0, -1, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)+1);
107-
108-
109-
//// Fill Drawing
110-
CGRect fillRect = CGRectMake(CGRectGetMinX(frame), CGRectGetMinY(frame), CGRectGetWidth(frame), CGRectGetHeight(frame) - 1);
111-
UIBezierPath* fillPath = [UIBezierPath bezierPathWithRect: fillRect];
112-
CGContextSaveGState(context);
113-
[fillPath addClip];
114-
CGContextDrawLinearGradient(context, gradient2,
115-
CGPointMake(CGRectGetMidX(fillRect), CGRectGetMinY(fillRect)),
116-
CGPointMake(CGRectGetMidX(fillRect), CGRectGetMaxY(fillRect)),
117-
0);
118-
CGContextRestoreGState(context);
119-
120-
121-
//// TopStroke Drawing
122-
UIBezierPath* topStrokePath = [UIBezierPath bezierPathWithRect: CGRectMake(CGRectGetMinX(frame), CGRectGetMinY(frame), CGRectGetWidth(frame), 1)];
123-
[color4 setFill];
124-
[topStrokePath fill];
125-
126-
127-
//// Highlight Drawing
128-
UIBezierPath* highlightPath = [UIBezierPath bezierPathWithRect: CGRectMake(CGRectGetMinX(frame), CGRectGetMinY(frame) + 1, CGRectGetWidth(frame), 1)];
129-
[color3 setFill];
130-
[highlightPath fill];
131-
132-
133-
//// BottomStroke Drawing
134-
UIBezierPath* bottomStrokePath = [UIBezierPath bezierPathWithRect: CGRectMake(CGRectGetMinX(frame), CGRectGetMinY(frame) + CGRectGetHeight(frame) - 1, CGRectGetWidth(frame), 1)];
135-
[color2 setFill];
136-
[bottomStrokePath fill];
137-
138-
139-
//// Cleanup
140-
CGGradientRelease(gradient2);
141-
CGColorSpaceRelease(colorSpace);
142-
143-
}
144-
else {
145-
CGContextRef context = UIGraphicsGetCurrentContext();
146-
UIColor * lineColor = [UIColor colorWithRed:94.0/255.0
147-
green:97.0/255.0
148-
blue:99.0/255.0
149-
alpha:1.0];
150-
CGContextSetStrokeColorWithColor(context, lineColor.CGColor);
151-
152-
CGContextSetLineWidth(context, 1.0);
153-
154-
CGContextMoveToPoint(context, CGRectGetMinX(self.bounds), CGRectGetMaxY(self.bounds)-.5); //start at this point
155-
156-
CGContextAddLineToPoint(context, CGRectGetMaxX(self.bounds), CGRectGetMaxY(self.bounds)-.5); //draw to this point
157-
158-
CGContextStrokePath(context);
159-
}
70+
CGContextRef context = UIGraphicsGetCurrentContext();
71+
UIColor * lineColor = [UIColor colorWithRed:94.0/255.0
72+
green:97.0/255.0
73+
blue:99.0/255.0
74+
alpha:1.0];
75+
CGContextSetStrokeColorWithColor(context, lineColor.CGColor);
76+
77+
CGContextSetLineWidth(context, 1.0);
78+
79+
CGContextMoveToPoint(context, CGRectGetMinX(self.bounds), CGRectGetMaxY(self.bounds)-.5); //start at this point
80+
81+
CGContextAddLineToPoint(context, CGRectGetMaxX(self.bounds), CGRectGetMaxY(self.bounds)-.5); //draw to this point
82+
83+
CGContextStrokePath(context);
16084
}
16185

16286
@end

KitchenSink/ExampleFiles/MMSideDrawerTableViewCell.m

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,10 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
3232
UIView * backgroundView = [[UIView alloc] initWithFrame:self.bounds];
3333
[backgroundView setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
3434
UIColor * backgroundColor;
35-
if(OSVersionIsAtLeastiOS7()){
36-
backgroundColor = [UIColor colorWithRed:122.0/255.0
37-
green:126.0/255.0
38-
blue:128.0/255.0
39-
alpha:1.0];
40-
}
41-
else {
42-
backgroundColor = [UIColor colorWithRed:77.0/255.0
43-
green:79.0/255.0
44-
blue:80.0/255.0
45-
alpha:1.0];
46-
}
35+
backgroundColor = [UIColor colorWithRed:122.0/255.0
36+
green:126.0/255.0
37+
blue:128.0/255.0
38+
alpha:1.0];
4739
[backgroundView setBackgroundColor:backgroundColor];
4840

4941
[self setBackgroundView:backgroundView];
@@ -54,10 +46,6 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
5446
green:236.0/255.0
5547
blue:242.0/255.0
5648
alpha:1.0]];
57-
if(OSVersionIsAtLeastiOS7()== NO){
58-
[self.textLabel setShadowColor:[[UIColor blackColor] colorWithAlphaComponent:.5]];
59-
[self.textLabel setShadowOffset:CGSizeMake(0, 1)];
60-
}
6149
}
6250
return self;
6351
}

KitchenSink/ExampleFiles/MMTableViewCell.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,7 @@ -(void)drawRect:(CGRect)rect{
4141

4242
//// Color Declarations
4343
UIColor* shadow;
44-
if(OSVersionIsAtLeastiOS7()){
45-
shadow = [UIColor clearColor];
46-
}
47-
else {
48-
shadow = [UIColor colorWithRed: 0 green: 0 blue: 0 alpha: 0.46];
49-
}
44+
shadow = [UIColor clearColor];
5045
UIColor* chevronColor = self.color;
5146

5247
//// Shadow Declarations

KitchenSink/MMDrawerControllerKitchenSink.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
GCC_PRECOMPILE_PREFIX_HEADER = YES;
408408
GCC_PREFIX_HEADER = "ExampleFiles/MMDrawerControllerKitchenSink-Prefix.pch";
409409
INFOPLIST_FILE = "ExampleFiles/MMDrawerControllerKitchenSink-Info.plist";
410-
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
410+
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
411411
PRODUCT_NAME = MMDrawerControllerKitchenSink;
412412
WARNING_CFLAGS = "-Wdocumentation";
413413
WRAPPER_EXTENSION = app;
@@ -420,7 +420,7 @@
420420
GCC_PRECOMPILE_PREFIX_HEADER = YES;
421421
GCC_PREFIX_HEADER = "ExampleFiles/MMDrawerControllerKitchenSink-Prefix.pch";
422422
INFOPLIST_FILE = "ExampleFiles/MMDrawerControllerKitchenSink-Info.plist";
423-
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
423+
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
424424
PRODUCT_NAME = MMDrawerControllerKitchenSink;
425425
WARNING_CFLAGS = "-Wdocumentation";
426426
WRAPPER_EXTENSION = app;

MMDrawerController.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22
s.name = "MMDrawerController"
3-
s.version = "0.5.7"
3+
s.version = "0.6.0"
44
s.summary = "A lightweight, easy-to-use side drawer navigation controller."
55
s.homepage = "https://github.com/mutualmobile/MMDrawerController"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }
77
s.author = { "Kevin Harwood" => "kevin.harwood@mutualmobile.com" }
8-
s.source = { :git => "https://github.com/mutualmobile/MMDrawerController.git", :tag => "0.5.7" }
9-
s.platform = :ios, '5.0'
8+
s.source = { :git => "https://github.com/mutualmobile/MMDrawerController.git", :tag => "0.6.0" }
9+
s.platform = :ios, '7.0'
1010
s.requires_arc = true
1111
s.screenshots = [ "http://mutualmobile.github.io/MMDrawerController/ExampleImages/example1.png",
1212
"http://mutualmobile.github.io/MMDrawerController/ExampleImages/example2.png" ]

0 commit comments

Comments
 (0)