diff --git a/VSAlert.xcodeproj/project.pbxproj b/VSAlert.xcodeproj/project.pbxproj index 12c1343..a2aeb75 100755 --- a/VSAlert.xcodeproj/project.pbxproj +++ b/VSAlert.xcodeproj/project.pbxproj @@ -361,7 +361,7 @@ 07F00ED91F8A96D9006FAC96 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1240; TargetAttributes = { 0710F9B61F8B1CB800C6D084 = { CreatedOnToolsVersion = 9.0; @@ -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; @@ -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; @@ -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"; @@ -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"; @@ -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; @@ -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"; diff --git a/VSAlert/VSAlertController.m b/VSAlert/VSAlertController.m index 769f7a5..940a88d 100755 --- a/VSAlert/VSAlertController.m +++ b/VSAlert/VSAlertController.m @@ -120,7 +120,8 @@ - (void)animateTransition:(id)transitionCo } completion:^(BOOL finished) { - + + [self _constrain:alertController.view toParent:fromController.view]; [transitionContext completeTransition:finished]; }]; @@ -144,7 +145,7 @@ - (void)animateTransition:(id)transitionCo } completion:^(BOOL finished) { - + [self _constrain:alertController.view toParent:fromController.view]; [transitionContext completeTransition:finished]; }]; @@ -173,6 +174,7 @@ - (void)animateTransition:(id)transitionCo } completion:^(BOOL finished) { + [self _constrain:alertController.view toParent:fromController.view]; [transitionContext completeTransition:finished]; }]; @@ -206,6 +208,7 @@ - (void)animateTransition:(id)transitionCo } completion:^(BOOL finished) { + [self _constrain:alertController.view toParent:fromController.view]; [transitionContext completeTransition:finished]; }]; @@ -238,6 +241,7 @@ - (void)animateTransition:(id)transitionCo } completion:^(BOOL finished) { + [self _constrain:alertController.view toParent:fromController.view]; [transitionContext completeTransition:finished]; }]; @@ -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 ()