Skip to content

Commit

Permalink
Support iOS 14
Browse files Browse the repository at this point in the history
  • Loading branch information
vsanthanam committed Mar 23, 2021
1 parent 9818cc5 commit d217d57
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
14 changes: 7 additions & 7 deletions VSAlert.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
07F00ED91F8A96D9006FAC96 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1240;
TargetAttributes = {
0710F9B61F8B1CB800C6D084 = {
CreatedOnToolsVersion = 9.0;
Expand Down Expand Up @@ -571,7 +571,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = VSAlertTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -607,7 +607,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = VSAlertTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.varunsanthanam.VSAlertTests;
Expand Down Expand Up @@ -732,7 +732,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 = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-fembed-bitcode";
Expand Down Expand Up @@ -791,7 +791,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 = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "-fembed-bitcode";
OTHER_LDFLAGS = "-ObjC";
Expand Down Expand Up @@ -878,7 +878,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "VSAlert-Example/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -936,7 +936,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "VSAlert-Example/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.varunsanthanam.VSAlert-Example";
Expand Down
15 changes: 13 additions & 2 deletions VSAlert/VSAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo

}
completion:^(BOOL finished) {


[self _constrain:alertController.view toParent:fromController.view];
[transitionContext completeTransition:finished];

}];
Expand All @@ -144,7 +145,7 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
}
completion:^(BOOL finished) {


[self _constrain:alertController.view toParent:fromController.view];
[transitionContext completeTransition:finished];

}];
Expand Down Expand Up @@ -173,6 +174,7 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
}
completion:^(BOOL finished) {

[self _constrain:alertController.view toParent:fromController.view];
[transitionContext completeTransition:finished];

}];
Expand Down Expand Up @@ -206,6 +208,7 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
}
completion:^(BOOL finished) {

[self _constrain:alertController.view toParent:fromController.view];
[transitionContext completeTransition:finished];

}];
Expand Down Expand Up @@ -238,6 +241,7 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
}
completion:^(BOOL finished) {

[self _constrain:alertController.view toParent:fromController.view];
[transitionContext completeTransition:finished];

}];
Expand Down Expand Up @@ -508,6 +512,13 @@ - (VSAlertControllerAnimationStyle)_automaticDismissalStyleForController:(VSAler

}

- (void)_constrain:(UIView *)alertView toParent:(UIView *)parent {
[alertView.topAnchor constraintEqualToAnchor: parent.topAnchor].active = YES;
[alertView.leadingAnchor constraintEqualToAnchor: parent.leadingAnchor].active = YES;
[alertView.trailingAnchor constraintEqualToAnchor: parent.trailingAnchor].active = YES;
[alertView.bottomAnchor constraintEqualToAnchor: parent.bottomAnchor].active = YES;
}

@end

@interface VSAlertController ()<UIViewControllerTransitioningDelegate>
Expand Down

0 comments on commit d217d57

Please sign in to comment.