Skip to content

Commit

Permalink
Lib requires iOS 10
Browse files Browse the repository at this point in the history
  • Loading branch information
Varun Santhanam committed Oct 12, 2017
1 parent d5fcb70 commit 9db846c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 34 deletions.
26 changes: 1 addition & 25 deletions Release/VSAlert.framework/Versions/A/Headers/VSAlertController.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ typedef NS_ENUM(NSInteger, VSAlertControllerAnimationStyle) {
/**
VSAlertController is a drop-in replacement for UIAlertController with more features. It is created using the +alertControllerWithTitle:description:image:style: class method, and configured using instances of VSAlertAction. You can add text fields by calling -addTextField: on an instance of VSAlertController. Instantiate the controller, add your actions and textfieds. and any other configuration you might need. Present the controller modally using UIViewController's -presentViewController:animated:completion: method. VSAlertController respects the animation paramater of this call, and you configure the animation in question by setting your instances animationStyle property before presentation. You can also change this property in the handler of an action to use a different animation on dismissal.
*/
@interface VSAlertController : UIViewController
@interface VSAlertController : UIViewController<UIAppearance>

/**
@name Creating Alerts
Expand Down Expand Up @@ -240,28 +240,4 @@ typedef NS_ENUM(NSInteger, VSAlertControllerAnimationStyle) {
*/
@property (NS_NONATOMIC_IOSONLY, strong, readonly, nullable) UIImage *image;

/**
@name Customizing the Class Globally
*/

/**
Default title text color. Affects all instances instantiated after this change.
*/
@property (NS_NONATOMIC_IOSONLY, class, strong, nullable) UIColor *defaultTitleTextColor;

/**
Default description text color. Affects all instances instantiated after this change.
*/
@property (NS_NONATOMIC_IOSONLY, class, strong, nullable) UIColor *defaultMessageTextColor;

/**
Default title text font. Affects all instance instantiated after this change.
*/
@property (NS_NONATOMIC_IOSONLY, class, strong, nullable) UIFont *defaultTitleTextFont;

/**
Default description text font. Affects all instances instantiated after this change.
*/
@property (NS_NONATOMIC_IOSONLY, class, strong, nullable) UIFont *defaultMessageTextFont;

@end
Binary file modified Release/VSAlert.framework/Versions/A/VSAlert
Binary file not shown.
4 changes: 2 additions & 2 deletions VSAlert.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-fembed-bitcode";
Expand Down Expand Up @@ -535,7 +535,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "-fembed-bitcode";
OTHER_LDFLAGS = "-ObjC";
Expand Down
30 changes: 23 additions & 7 deletions VSAlert/VSAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,28 +293,44 @@ - (CGFloat)alertStackViewHeight {

+ (instancetype)appearance {

return [VSAlertControllerAppearanceProxy appearance];
return (VSAlertController *)[VSAlertControllerAppearanceProxy appearance];

}

+ (instancetype)appearanceForTraitCollection:(UITraitCollection *)trait {

return [VSAlertControllerAppearanceProxy appearanceForTraitCollection:trait];
return (VSAlertController *)[VSAlertControllerAppearanceProxy appearanceForTraitCollection:trait];

}

+ (instancetype)appearanceForTraitCollection:(UITraitCollection *)trait whenContainedInInstancesOfClasses:(NSArray<Class<UIAppearanceContainer>> *)containerTypes {

return [VSAlertControllerAppearanceProxy appearanceForTraitCollection:trait whenContainedInInstancesOfClasses:containerTypes];
return (VSAlertController *)[VSAlertControllerAppearanceProxy appearanceForTraitCollection:trait whenContainedInInstancesOfClasses:containerTypes];

}

+ (instancetype)appearanceWhenContainedInInstancesOfClasses:(NSArray<Class<UIAppearanceContainer>> *)containerTypes {

return [VSAlertControllerAppearanceProxy appearanceWhenContainedInInstancesOfClasses:containerTypes];
return (VSAlertController *)[VSAlertControllerAppearanceProxy appearanceWhenContainedInInstancesOfClasses:containerTypes];

}

+ (nonnull instancetype)appearanceForTraitCollection:(nonnull UITraitCollection *)trait whenContainedIn:(nullable Class<UIAppearanceContainer>)ContainerClass, ... {

return nil;

}


+ (nonnull instancetype)appearanceWhenContainedIn:(nullable Class<UIAppearanceContainer>)ContainerClass, ... {

return nil;

}




#pragma mark - UIViewControllerTransitioningDelegate

- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
Expand Down Expand Up @@ -435,7 +451,7 @@ - (void)_setUpAlertController {
_presentAnimator = [[VSAlertControllerTransitionAnimator alloc] init];
_dismissAnimator = [[VSAlertControllerTransitionAnimator alloc] init];

// Set up propertie without accessors for use with UIAppearance
// Set up propertie without accessors for use with UIAppearance
_alertTitleTextColor = [VSAlertController appearance].alertTitleTextColor ? [VSAlertController appearance].alertTitleTextColor : [UIColor blackColor];
_alertTitleTextFont = [VSAlertController appearance].alertTitleTextFont ? [VSAlertController appearance].alertTitleTextFont : [UIFont systemFontOfSize:17.0f weight:UIFontWeightSemibold];
_alertMessageTextColor = [VSAlertController appearance].alertMessageTextColor ? [VSAlertController appearance].alertMessageTextColor : [UIColor blackColor];
Expand Down Expand Up @@ -900,7 +916,7 @@ - (void)_processDefaultActions {
for (VSAlertAction *alertAction in _defaultActions) {

[self.alertActionStackView addArrangedSubview:alertAction];

[alertAction addTarget:self
action:@selector(_tappedAction:)
forControlEvents:UIControlEventTouchUpInside];
Expand Down Expand Up @@ -968,7 +984,7 @@ - (void)_tappedAction:(VSAlertAction *)sender {
if ([self.delegate respondsToSelector:@selector(alertController:didSelectAction:)]) {

dispatch_async(dispatch_get_main_queue(), ^{

[self.delegate alertController:self
didSelectAction:sender];

Expand Down

0 comments on commit 9db846c

Please sign in to comment.