diff --git a/Package.swift b/Package.swift index 63dfde7..9dc02bd 100644 --- a/Package.swift +++ b/Package.swift @@ -1,3 +1,5 @@ +// swift-tools-version:5.0 +// The swift-tools-version declares the minimum version of Swift required to build this package. // Package.swift // // Copyright (c) 2016 Jacuzzi Hot Tubs, LLC @@ -23,6 +25,11 @@ import PackageDescription let package = Package( - name: "JHTAlertController", - exclude: ["Tests"] + name: "JHTAlertController", + platforms: [.iOS(.v9)], + products: [ + .library(name: "JHTAlertController", targets: ["JHTAlertController"]) + ], + targets: [.target(name: "JHTAlertController", path: "Source")], + swiftLanguageVersions: [.v5] ) diff --git a/Source/JHTAlertController.swift b/Source/JHTAlertController.swift index c579310..1fd5df2 100644 --- a/Source/JHTAlertController.swift +++ b/Source/JHTAlertController.swift @@ -208,7 +208,7 @@ public class JHTAlertController: UIViewController, UIViewControllerTransitioning /// The color of the border outline for the text field. The default color is gray. var textFieldBorderColor = UIColor.gray /// The type of border around the text field. Default is none - var textFieldBorderStyle = UITextBorderStyle.none + var textFieldBorderStyle = UITextField.BorderStyle.none private var textFieldContainerView = UIStackView() /// An override for the textfield to have rounded corners public var textFieldHasRoundedCorners = true @@ -446,7 +446,7 @@ public class JHTAlertController: UIViewController, UIViewControllerTransitioning heightConstraint, widthConstraint]) - let circlePath = UIBezierPath(arcCenter: CGPoint(x: shapeView.frame.maxX,y: shapeView.frame.maxY), radius: CGFloat(iconBackgroundRadius), startAngle: CGFloat(0), endAngle:CGFloat(M_PI * 2), clockwise: true) + let circlePath = UIBezierPath(arcCenter: CGPoint(x: shapeView.frame.maxX,y: shapeView.frame.maxY), radius: CGFloat(iconBackgroundRadius), startAngle: CGFloat(0), endAngle:.pi * 2, clockwise: true) shapeLayer = CAShapeLayer() shapeLayer.path = circlePath.cgPath @@ -505,7 +505,7 @@ public class JHTAlertController: UIViewController, UIViewControllerTransitioning /// The handler method for the action. This is where the code is executed. /// /// - Parameter sender: the UIButton that was pressed - public func buttonTapped(sender: UIButton) { + @objc public func buttonTapped(sender: UIButton) { self.dismiss(animated: true, completion: nil) sender.isSelected = true let action = buttonActions[sender.tag - 1] @@ -554,7 +554,7 @@ public class JHTAlertController: UIViewController, UIViewControllerTransitioning /// /// - Parameter configurationHandler: the copletion of the textfield public func addTextFieldWithConfigurationHandler(configurationHandler: ((JHTTextField) -> Void)!) { - var textField = JHTTextField() + let textField = JHTTextField() textField.frame.size = CGSize(width: containerViewWidth, height: textFieldHeight) textField.borderStyle = textFieldBorderStyle textField.delegate = self diff --git a/Source/UIColor+Extension.swift b/Source/UIColor+Extension.swift index c57df83..8a7698d 100644 --- a/Source/UIColor+Extension.swift +++ b/Source/UIColor+Extension.swift @@ -16,14 +16,14 @@ public extension UIColor { /// A lighter representation of the color /// /// - Returns: the lighter color - public func lightColor() -> UIColor { + func lightColor() -> UIColor { return self.withAlphaComponent(0.5) } /// A darker representation of the color /// /// - Returns: the darker color - public func darker() -> UIColor { + func darker() -> UIColor { var r:CGFloat = 0, g:CGFloat = 0, b:CGFloat = 0, a:CGFloat = 0 @@ -59,7 +59,7 @@ public extension UIColor { /// /// - Parameter size: the size of the image /// - Returns: the image with the color specified - public func imageWithColor(size: CGSize = CGSize(width: 60, height: 60)) -> UIImage { + func imageWithColor(size: CGSize = CGSize(width: 60, height: 60)) -> UIImage { let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height) UIGraphicsBeginImageContext(rect.size) let context = UIGraphicsGetCurrentContext()