diff --git a/SCLAlertView/SCLAlertView.h b/SCLAlertView/SCLAlertView.h index 33ec029..1df8008 100755 --- a/SCLAlertView/SCLAlertView.h +++ b/SCLAlertView/SCLAlertView.h @@ -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 diff --git a/SCLAlertView/SCLAlertView.m b/SCLAlertView/SCLAlertView.m index 20a22dc..909b907 100755 --- a/SCLAlertView/SCLAlertView.m +++ b/SCLAlertView/SCLAlertView.m @@ -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];