Skip to content

Commit

Permalink
Merge pull request #310 from FernandoReynoso/custom-width-init
Browse files Browse the repository at this point in the history
Add initWithWidth method for setting the width of the object.
  • Loading branch information
dogo authored Jun 9, 2023
2 parents c563c88 + adcecb2 commit 73af1ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SCLAlertView/SCLAlertView.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ typedef NS_ENUM(NSInteger, SCLAlertViewBackground)
*/
@property (nonatomic) BOOL horizontalButtons;

/** Initialize SCLAlertView using specific width.
*
* Init instance
*/
- (instancetype)initWithWidth:(CGFloat)width;

/** Initialize SCLAlertView using a new window.
*
* Init with new window
Expand Down
10 changes: 10 additions & 0 deletions SCLAlertView/SCLAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ - (instancetype)init
return self;
}

- (instancetype)initWithWidth:(CGFloat)width
{
self = [super init];
if (self)
{
[self setupViewWindowWidth:width];
}
return self;
}

- (instancetype)initWithWindowWidth:(CGFloat)windowWidth
{
self = [super init];
Expand Down

0 comments on commit 73af1ee

Please sign in to comment.