Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched id to instancetype #349

Merged
merged 1 commit into from
Mar 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MMDrawerController/MMDrawerBarButtonItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

@return The newly-initialized bar button item.
*/
-(id)initWithTarget:(id)target action:(SEL)action;
-(instancetype)initWithTarget:(id)target action:(SEL)action;

/**
Returns the current color of the menu button for the state requested. This property is deprecated in iOS 7.0. Use `tintColor` instead.
Expand Down
6 changes: 3 additions & 3 deletions MMDrawerController/MMDrawerBarButtonItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ -(void)setShadowColor:(UIColor *)color forState:(UIControlState)state;

@implementation MMDrawerMenuButtonView

-(id)initWithFrame:(CGRect)frame{
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self setMenuButtonNormalColor:[[UIColor whiteColor] colorWithAlphaComponent:0.9f]];
Expand Down Expand Up @@ -238,7 +238,7 @@ +(UIImage*)drawerButtonItemImage{
return drawerButtonImage;
}

-(id)initWithTarget:(id)target action:(SEL)action{
-(instancetype)initWithTarget:(id)target action:(SEL)action{

if((floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)){
return [self initWithImage:[self.class drawerButtonItemImage]
Expand All @@ -259,7 +259,7 @@ -(id)initWithTarget:(id)target action:(SEL)action{
}
}

-(id)initWithCoder:(NSCoder *)aDecoder{
-(instancetype)initWithCoder:(NSCoder *)aDecoder{
// non-ideal way to get the target/action, but it works
UIBarButtonItem* barButtonItem = [[UIBarButtonItem alloc] initWithCoder: aDecoder];
return [self initWithTarget:barButtonItem.target action:barButtonItem.action];
Expand Down
6 changes: 3 additions & 3 deletions MMDrawerController/MMDrawerController.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr

@return The newly-initialized drawer container view controller.
*/
-(id)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController;
-(instancetype)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController;

/**
Creates and initializes an `MMDrawerController` object with the specified center view controller, left drawer view controller.
Expand All @@ -279,7 +279,7 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr

@return The newly-initialized drawer container view controller.
*/
-(id)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController;
-(instancetype)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController;

/**
Creates and initializes an `MMDrawerController` object with the specified center view controller, right drawer view controller.
Expand All @@ -289,7 +289,7 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr

@return The newly-initialized drawer container view controller.
*/
-(id)initWithCenterViewController:(UIViewController *)centerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController;
-(instancetype)initWithCenterViewController:(UIViewController *)centerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController;

///---------------------------------------
/// @name Opening and Closing a Drawer
Expand Down
6 changes: 3 additions & 3 deletions MMDrawerController/MMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder{
return self;
}

-(id)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController{
-(instancetype)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController{
NSParameterAssert(centerViewController);
self = [self init];
if(self){
Expand All @@ -171,11 +171,11 @@ -(id)initWithCenterViewController:(UIViewController *)centerViewController leftD
return self;
}

-(id)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController{
-(instancetype)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController{
return [self initWithCenterViewController:centerViewController leftDrawerViewController:leftDrawerViewController rightDrawerViewController:nil];
}

-(id)initWithCenterViewController:(UIViewController *)centerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController{
-(instancetype)initWithCenterViewController:(UIViewController *)centerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController{
return [self initWithCenterViewController:centerViewController leftDrawerViewController:nil rightDrawerViewController:rightDrawerViewController];
}

Expand Down