Skip to content

Commit 0360d22

Browse files
committed
Set iOS deployment target to 8.0
Drop support to iOS 6.x and 7.x
1 parent ac323e6 commit 0360d22

3 files changed

Lines changed: 24 additions & 75 deletions

File tree

SCLAlertView-Objective-C.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pod::Spec.new do |spec|
1010
spec.social_media_url = "http://twitter.com/di_autilio"
1111
spec.platform = :ios
1212
spec.frameworks = "UIKit", "AudioToolbox", "Accelerate", "CoreGraphics"
13-
spec.ios.deployment_target = '6.0'
13+
spec.ios.deployment_target = '8.0'
1414
spec.source = { :git => "https://github.com/dogo/SCLAlertView.git", :tag => spec.version.to_s }
1515
spec.source_files = "SCLAlertView/*"
1616
spec.requires_arc = true

SCLAlertView/SCLAlertView.m

Lines changed: 18 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,9 @@ - (void)setupViewWindowWidth:(CGFloat)windowWidth
232232
_viewText.textAlignment = NSTextAlignmentCenter;
233233
_viewText.font = [UIFont fontWithName:_bodyTextFontFamily size:_bodyFontSize];
234234
_viewText.frame = CGRectMake(12.0f, _subTitleY, _windowWidth - 24.0f, _subTitleHeight);
235-
236-
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
237-
{
238-
_viewText.textContainerInset = UIEdgeInsetsZero;
239-
_viewText.textContainer.lineFragmentPadding = 0;
240-
self.automaticallyAdjustsScrollViewInsets = NO;
241-
}
235+
_viewText.textContainerInset = UIEdgeInsetsZero;
236+
_viewText.textContainer.lineFragmentPadding = 0;
237+
self.automaticallyAdjustsScrollViewInsets = NO;
242238

243239
// Content View
244240
_contentView.backgroundColor = [UIColor whiteColor];
@@ -308,14 +304,6 @@ - (void)viewWillLayoutSubviews
308304
sz = _rootViewController.view.frame.size;
309305
}
310306

311-
if (SYSTEM_VERSION_LESS_THAN(@"8.0")) {
312-
// iOS versions before 7.0 did not switch the width and height on device roration
313-
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
314-
CGSize ssz = sz;
315-
sz = CGSizeMake(ssz.height, ssz.width);
316-
}
317-
}
318-
319307
// Set new main frame
320308
CGRect r;
321309
if (self.view.superview != nil) {
@@ -1466,53 +1454,25 @@ - (void)fadeIn
14661454

14671455
- (void)slideInFromTop
14681456
{
1469-
if (SYSTEM_VERSION_LESS_THAN(@"7.0"))
1470-
{
1471-
//From Frame
1472-
CGRect frame = self.backgroundView.frame;
1473-
frame.origin.y = -self.backgroundView.frame.size.height;
1474-
self.view.frame = frame;
1457+
//From Frame
1458+
CGRect frame = self.backgroundView.frame;
1459+
frame.origin.y = -self.backgroundView.frame.size.height;
1460+
self.view.frame = frame;
1461+
1462+
[UIView animateWithDuration:0.5f delay:0.0f usingSpringWithDamping:0.6f initialSpringVelocity:0.5f options:0 animations:^{
1463+
self.backgroundView.alpha = self.backgroundOpacity;
14751464

1476-
[UIView animateWithDuration:0.3f animations:^{
1477-
self.backgroundView.alpha = self.backgroundOpacity;
1478-
1479-
//To Frame
1480-
CGRect frame = self.backgroundView.frame;
1481-
frame.origin.y = 0.0f;
1482-
self.view.frame = frame;
1483-
1484-
self.view.alpha = 1.0f;
1485-
} completion:^(BOOL completed) {
1486-
[UIView animateWithDuration:0.2f animations:^{
1487-
self.view.center = self.backgroundView.center;
1488-
} completion:^(BOOL finished) {
1489-
if ( self.showAnimationCompletionBlock ){
1490-
self.showAnimationCompletionBlock();
1491-
}
1492-
}];
1493-
}];
1494-
}
1495-
else {
1496-
//From Frame
1465+
//To Frame
14971466
CGRect frame = self.backgroundView.frame;
1498-
frame.origin.y = -self.backgroundView.frame.size.height;
1467+
frame.origin.y = 0.0f;
14991468
self.view.frame = frame;
15001469

1501-
[UIView animateWithDuration:0.5f delay:0.0f usingSpringWithDamping:0.6f initialSpringVelocity:0.5f options:0 animations:^{
1502-
self.backgroundView.alpha = self.backgroundOpacity;
1503-
1504-
//To Frame
1505-
CGRect frame = self.backgroundView.frame;
1506-
frame.origin.y = 0.0f;
1507-
self.view.frame = frame;
1508-
1509-
self.view.alpha = 1.0f;
1510-
} completion:^(BOOL finished) {
1511-
if ( self.showAnimationCompletionBlock ){
1512-
self.showAnimationCompletionBlock();
1513-
}
1514-
}];
1515-
}
1470+
self.view.alpha = 1.0f;
1471+
} completion:^(BOOL finished) {
1472+
if ( self.showAnimationCompletionBlock ){
1473+
self.showAnimationCompletionBlock();
1474+
}
1475+
}];
15161476
}
15171477

15181478
- (void)slideInFromBottom

SCLAlertView/UIImage+ImageEffects.m

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -312,22 +312,11 @@ + (UIImage *)convertViewToImage:(UIView *)view
312312
CGFloat scale = [UIScreen mainScreen].scale;
313313
UIImage *capturedScreen;
314314

315-
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
316-
{
317-
//Optimized/fast method for rendering a UIView as image on iOS 7 and later versions.
318-
UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, scale);
319-
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO];
320-
capturedScreen = UIGraphicsGetImageFromCurrentImageContext();
321-
UIGraphicsEndImageContext();
322-
}
323-
else
324-
{
325-
//For devices running on earlier iOS versions.
326-
UIGraphicsBeginImageContextWithOptions(view.bounds.size,YES, scale);
327-
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
328-
capturedScreen = UIGraphicsGetImageFromCurrentImageContext();
329-
UIGraphicsEndImageContext();
330-
}
315+
//Optimized/fast method for rendering a UIView as image on iOS 7 and later versions.
316+
UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, scale);
317+
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO];
318+
capturedScreen = UIGraphicsGetImageFromCurrentImageContext();
319+
UIGraphicsEndImageContext();
331320

332321
return capturedScreen;
333322
}

0 commit comments

Comments
 (0)