diff --git a/SCLAlertView-Objective-C.podspec b/SCLAlertView-Objective-C.podspec index c2aea9a..f10fc42 100644 --- a/SCLAlertView-Objective-C.podspec +++ b/SCLAlertView-Objective-C.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "SCLAlertView-Objective-C" - spec.version = "0.3.9" + spec.version = "0.4.0" spec.summary = "Beautiful animated Alert View. Written in Swift but ported to Objective-C" spec.homepage = "https://github.com/dogo/SCLAlertView" spec.screenshots = "https://raw.githubusercontent.com/dogo/SCLAlertView/master/ScreenShots/ScreenShot.png", "https://raw.githubusercontent.com/dogo/SCLAlertView/master/ScreenShots/ScreenShot2.png" diff --git a/SCLAlertView/SCLAlertView.m b/SCLAlertView/SCLAlertView.m index 6516994..272fd8d 100755 --- a/SCLAlertView/SCLAlertView.m +++ b/SCLAlertView/SCLAlertView.m @@ -237,16 +237,16 @@ - (void)viewWillLayoutSubviews for (UITextField *textField in _inputs) { textField.frame = CGRectMake(12.0f, y, kWindowWidth - 24.0f, 30.0f); - textField.layer.cornerRadius = 3; + textField.layer.cornerRadius = 3.0f; y += 40.0f; } // Buttons for (SCLButton *btn in _buttons) { - btn.frame = CGRectMake(12.0f, y, kWindowWidth - 24, 35.0f); - btn.layer.cornerRadius = 3; - y += 45.0; + btn.frame = CGRectMake(12.0f, y, kWindowWidth - 24.0f, 35.0f); + btn.layer.cornerRadius = 3.0f; + y += 45.0f; } } @@ -305,7 +305,7 @@ - (UITextField *)addTextField:(NSString *)title [self addObservers]; // Update view height - kWindowHeight += 40.0; + kWindowHeight += 40.0f; // Add text field UITextField *txt = [[UITextField alloc] init]; @@ -370,6 +370,8 @@ - (void)keyboardDidShow:(NSNotification *)notification -(void)keyboardDidHide:(NSNotification *)notification { + if(!_keyboardIsVisible) return; + [UIView animateWithDuration:0.2f animations:^{ CGRect f = self.view.frame; f.origin.y += KEYBOARD_HEIGHT + PREDICTION_BAR_HEIGHT; @@ -383,7 +385,7 @@ -(void)keyboardDidHide:(NSNotification *)notification - (SCLButton *)addButton:(NSString *)title { // Update view height - kWindowHeight += 45.0; + kWindowHeight += 45.0f; // Add button SCLButton *btn = [[SCLButton alloc] init]; @@ -473,7 +475,7 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag { UIViewController *rootViewController = vc; - self.view.alpha = 0; + self.view.alpha = 0.0f; [self setBackground]; @@ -528,7 +530,7 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag case Custom: viewColor = color; iconImage = image; - kCircleIconHeight = kCircleIconHeight * 2; + kCircleIconHeight = kCircleIconHeight * 2.0f; break; } @@ -573,7 +575,7 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag { NSAttributedString *str =[[NSAttributedString alloc] initWithString:subTitle attributes:attr]; CGRect r = [str boundingRectWithSize:sz options:NSStringDrawingUsesLineFragmentOrigin context:nil]; - CGFloat ht = ceil(r.size.height) + 10; + CGFloat ht = ceil(r.size.height) + 10.0f; if (ht < kTextHeight) { kWindowHeight -= (kTextHeight - ht); @@ -604,16 +606,18 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag [self addDoneButtonWithTitle:completeText]; } - // Alert view colour and images + // Alert view color and images self.circleView.backgroundColor = viewColor; - if (style == Waiting) { + if (style == Waiting) + { [self.activityIndicatorView startAnimating]; - } else { + } + else + { self.circleIconImageView.image = iconImage; } - for (UITextField *textField in _inputs) { textField.layer.borderColor = viewColor.CGColor; @@ -953,7 +957,7 @@ - (void)slideInFromTop //To Frame CGRect frame = self.backgroundView.frame; - frame.origin.y = 0; + frame.origin.y = 0.0f; self.view.frame = frame; self.view.alpha = 1.0f; @@ -976,7 +980,7 @@ - (void)slideInFromBottom //To Frame CGRect frame = self.backgroundView.frame; - frame.origin.y = 0; + frame.origin.y = 0.0f; self.view.frame = frame; self.view.alpha = 1.0f; @@ -999,7 +1003,7 @@ - (void)slideInFromLeft //To Frame CGRect frame = self.backgroundView.frame; - frame.origin.x = 0; + frame.origin.x = 0.0f; self.view.frame = frame; self.view.alpha = 1.0f; @@ -1022,7 +1026,7 @@ - (void)slideInFromRight //To Frame CGRect frame = self.backgroundView.frame; - frame.origin.x = 0; + frame.origin.x = 0.0f; self.view.frame = frame; self.view.alpha = 1.0f; diff --git a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/Contents.json b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/Contents.json index d9f9077..b4e7fd1 100644 --- a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,11 @@ { "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon_29x29-1.png", + "scale" : "1x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -24,6 +30,18 @@ "filename" : "icon_120x120.png", "scale" : "3x" }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "icon_57x57.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "icon_57x57@2x.png", + "scale" : "2x" + }, { "size" : "60x60", "idiom" : "iphone", @@ -60,6 +78,30 @@ "filename" : "icon_80x80-1.png", "scale" : "2x" }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "icon_50x50.png", + "scale" : "1x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "icon_50x50@2x.png", + "scale" : "2x" + }, + { + "size" : "72x72", + "idiom" : "ipad", + "filename" : "icon_72x72.png", + "scale" : "1x" + }, + { + "size" : "72x72", + "idiom" : "ipad", + "filename" : "icon_72x72@2x.png", + "scale" : "2x" + }, { "size" : "76x76", "idiom" : "ipad", diff --git a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_29x29-1.png b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_29x29-1.png new file mode 100644 index 0000000..d4fa060 Binary files /dev/null and b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_29x29-1.png differ diff --git a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_50x50.png b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_50x50.png new file mode 100644 index 0000000..946e940 Binary files /dev/null and b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_50x50.png differ diff --git a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_50x50@2x.png b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_50x50@2x.png new file mode 100644 index 0000000..a1a721c Binary files /dev/null and b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_50x50@2x.png differ diff --git a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_57x57.png b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_57x57.png new file mode 100644 index 0000000..cfe9eee Binary files /dev/null and b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_57x57.png differ diff --git a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_57x57@2x.png b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_57x57@2x.png new file mode 100644 index 0000000..35207dd Binary files /dev/null and b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_57x57@2x.png differ diff --git a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_72x72.png b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_72x72.png new file mode 100644 index 0000000..d478ce0 Binary files /dev/null and b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_72x72.png differ diff --git a/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_72x72@2x.png b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_72x72@2x.png new file mode 100644 index 0000000..5202c4f Binary files /dev/null and b/SCLAlertViewExample/Images.xcassets/AppIcon.appiconset/icon_72x72@2x.png differ