Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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]
)
8 changes: 4 additions & 4 deletions Source/JHTAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Source/UIColor+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down