From c21db989f5b6e31c67cd87e1cc0ac6f642d7bea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alperen=20=C3=9Cnal?= Date: Sun, 17 Feb 2019 23:46:10 +0300 Subject: [PATCH] Swift 4.0 M_PI' is deprecateds problem solved --- .DS_Store | Bin 0 -> 6148 bytes SweetAlert/.DS_Store | Bin 0 -> 6148 bytes SweetAlert/SweetAlert.swift | 70 ++++++++++++++++++------------------ 3 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 .DS_Store create mode 100644 SweetAlert/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b4ac6fcab09181a3c7d25c5b03e9c809ad30bc90 GIT binary patch literal 6148 zcmeHK!A=`75FL{goNcS-fJBbI^wg+IN>s$5(h|a<7lgD`duS`zWmja;X1z)_T_6PQ zCvc^I!;vrG&X2TXdy0yZN>r7qs(7TCH|z1(nJ3xK008Tb!!|%20640`s)J^ZsJPM@ zS)h?cM5fosVFMC~U&u%m&HXry zhB`S8Bb@T-L!5@P=*n>#j`TX732`~hFlnOp1^Zyo4jz2MHk(mEjd9 z;V?O9d;4;bnGLq_LcM?PK=yh>Fh9I`vH9)E<;L&jhkulx^?&~D=cWW}9}oj{O!(sm zRI@GBGGH0F9|P)s5U2`W!qT9=I?(7A0I`b0TF_U$gvt?wE@5d9BPh(IBAQf2Ee12` zI4)?OOIR8->Acf~Sq3Zv z{}ltQ+Vgr{EQ#LMnc~!2D^T}Pm8f~8L7jqzo@4E(r?`Qt1!F=vh%RAi5Jyn#9|28+ KHI{+D%D{I39EjQg literal 0 HcmV?d00001 diff --git a/SweetAlert/.DS_Store b/SweetAlert/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Void in + UIView.animate(withDuration: 0.5, delay: 0.0, options: UIView.AnimationOptions.curveEaseOut, animations: { () -> Void in self.view.alpha = 0.0 }) { (Bool) -> Void in self.view.removeFromSuperview() @@ -242,7 +242,7 @@ open class SweetAlert: UIViewController { userAction = action let window: UIWindow = UIApplication.shared.keyWindow! window.addSubview(view) - window.bringSubview(toFront: view) + window.bringSubviewToFront(view) view.frame = window.bounds self.setupContentView() self.setupTitleLabel() @@ -272,8 +272,8 @@ open class SweetAlert: UIViewController { } buttons = [] if buttonTitle.isEmpty == false { - let button: UIButton = UIButton(type: UIButtonType.custom) - button.setTitle(buttonTitle, for: UIControlState()) + let button: UIButton = UIButton(type: UIButton.ButtonType.custom) + button.setTitle(buttonTitle, for: UIControl.State()) button.backgroundColor = buttonColor button.isUserInteractionEnabled = true button.tag = 0 @@ -281,10 +281,10 @@ open class SweetAlert: UIViewController { } if otherButtonTitle != nil && otherButtonTitle!.isEmpty == false { - let button: UIButton = UIButton(type: UIButtonType.custom) - button.setTitle(otherButtonTitle, for: UIControlState()) + let button: UIButton = UIButton(type: UIButton.ButtonType.custom) + button.setTitle(otherButtonTitle, for: UIControl.State()) button.backgroundColor = otherButtonColor - button.addTarget(self, action: #selector(SweetAlert.pressed(_:)), for: UIControlEvents.touchUpInside) + button.addTarget(self, action: #selector(SweetAlert.pressed(_:)), for: UIControl.Event.touchUpInside) button.tag = 1 buttons.append(button) } @@ -355,7 +355,7 @@ class CancelAnimatedView: AnimatableView { setupLayers() var t = CATransform3DIdentity; t.m34 = 1.0 / -500.0; - t = CATransform3DRotate(t, CGFloat(90.0 * M_PI / 180.0), 1, 0, 0); + t = CATransform3DRotate(t, CGFloat(90.0 * Double.pi / 180.0), 1, 0, 0); circleLayer.transform = t crossPathLayer.opacity = 0.0 } @@ -370,8 +370,8 @@ class CancelAnimatedView: AnimatableView { fileprivate var outlineCircle: CGPath { let path = UIBezierPath() - let startAngle: CGFloat = CGFloat((0) / 180.0 * M_PI) //0 - let endAngle: CGFloat = CGFloat((360) / 180.0 * M_PI) //360 + let startAngle: CGFloat = CGFloat((0) / 180.0 * Double.pi) //0 + let endAngle: CGFloat = CGFloat((360) / 180.0 * Double.pi) //360 path.addArc(withCenter: CGPoint(x: self.frame.size.width/2.0, y: self.frame.size.width/2.0), radius: self.frame.size.width/2.0, startAngle: startAngle, endAngle: endAngle, clockwise: false) return path.cgPath @@ -392,7 +392,7 @@ class CancelAnimatedView: AnimatableView { circleLayer.path = outlineCircle circleLayer.fillColor = UIColor.clear.cgColor; circleLayer.strokeColor = UIColor.colorFromRGB(0xF27474).cgColor; - circleLayer.lineCap = kCALineCapRound + circleLayer.lineCap = CAShapeLayerLineCap.round circleLayer.lineWidth = 4; circleLayer.frame = CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height) circleLayer.position = CGPoint(x: self.frame.size.width/2.0, y: self.frame.size.height/2.0) @@ -401,7 +401,7 @@ class CancelAnimatedView: AnimatableView { crossPathLayer.path = crossPath crossPathLayer.fillColor = UIColor.clear.cgColor; crossPathLayer.strokeColor = UIColor.colorFromRGB(0xF27474).cgColor; - crossPathLayer.lineCap = kCALineCapRound + crossPathLayer.lineCap = CAShapeLayerLineCap.round crossPathLayer.lineWidth = 4; crossPathLayer.frame = CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height) crossPathLayer.position = CGPoint(x: self.frame.size.width/2.0, y: self.frame.size.height/2.0) @@ -412,11 +412,11 @@ class CancelAnimatedView: AnimatableView { override func animate() { var t = CATransform3DIdentity; t.m34 = 1.0 / -500.0; - t = CATransform3DRotate(t, CGFloat(90.0 * M_PI / 180.0), 1, 0, 0); + t = CATransform3DRotate(t, CGFloat(90.0 * Double.pi / 180.0), 1, 0, 0); var t2 = CATransform3DIdentity; t2.m34 = 1.0 / -500.0; - t2 = CATransform3DRotate(t2, CGFloat(-M_PI), 1, 0, 0); + t2 = CATransform3DRotate(t2, CGFloat(-Double.pi), 1, 0, 0); let animation = CABasicAnimation(keyPath: "transform") let time = 0.3 @@ -424,7 +424,7 @@ class CancelAnimatedView: AnimatableView { animation.fromValue = NSValue(caTransform3D: t) animation.toValue = NSValue(caTransform3D:t2) animation.isRemovedOnCompletion = false - animation.fillMode = kCAFillModeForwards + animation.fillMode = CAMediaTimingFillMode.forwards self.circleLayer.add(animation, forKey: "transform") @@ -446,7 +446,7 @@ class CancelAnimatedView: AnimatableView { fadeInAnimation.fromValue = 0.3 fadeInAnimation.toValue = 1.0 fadeInAnimation.isRemovedOnCompletion = false - fadeInAnimation.fillMode = kCAFillModeForwards + fadeInAnimation.fillMode = CAMediaTimingFillMode.forwards self.crossPathLayer.add(fadeInAnimation, forKey: "opacity") } @@ -472,8 +472,8 @@ class InfoAnimatedView: AnimatableView { var outlineCircle: CGPath { let path = UIBezierPath() - let startAngle: CGFloat = CGFloat((0) / 180.0 * M_PI) //0 - let endAngle: CGFloat = CGFloat((360) / 180.0 * M_PI) //360 + let startAngle: CGFloat = CGFloat((0) / 180.0 * Double.pi) //0 + let endAngle: CGFloat = CGFloat((360) / 180.0 * Double.pi) //360 path.addArc(withCenter: CGPoint(x: self.frame.size.width/2.0, y: self.frame.size.width/2.0), radius: self.frame.size.width/2.0, startAngle: startAngle, endAngle: endAngle, clockwise: false) let factor:CGFloat = self.frame.size.width / 1.5 @@ -489,7 +489,7 @@ class InfoAnimatedView: AnimatableView { circleLayer.path = outlineCircle circleLayer.fillColor = UIColor.clear.cgColor; circleLayer.strokeColor = UIColor.colorFromRGB(0xF8D486).cgColor; - circleLayer.lineCap = kCALineCapRound + circleLayer.lineCap = CAShapeLayerLineCap.round circleLayer.lineWidth = 4; circleLayer.frame = CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height) circleLayer.position = CGPoint(x: self.frame.size.width/2.0, y: self.frame.size.height/2.0) @@ -501,7 +501,7 @@ class InfoAnimatedView: AnimatableView { let colorAnimation = CABasicAnimation(keyPath:"strokeColor") colorAnimation.duration = 1.0; colorAnimation.repeatCount = HUGE - colorAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) + colorAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) colorAnimation.autoreverses = true colorAnimation.fromValue = UIColor.colorFromRGB(0xF7D58B).cgColor colorAnimation.toValue = UIColor.colorFromRGB(0xF2A665).cgColor @@ -533,16 +533,16 @@ class SuccessAnimatedView: AnimatableView { var outlineCircle: CGPath { let path = UIBezierPath() - let startAngle: CGFloat = CGFloat((0) / 180.0 * M_PI) //0 - let endAngle: CGFloat = CGFloat((360) / 180.0 * M_PI) //360 + let startAngle: CGFloat = CGFloat((0) / 180.0 * Double.pi) //0 + let endAngle: CGFloat = CGFloat((360) / 180.0 * Double.pi) //360 path.addArc(withCenter: CGPoint(x: self.frame.size.width/2.0, y: self.frame.size.height/2.0), radius: self.frame.size.width/2.0, startAngle: startAngle, endAngle: endAngle, clockwise: false) return path.cgPath } var path: CGPath { let path = UIBezierPath() - let startAngle:CGFloat = CGFloat((60) / 180.0 * M_PI) //60 - let endAngle:CGFloat = CGFloat((200) / 180.0 * M_PI) //190 + let startAngle:CGFloat = CGFloat((60) / 180.0 * Double.pi) //60 + let endAngle:CGFloat = CGFloat((200) / 180.0 * Double.pi) //190 path.addArc(withCenter: CGPoint(x: self.frame.size.width/2.0, y: self.frame.size.height/2.0), radius: self.frame.size.width/2.0, startAngle: startAngle, endAngle: endAngle, clockwise: false) path.addLine(to: CGPoint(x: 36.0 - 10.0 ,y: 60.0 - 10.0)) path.addLine(to: CGPoint(x: 85.0 - 20.0, y: 30.0 - 20.0)) @@ -557,7 +557,7 @@ class SuccessAnimatedView: AnimatableView { outlineLayer.path = outlineCircle outlineLayer.fillColor = UIColor.clear.cgColor; outlineLayer.strokeColor = UIColor(red: 150.0/255.0, green: 216.0/255.0, blue: 115.0/255.0, alpha: 1.0).cgColor; - outlineLayer.lineCap = kCALineCapRound + outlineLayer.lineCap = CAShapeLayerLineCap.round outlineLayer.lineWidth = 4; outlineLayer.opacity = 0.1 self.layer.addSublayer(outlineLayer) @@ -567,7 +567,7 @@ class SuccessAnimatedView: AnimatableView { circleLayer.path = path circleLayer.fillColor = UIColor.clear.cgColor; circleLayer.strokeColor = UIColor(red: 150.0/255.0, green: 216.0/255.0, blue: 115.0/255.0, alpha: 1.0).cgColor; - circleLayer.lineCap = kCALineCapRound + circleLayer.lineCap = CAShapeLayerLineCap.round circleLayer.lineWidth = 4; circleLayer.actions = [ "strokeStart": NSNull(), @@ -591,7 +591,7 @@ class SuccessAnimatedView: AnimatableView { strokeStart.toValue = 0.68 strokeStart.duration = 7.0*factor strokeStart.beginTime = CACurrentMediaTime() + 3.0*factor - strokeStart.fillMode = kCAFillModeBackwards + strokeStart.fillMode = CAMediaTimingFillMode.backwards strokeStart.timingFunction = timing circleLayer.strokeStart = 0.68 circleLayer.strokeEnd = 0.93