├── .github └── FUNDING.yml ├── .gitignore ├── .swift-version ├── LICENSE ├── Library ├── PMAlertAction.swift ├── PMAlertController.swift └── PMAlertController.xib ├── PMAlertController.podspec ├── PMAlertController.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcshareddata │ └── xcschemes │ │ └── PMAlertController.xcscheme └── xcuserdata │ ├── MacBookPro.xcuserdatad │ └── xcschemes │ │ ├── PMAlertControllerSample.xcscheme │ │ └── xcschememanagement.plist │ └── pmusolino.xcuserdatad │ └── xcschemes │ ├── PMAlertControllerSample.xcscheme │ └── xcschememanagement.plist ├── PMAlertController ├── Info.plist └── PMAlertController.h ├── PMAlertControllerSample ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── background.imageset │ │ ├── Contents.json │ │ └── triangle-background-17.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── Resources │ └── flag.png └── ViewController.swift ├── README.md ├── logo_pmalertcontroller.png └── preview_pmalertacontroller.png /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: https://www.paypal.me/pmusolino 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.xcbkptlist 2 | PMAlertController.xcodeproj/project.xcworkspace/xcuserdata 3 | Carthage/ 4 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.2 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | ---------------- 3 | The MIT License (MIT) 4 | 5 | Copyright (c) 2016 Paolo Musolino 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. -------------------------------------------------------------------------------- /Library/PMAlertAction.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PMAlertAction.swift 3 | // PMAlertController 4 | // 5 | // Created by Paolo Musolino on 07/05/16. 6 | // Copyright © 2018 Codeido. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @objc public enum PMAlertActionStyle : Int { 12 | 13 | case `default` 14 | case cancel 15 | } 16 | 17 | @objc open class PMAlertAction: UIButton { 18 | 19 | fileprivate var action: (() -> Void)? 20 | 21 | open var actionStyle : PMAlertActionStyle 22 | 23 | open var separator = UIImageView() 24 | 25 | init(){ 26 | self.actionStyle = .cancel 27 | super.init(frame: CGRect.zero) 28 | } 29 | 30 | @objc public convenience init(title: String?, style: PMAlertActionStyle, action: (() -> Void)? = nil){ 31 | self.init() 32 | 33 | self.action = action 34 | self.addTarget(self, action: #selector(PMAlertAction.tapped(_:)), for: .touchUpInside) 35 | 36 | self.setTitle(title, for: UIControl.State()) 37 | self.titleLabel?.font = UIFont(name: "Avenir-Heavy", size: 17) 38 | 39 | self.actionStyle = style 40 | style == .default ? (self.setTitleColor(UIColor(red: 191.0/255.0, green: 51.0/255.0, blue: 98.0/255.0, alpha: 1.0), for: UIControl.State())) : (self.setTitleColor(UIColor.gray, for: UIControl.State())) 41 | 42 | self.addSeparator() 43 | } 44 | 45 | required public init?(coder aDecoder: NSCoder) { 46 | fatalError("init(coder:) has not been implemented") 47 | } 48 | 49 | @objc func tapped(_ sender: PMAlertAction) { 50 | //Action need to be fired after alert dismiss 51 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in 52 | self?.action?() 53 | } 54 | } 55 | 56 | @objc fileprivate func addSeparator(){ 57 | separator.backgroundColor = UIColor.lightGray.withAlphaComponent(0.2) 58 | self.addSubview(separator) 59 | 60 | // Autolayout separator 61 | separator.translatesAutoresizingMaskIntoConstraints = false 62 | separator.topAnchor.constraint(equalTo: self.topAnchor).isActive = true 63 | separator.leadingAnchor.constraint(equalTo: self.layoutMarginsGuide.leadingAnchor, constant: 8).isActive = true 64 | separator.trailingAnchor.constraint(equalTo: self.layoutMarginsGuide.trailingAnchor, constant: -8).isActive = true 65 | separator.heightAnchor.constraint(equalToConstant: 1).isActive = true 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /Library/PMAlertController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PMAlertController.swift 3 | // PMAlertController 4 | // 5 | // Created by Paolo Musolino on 07/05/16. 6 | // Copyright © 2018 Codeido. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @objc public enum PMAlertControllerStyle : Int { 12 | case alert // The alert will adopt a width of 270 (like UIAlertController). 13 | case walkthrough //The alert will adopt a width of the screen size minus 18 (from the left and right side). This style is designed to accommodate localization, push notifications and more. 14 | } 15 | 16 | @objc open class PMAlertController: UIViewController { 17 | 18 | // MARK: Properties 19 | @IBOutlet weak open var alertMaskBackground: UIImageView! 20 | @IBOutlet weak open var alertView: UIView! 21 | @IBOutlet weak open var alertViewWidthConstraint: NSLayoutConstraint! 22 | @IBOutlet weak open var headerView: UIView! 23 | @IBOutlet weak open var headerViewHeightConstraint: NSLayoutConstraint! 24 | @IBOutlet weak open var headerViewTopSpaceConstraint: NSLayoutConstraint! 25 | @IBOutlet weak open var alertImage: UIImageView! 26 | @IBOutlet weak open var alertContentStackView: UIStackView! 27 | @IBOutlet weak open var alertTitle: UILabel! 28 | @IBOutlet weak open var alertDescription: UILabel! 29 | @IBOutlet weak open var alertContentStackViewLeadingConstraint: NSLayoutConstraint! 30 | @IBOutlet weak open var alertContentStackViewTrailingConstraint: NSLayoutConstraint! 31 | @IBOutlet weak open var alertContentStackViewTopConstraint: NSLayoutConstraint! 32 | @IBOutlet weak open var alertActionStackView: UIStackView! 33 | @IBOutlet weak open var alertActionStackViewHeightConstraint: NSLayoutConstraint! 34 | @IBOutlet weak open var alertActionStackViewLeadingConstraint: NSLayoutConstraint! 35 | @IBOutlet weak open var alertActionStackViewTrailingConstraint: NSLayoutConstraint! 36 | @IBOutlet weak open var alertActionStackViewTopConstraint: NSLayoutConstraint! 37 | @IBOutlet weak open var alertActionStackViewBottomConstraint: NSLayoutConstraint! 38 | 39 | open var ALERT_STACK_VIEW_HEIGHT : CGFloat = UIScreen.main.bounds.height < 568.0 ? 40 : 62 //if iphone 4 the stack_view_height is 40, else 62 40 | var animator : UIDynamicAnimator? 41 | 42 | @objc open var textFields: [UITextField] = [] 43 | 44 | @objc open var gravityDismissAnimation = true 45 | @objc open var dismissWithBackgroudTouch = false // enable touch background to dismiss. Off by default. 46 | 47 | //MARK: - Lifecycle 48 | 49 | override open func viewDidAppear(_ animated: Bool) { 50 | super.viewDidAppear(animated) 51 | NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) 52 | NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) 53 | } 54 | 55 | open override func viewDidDisappear(_ animated: Bool) { 56 | super.viewDidDisappear(animated) 57 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil) 58 | NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil) 59 | } 60 | 61 | 62 | //MARK: - Initialiser 63 | @objc public convenience init(title: String?, description: String?, image: UIImage?, style: PMAlertControllerStyle) { 64 | self.init() 65 | guard let nib = loadNibAlertController(), let unwrappedView = nib[0] as? UIView else { return } 66 | self.view = unwrappedView 67 | 68 | self.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext 69 | self.modalTransitionStyle = UIModalTransitionStyle.crossDissolve 70 | 71 | alertView.layer.cornerRadius = 5 72 | (image != nil) ? (alertImage.image = image) : (headerViewHeightConstraint.constant = 0) 73 | 74 | if let title = title { 75 | alertTitle.text = title 76 | }else{ 77 | alertTitle.isHidden = true 78 | } 79 | 80 | if let description = description { 81 | alertDescription.text = description 82 | }else{ 83 | alertDescription.isHidden = true 84 | } 85 | 86 | //if alert width = 270, else width = screen width - 36 87 | alertViewWidthConstraint.constant = (style == .alert) ? 270 : UIScreen.main.bounds.width - 36 88 | 89 | //Gesture recognizer for background dismiss with background touch 90 | let tapRecognizer: UITapGestureRecognizer = UITapGestureRecognizer.init(target: self, action: #selector(dismissAlertControllerFromBackgroundTap)) 91 | alertMaskBackground.addGestureRecognizer(tapRecognizer) 92 | 93 | setShadowAlertView() 94 | } 95 | 96 | //MARK: - Actions 97 | @objc open func addAction(_ alertAction: PMAlertAction){ 98 | alertActionStackView.addArrangedSubview(alertAction) 99 | 100 | if alertActionStackView.arrangedSubviews.count > 2 || hasTextFieldAdded(){ 101 | alertActionStackViewHeightConstraint.constant = ALERT_STACK_VIEW_HEIGHT * CGFloat(alertActionStackView.arrangedSubviews.count) 102 | alertActionStackView.axis = .vertical 103 | } 104 | else{ 105 | alertActionStackViewHeightConstraint.constant = ALERT_STACK_VIEW_HEIGHT 106 | alertActionStackView.axis = .horizontal 107 | } 108 | 109 | alertAction.addTarget(self, action: #selector(PMAlertController.dismissAlertController(_:)), for: .touchUpInside) 110 | } 111 | 112 | @objc fileprivate func dismissAlertController(_ sender: PMAlertAction){ 113 | self.animateDismissWithGravity(sender.actionStyle) 114 | self.dismiss(animated: true, completion: nil) 115 | } 116 | 117 | @objc fileprivate func dismissAlertControllerFromBackgroundTap() { 118 | if !dismissWithBackgroudTouch { 119 | return 120 | } 121 | 122 | self.animateDismissWithGravity(.cancel) 123 | self.dismiss(animated: true, completion: nil) 124 | } 125 | 126 | //MARK: - Text Fields 127 | @objc open func addTextField(textField:UITextField? = nil, _ configuration: (_ textField: UITextField?) -> Void){ 128 | let textField = textField ?? UITextField() 129 | textField.delegate = self 130 | textField.returnKeyType = .done 131 | textField.font = UIFont(name: "Avenir-Heavy", size: 17) 132 | textField.textAlignment = .center 133 | configuration (textField) 134 | _addTextField(textField) 135 | } 136 | func _addTextField(_ textField: UITextField){ 137 | alertActionStackView.addArrangedSubview(textField) 138 | alertActionStackViewHeightConstraint.constant = ALERT_STACK_VIEW_HEIGHT * CGFloat(alertActionStackView.arrangedSubviews.count) 139 | alertActionStackView.axis = .vertical 140 | textFields.append(textField) 141 | } 142 | 143 | func hasTextFieldAdded () -> Bool{ 144 | return textFields.count > 0 145 | } 146 | 147 | //MARK: - Customizations 148 | @objc fileprivate func setShadowAlertView(){ 149 | alertView.layer.masksToBounds = false 150 | alertView.layer.shadowOffset = CGSize(width: 0, height: 0) 151 | alertView.layer.shadowRadius = 8 152 | alertView.layer.shadowOpacity = 0.3 153 | } 154 | 155 | @objc fileprivate func loadNibAlertController() -> [AnyObject]?{ 156 | let podBundle = Bundle(for: self.classForCoder) 157 | 158 | if let bundleURL = podBundle.url(forResource: "PMAlertController", withExtension: "bundle"){ 159 | 160 | if let bundle = Bundle(url: bundleURL) { 161 | return bundle.loadNibNamed("PMAlertController", owner: self, options: nil) as [AnyObject]? 162 | } 163 | else { 164 | assertionFailure("Could not load the bundle") 165 | } 166 | 167 | } 168 | else if let nib = podBundle.loadNibNamed("PMAlertController", owner: self, options: nil) as [AnyObject]?{ 169 | return nib 170 | } 171 | else{ 172 | assertionFailure("Could not create a path to the bundle") 173 | } 174 | return nil 175 | } 176 | 177 | //MARK: - Animations 178 | 179 | @objc fileprivate func animateDismissWithGravity(_ style: PMAlertActionStyle){ 180 | if gravityDismissAnimation == true{ 181 | var radian = Double.pi 182 | if style == .default { 183 | radian = 2 * Double.pi 184 | }else{ 185 | radian = -2 * Double.pi 186 | } 187 | animator = UIDynamicAnimator(referenceView: self.view) 188 | 189 | let gravityBehavior = UIGravityBehavior(items: [alertView]) 190 | gravityBehavior.gravityDirection = CGVector(dx: 0, dy: 10) 191 | 192 | animator?.addBehavior(gravityBehavior) 193 | 194 | let itemBehavior = UIDynamicItemBehavior(items: [alertView]) 195 | itemBehavior.addAngularVelocity(CGFloat(radian), for: alertView) 196 | animator?.addBehavior(itemBehavior) 197 | } 198 | } 199 | 200 | //MARK: - Keyboard avoiding 201 | 202 | var tempFrameOrigin: CGPoint? 203 | var keyboardHasBeenShown:Bool = false 204 | 205 | @objc func keyboardWillShow(_ notification: Notification) { 206 | keyboardHasBeenShown = true 207 | 208 | guard let userInfo = (notification as NSNotification).userInfo else {return} 209 | guard let endKeyBoardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.minY else {return} 210 | 211 | if tempFrameOrigin == nil { 212 | tempFrameOrigin = alertView.frame.origin 213 | } 214 | 215 | var newContentViewFrameY = alertView.frame.maxY - endKeyBoardFrame 216 | if newContentViewFrameY < 0 { 217 | newContentViewFrameY = 0 218 | } 219 | alertView.frame.origin.y -= newContentViewFrameY 220 | } 221 | 222 | @objc func keyboardWillHide(_ notification: Notification) { 223 | if (keyboardHasBeenShown) { // Only on the simulator (keyboard will be hidden) 224 | if (tempFrameOrigin != nil){ 225 | alertView.frame.origin.y = tempFrameOrigin!.y 226 | tempFrameOrigin = nil 227 | } 228 | 229 | keyboardHasBeenShown = false 230 | } 231 | } 232 | } 233 | 234 | extension PMAlertController: UITextFieldDelegate { 235 | public func textFieldShouldReturn(_ textField: UITextField) -> Bool { 236 | textField.resignFirstResponder() 237 | 238 | return true 239 | } 240 | } 241 | -------------------------------------------------------------------------------- /Library/PMAlertController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 77 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /PMAlertController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "PMAlertController" 3 | s.version = "4.0.1" 4 | s.summary = "PMAlertController is a great and customizable substitute to UIAlertController" 5 | s.description = <<-DESC 6 | PMAlertController is a small library that allows you to substitute the uncustomizable UIAlertController of Apple, with a beautiful and totally customizable alert that you can use in your iOS app. Enjoy! 7 | DESC 8 | s.homepage = "https://github.com/pmusolino/PMAlertController" 9 | s.screenshots = "https://raw.githubusercontent.com/pmusolino/PMAlertController/master/preview_pmalertacontroller.png" 10 | s.license = { :type => "MIT", :file => "LICENSE" } 11 | s.author = { "Paolo Musolino" => "info@codeido.com" } 12 | s.social_media_url = "http://twitter.com/pmusolino" 13 | s.platform = :ios, "9.0" 14 | s.source = { :git => "https://github.com/pmusolino/PMAlertController.git", :tag => s.version } 15 | s.source_files = "Library/**/*" 16 | s.resource_bundles = { 17 | 'PMAlertController' => ['Library/Resources/*.png', 'Library/**/*.xib'] 18 | } 19 | s.framework = "UIKit" 20 | s.requires_arc = true 21 | end 22 | -------------------------------------------------------------------------------- /PMAlertController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 453B4EDA1CDE3F0A00BFB901 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 453B4ED91CDE3F0A00BFB901 /* AppDelegate.swift */; }; 11 | 453B4EDC1CDE3F0A00BFB901 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 453B4EDB1CDE3F0A00BFB901 /* ViewController.swift */; }; 12 | 453B4EDF1CDE3F0A00BFB901 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 453B4EDD1CDE3F0A00BFB901 /* Main.storyboard */; }; 13 | 453B4EE41CDE3F0A00BFB901 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 453B4EE21CDE3F0A00BFB901 /* LaunchScreen.storyboard */; }; 14 | 526FBB1A1CF0FB99005E5970 /* flag.png in Resources */ = {isa = PBXBuildFile; fileRef = 526FBB191CF0FB99005E5970 /* flag.png */; }; 15 | 526FBB1C1CF0FBA2005E5970 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 526FBB1B1CF0FBA2005E5970 /* Assets.xcassets */; }; 16 | 526FBB251CF0FD63005E5970 /* PMAlertController.h in Headers */ = {isa = PBXBuildFile; fileRef = 526FBB241CF0FD63005E5970 /* PMAlertController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17 | 526FBB291CF0FD63005E5970 /* PMAlertController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 526FBB221CF0FD63005E5970 /* PMAlertController.framework */; }; 18 | 526FBB2A1CF0FD63005E5970 /* PMAlertController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 526FBB221CF0FD63005E5970 /* PMAlertController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 19 | 526FBB2E1CF0FD7D005E5970 /* PMAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 453B4F0C1CDE411100BFB901 /* PMAlertController.swift */; }; 20 | 526FBB2F1CF0FD7D005E5970 /* PMAlertController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 453B4F0D1CDE411100BFB901 /* PMAlertController.xib */; }; 21 | 526FBB301CF0FD7D005E5970 /* PMAlertAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 453B4F161CDF456F00BFB901 /* PMAlertAction.swift */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 453B4EEB1CDE3F0A00BFB901 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 453B4ECE1CDE3F0A00BFB901 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 453B4ED51CDE3F0A00BFB901; 30 | remoteInfo = PMAlertController; 31 | }; 32 | 453B4EF61CDE3F0A00BFB901 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 453B4ECE1CDE3F0A00BFB901 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 453B4ED51CDE3F0A00BFB901; 37 | remoteInfo = PMAlertController; 38 | }; 39 | 526FBB271CF0FD63005E5970 /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = 453B4ECE1CDE3F0A00BFB901 /* Project object */; 42 | proxyType = 1; 43 | remoteGlobalIDString = 526FBB211CF0FD63005E5970; 44 | remoteInfo = PMAlertController; 45 | }; 46 | /* End PBXContainerItemProxy section */ 47 | 48 | /* Begin PBXCopyFilesBuildPhase section */ 49 | 52A3DD6C1CF0F891000C72E9 /* Embed Frameworks */ = { 50 | isa = PBXCopyFilesBuildPhase; 51 | buildActionMask = 2147483647; 52 | dstPath = ""; 53 | dstSubfolderSpec = 10; 54 | files = ( 55 | 526FBB2A1CF0FD63005E5970 /* PMAlertController.framework in Embed Frameworks */, 56 | ); 57 | name = "Embed Frameworks"; 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXCopyFilesBuildPhase section */ 61 | 62 | /* Begin PBXFileReference section */ 63 | 453B4ED61CDE3F0A00BFB901 /* PMAlertControllerSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PMAlertControllerSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 453B4ED91CDE3F0A00BFB901 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 65 | 453B4EDB1CDE3F0A00BFB901 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 66 | 453B4EDE1CDE3F0A00BFB901 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 67 | 453B4EE31CDE3F0A00BFB901 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 68 | 453B4EE51CDE3F0A00BFB901 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 69 | 453B4EEA1CDE3F0A00BFB901 /* PMAlertControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMAlertControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 70 | 453B4EF51CDE3F0A00BFB901 /* PMAlertControllerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMAlertControllerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | 453B4F0C1CDE411100BFB901 /* PMAlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PMAlertController.swift; sourceTree = ""; }; 72 | 453B4F0D1CDE411100BFB901 /* PMAlertController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PMAlertController.xib; sourceTree = ""; }; 73 | 453B4F161CDF456F00BFB901 /* PMAlertAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PMAlertAction.swift; sourceTree = ""; }; 74 | 526FBB191CF0FB99005E5970 /* flag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = flag.png; sourceTree = ""; }; 75 | 526FBB1B1CF0FBA2005E5970 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = PMAlertControllerSample/Assets.xcassets; sourceTree = SOURCE_ROOT; }; 76 | 526FBB221CF0FD63005E5970 /* PMAlertController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMAlertController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 77 | 526FBB241CF0FD63005E5970 /* PMAlertController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PMAlertController.h; sourceTree = ""; }; 78 | 526FBB261CF0FD63005E5970 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79 | /* End PBXFileReference section */ 80 | 81 | /* Begin PBXFrameworksBuildPhase section */ 82 | 453B4ED31CDE3F0A00BFB901 /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | 526FBB291CF0FD63005E5970 /* PMAlertController.framework in Frameworks */, 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | 453B4EE71CDE3F0A00BFB901 /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | 453B4EF21CDE3F0A00BFB901 /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | ); 102 | runOnlyForDeploymentPostprocessing = 0; 103 | }; 104 | 526FBB1E1CF0FD63005E5970 /* Frameworks */ = { 105 | isa = PBXFrameworksBuildPhase; 106 | buildActionMask = 2147483647; 107 | files = ( 108 | ); 109 | runOnlyForDeploymentPostprocessing = 0; 110 | }; 111 | /* End PBXFrameworksBuildPhase section */ 112 | 113 | /* Begin PBXGroup section */ 114 | 453B4ECD1CDE3F0A00BFB901 = { 115 | isa = PBXGroup; 116 | children = ( 117 | 453B4F091CDE3F9A00BFB901 /* Library */, 118 | 453B4ED81CDE3F0A00BFB901 /* PMAlertControllerSample */, 119 | 526FBB231CF0FD63005E5970 /* PMAlertController */, 120 | 453B4ED71CDE3F0A00BFB901 /* Products */, 121 | ); 122 | sourceTree = ""; 123 | }; 124 | 453B4ED71CDE3F0A00BFB901 /* Products */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 453B4ED61CDE3F0A00BFB901 /* PMAlertControllerSample.app */, 128 | 453B4EEA1CDE3F0A00BFB901 /* PMAlertControllerTests.xctest */, 129 | 453B4EF51CDE3F0A00BFB901 /* PMAlertControllerUITests.xctest */, 130 | 526FBB221CF0FD63005E5970 /* PMAlertController.framework */, 131 | ); 132 | name = Products; 133 | sourceTree = ""; 134 | }; 135 | 453B4ED81CDE3F0A00BFB901 /* PMAlertControllerSample */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 526FBB181CF0FB99005E5970 /* Resources */, 139 | 453B4ED91CDE3F0A00BFB901 /* AppDelegate.swift */, 140 | 453B4EDB1CDE3F0A00BFB901 /* ViewController.swift */, 141 | 453B4EDD1CDE3F0A00BFB901 /* Main.storyboard */, 142 | 453B4EE21CDE3F0A00BFB901 /* LaunchScreen.storyboard */, 143 | 453B4EE51CDE3F0A00BFB901 /* Info.plist */, 144 | ); 145 | path = PMAlertControllerSample; 146 | sourceTree = ""; 147 | }; 148 | 453B4F091CDE3F9A00BFB901 /* Library */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 453B4F0C1CDE411100BFB901 /* PMAlertController.swift */, 152 | 453B4F0D1CDE411100BFB901 /* PMAlertController.xib */, 153 | 453B4F161CDF456F00BFB901 /* PMAlertAction.swift */, 154 | ); 155 | path = Library; 156 | sourceTree = ""; 157 | }; 158 | 526FBB181CF0FB99005E5970 /* Resources */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 526FBB1B1CF0FBA2005E5970 /* Assets.xcassets */, 162 | 526FBB191CF0FB99005E5970 /* flag.png */, 163 | ); 164 | path = Resources; 165 | sourceTree = ""; 166 | }; 167 | 526FBB231CF0FD63005E5970 /* PMAlertController */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | 526FBB241CF0FD63005E5970 /* PMAlertController.h */, 171 | 526FBB261CF0FD63005E5970 /* Info.plist */, 172 | ); 173 | path = PMAlertController; 174 | sourceTree = ""; 175 | }; 176 | /* End PBXGroup section */ 177 | 178 | /* Begin PBXHeadersBuildPhase section */ 179 | 526FBB1F1CF0FD63005E5970 /* Headers */ = { 180 | isa = PBXHeadersBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 526FBB251CF0FD63005E5970 /* PMAlertController.h in Headers */, 184 | ); 185 | runOnlyForDeploymentPostprocessing = 0; 186 | }; 187 | /* End PBXHeadersBuildPhase section */ 188 | 189 | /* Begin PBXNativeTarget section */ 190 | 453B4ED51CDE3F0A00BFB901 /* PMAlertControllerSample */ = { 191 | isa = PBXNativeTarget; 192 | buildConfigurationList = 453B4EFE1CDE3F0A00BFB901 /* Build configuration list for PBXNativeTarget "PMAlertControllerSample" */; 193 | buildPhases = ( 194 | 453B4ED21CDE3F0A00BFB901 /* Sources */, 195 | 453B4ED31CDE3F0A00BFB901 /* Frameworks */, 196 | 453B4ED41CDE3F0A00BFB901 /* Resources */, 197 | 52A3DD6C1CF0F891000C72E9 /* Embed Frameworks */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 526FBB281CF0FD63005E5970 /* PBXTargetDependency */, 203 | ); 204 | name = PMAlertControllerSample; 205 | productName = PMAlertController; 206 | productReference = 453B4ED61CDE3F0A00BFB901 /* PMAlertControllerSample.app */; 207 | productType = "com.apple.product-type.application"; 208 | }; 209 | 453B4EE91CDE3F0A00BFB901 /* PMAlertControllerTests */ = { 210 | isa = PBXNativeTarget; 211 | buildConfigurationList = 453B4F011CDE3F0A00BFB901 /* Build configuration list for PBXNativeTarget "PMAlertControllerTests" */; 212 | buildPhases = ( 213 | 453B4EE61CDE3F0A00BFB901 /* Sources */, 214 | 453B4EE71CDE3F0A00BFB901 /* Frameworks */, 215 | 453B4EE81CDE3F0A00BFB901 /* Resources */, 216 | ); 217 | buildRules = ( 218 | ); 219 | dependencies = ( 220 | 453B4EEC1CDE3F0A00BFB901 /* PBXTargetDependency */, 221 | ); 222 | name = PMAlertControllerTests; 223 | productName = PMAlertControllerTests; 224 | productReference = 453B4EEA1CDE3F0A00BFB901 /* PMAlertControllerTests.xctest */; 225 | productType = "com.apple.product-type.bundle.unit-test"; 226 | }; 227 | 453B4EF41CDE3F0A00BFB901 /* PMAlertControllerUITests */ = { 228 | isa = PBXNativeTarget; 229 | buildConfigurationList = 453B4F041CDE3F0A00BFB901 /* Build configuration list for PBXNativeTarget "PMAlertControllerUITests" */; 230 | buildPhases = ( 231 | 453B4EF11CDE3F0A00BFB901 /* Sources */, 232 | 453B4EF21CDE3F0A00BFB901 /* Frameworks */, 233 | 453B4EF31CDE3F0A00BFB901 /* Resources */, 234 | ); 235 | buildRules = ( 236 | ); 237 | dependencies = ( 238 | 453B4EF71CDE3F0A00BFB901 /* PBXTargetDependency */, 239 | ); 240 | name = PMAlertControllerUITests; 241 | productName = PMAlertControllerUITests; 242 | productReference = 453B4EF51CDE3F0A00BFB901 /* PMAlertControllerUITests.xctest */; 243 | productType = "com.apple.product-type.bundle.ui-testing"; 244 | }; 245 | 526FBB211CF0FD63005E5970 /* PMAlertController */ = { 246 | isa = PBXNativeTarget; 247 | buildConfigurationList = 526FBB2B1CF0FD63005E5970 /* Build configuration list for PBXNativeTarget "PMAlertController" */; 248 | buildPhases = ( 249 | 526FBB1D1CF0FD63005E5970 /* Sources */, 250 | 526FBB1E1CF0FD63005E5970 /* Frameworks */, 251 | 526FBB1F1CF0FD63005E5970 /* Headers */, 252 | 526FBB201CF0FD63005E5970 /* Resources */, 253 | ); 254 | buildRules = ( 255 | ); 256 | dependencies = ( 257 | ); 258 | name = PMAlertController; 259 | productName = PMAlertController; 260 | productReference = 526FBB221CF0FD63005E5970 /* PMAlertController.framework */; 261 | productType = "com.apple.product-type.framework"; 262 | }; 263 | /* End PBXNativeTarget section */ 264 | 265 | /* Begin PBXProject section */ 266 | 453B4ECE1CDE3F0A00BFB901 /* Project object */ = { 267 | isa = PBXProject; 268 | attributes = { 269 | LastSwiftUpdateCheck = 0730; 270 | LastUpgradeCheck = 1020; 271 | ORGANIZATIONNAME = Codeido; 272 | TargetAttributes = { 273 | 453B4ED51CDE3F0A00BFB901 = { 274 | CreatedOnToolsVersion = 7.3; 275 | LastSwiftMigration = 1020; 276 | ProvisioningStyle = Manual; 277 | }; 278 | 453B4EE91CDE3F0A00BFB901 = { 279 | CreatedOnToolsVersion = 7.3; 280 | TestTargetID = 453B4ED51CDE3F0A00BFB901; 281 | }; 282 | 453B4EF41CDE3F0A00BFB901 = { 283 | CreatedOnToolsVersion = 7.3; 284 | TestTargetID = 453B4ED51CDE3F0A00BFB901; 285 | }; 286 | 526FBB211CF0FD63005E5970 = { 287 | CreatedOnToolsVersion = 7.3.1; 288 | LastSwiftMigration = 1020; 289 | }; 290 | }; 291 | }; 292 | buildConfigurationList = 453B4ED11CDE3F0A00BFB901 /* Build configuration list for PBXProject "PMAlertController" */; 293 | compatibilityVersion = "Xcode 3.2"; 294 | developmentRegion = en; 295 | hasScannedForEncodings = 0; 296 | knownRegions = ( 297 | en, 298 | Base, 299 | ); 300 | mainGroup = 453B4ECD1CDE3F0A00BFB901; 301 | productRefGroup = 453B4ED71CDE3F0A00BFB901 /* Products */; 302 | projectDirPath = ""; 303 | projectRoot = ""; 304 | targets = ( 305 | 453B4ED51CDE3F0A00BFB901 /* PMAlertControllerSample */, 306 | 453B4EE91CDE3F0A00BFB901 /* PMAlertControllerTests */, 307 | 453B4EF41CDE3F0A00BFB901 /* PMAlertControllerUITests */, 308 | 526FBB211CF0FD63005E5970 /* PMAlertController */, 309 | ); 310 | }; 311 | /* End PBXProject section */ 312 | 313 | /* Begin PBXResourcesBuildPhase section */ 314 | 453B4ED41CDE3F0A00BFB901 /* Resources */ = { 315 | isa = PBXResourcesBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | 453B4EE41CDE3F0A00BFB901 /* LaunchScreen.storyboard in Resources */, 319 | 453B4EDF1CDE3F0A00BFB901 /* Main.storyboard in Resources */, 320 | 526FBB1C1CF0FBA2005E5970 /* Assets.xcassets in Resources */, 321 | 526FBB1A1CF0FB99005E5970 /* flag.png in Resources */, 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | }; 325 | 453B4EE81CDE3F0A00BFB901 /* Resources */ = { 326 | isa = PBXResourcesBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | }; 332 | 453B4EF31CDE3F0A00BFB901 /* Resources */ = { 333 | isa = PBXResourcesBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | }; 339 | 526FBB201CF0FD63005E5970 /* Resources */ = { 340 | isa = PBXResourcesBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | 526FBB2F1CF0FD7D005E5970 /* PMAlertController.xib in Resources */, 344 | ); 345 | runOnlyForDeploymentPostprocessing = 0; 346 | }; 347 | /* End PBXResourcesBuildPhase section */ 348 | 349 | /* Begin PBXSourcesBuildPhase section */ 350 | 453B4ED21CDE3F0A00BFB901 /* Sources */ = { 351 | isa = PBXSourcesBuildPhase; 352 | buildActionMask = 2147483647; 353 | files = ( 354 | 453B4EDC1CDE3F0A00BFB901 /* ViewController.swift in Sources */, 355 | 453B4EDA1CDE3F0A00BFB901 /* AppDelegate.swift in Sources */, 356 | ); 357 | runOnlyForDeploymentPostprocessing = 0; 358 | }; 359 | 453B4EE61CDE3F0A00BFB901 /* Sources */ = { 360 | isa = PBXSourcesBuildPhase; 361 | buildActionMask = 2147483647; 362 | files = ( 363 | ); 364 | runOnlyForDeploymentPostprocessing = 0; 365 | }; 366 | 453B4EF11CDE3F0A00BFB901 /* Sources */ = { 367 | isa = PBXSourcesBuildPhase; 368 | buildActionMask = 2147483647; 369 | files = ( 370 | ); 371 | runOnlyForDeploymentPostprocessing = 0; 372 | }; 373 | 526FBB1D1CF0FD63005E5970 /* Sources */ = { 374 | isa = PBXSourcesBuildPhase; 375 | buildActionMask = 2147483647; 376 | files = ( 377 | 526FBB2E1CF0FD7D005E5970 /* PMAlertController.swift in Sources */, 378 | 526FBB301CF0FD7D005E5970 /* PMAlertAction.swift in Sources */, 379 | ); 380 | runOnlyForDeploymentPostprocessing = 0; 381 | }; 382 | /* End PBXSourcesBuildPhase section */ 383 | 384 | /* Begin PBXTargetDependency section */ 385 | 453B4EEC1CDE3F0A00BFB901 /* PBXTargetDependency */ = { 386 | isa = PBXTargetDependency; 387 | target = 453B4ED51CDE3F0A00BFB901 /* PMAlertControllerSample */; 388 | targetProxy = 453B4EEB1CDE3F0A00BFB901 /* PBXContainerItemProxy */; 389 | }; 390 | 453B4EF71CDE3F0A00BFB901 /* PBXTargetDependency */ = { 391 | isa = PBXTargetDependency; 392 | target = 453B4ED51CDE3F0A00BFB901 /* PMAlertControllerSample */; 393 | targetProxy = 453B4EF61CDE3F0A00BFB901 /* PBXContainerItemProxy */; 394 | }; 395 | 526FBB281CF0FD63005E5970 /* PBXTargetDependency */ = { 396 | isa = PBXTargetDependency; 397 | target = 526FBB211CF0FD63005E5970 /* PMAlertController */; 398 | targetProxy = 526FBB271CF0FD63005E5970 /* PBXContainerItemProxy */; 399 | }; 400 | /* End PBXTargetDependency section */ 401 | 402 | /* Begin PBXVariantGroup section */ 403 | 453B4EDD1CDE3F0A00BFB901 /* Main.storyboard */ = { 404 | isa = PBXVariantGroup; 405 | children = ( 406 | 453B4EDE1CDE3F0A00BFB901 /* Base */, 407 | ); 408 | name = Main.storyboard; 409 | sourceTree = ""; 410 | }; 411 | 453B4EE21CDE3F0A00BFB901 /* LaunchScreen.storyboard */ = { 412 | isa = PBXVariantGroup; 413 | children = ( 414 | 453B4EE31CDE3F0A00BFB901 /* Base */, 415 | ); 416 | name = LaunchScreen.storyboard; 417 | sourceTree = ""; 418 | }; 419 | /* End PBXVariantGroup section */ 420 | 421 | /* Begin XCBuildConfiguration section */ 422 | 453B4EFC1CDE3F0A00BFB901 /* Debug */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | ALWAYS_SEARCH_USER_PATHS = NO; 426 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 427 | CLANG_ANALYZER_NONNULL = YES; 428 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 429 | CLANG_CXX_LIBRARY = "libc++"; 430 | CLANG_ENABLE_MODULES = YES; 431 | CLANG_ENABLE_OBJC_ARC = YES; 432 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 433 | CLANG_WARN_BOOL_CONVERSION = YES; 434 | CLANG_WARN_COMMA = YES; 435 | CLANG_WARN_CONSTANT_CONVERSION = YES; 436 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 437 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 438 | CLANG_WARN_EMPTY_BODY = YES; 439 | CLANG_WARN_ENUM_CONVERSION = YES; 440 | CLANG_WARN_INFINITE_RECURSION = YES; 441 | CLANG_WARN_INT_CONVERSION = YES; 442 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 443 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 444 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 445 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 446 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 447 | CLANG_WARN_STRICT_PROTOTYPES = YES; 448 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 449 | CLANG_WARN_UNREACHABLE_CODE = YES; 450 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 451 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 452 | COPY_PHASE_STRIP = NO; 453 | DEBUG_INFORMATION_FORMAT = dwarf; 454 | ENABLE_STRICT_OBJC_MSGSEND = YES; 455 | ENABLE_TESTABILITY = YES; 456 | GCC_C_LANGUAGE_STANDARD = gnu99; 457 | GCC_DYNAMIC_NO_PIC = NO; 458 | GCC_NO_COMMON_BLOCKS = YES; 459 | GCC_OPTIMIZATION_LEVEL = 0; 460 | GCC_PREPROCESSOR_DEFINITIONS = ( 461 | "DEBUG=1", 462 | "$(inherited)", 463 | ); 464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 466 | GCC_WARN_UNDECLARED_SELECTOR = YES; 467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 468 | GCC_WARN_UNUSED_FUNCTION = YES; 469 | GCC_WARN_UNUSED_VARIABLE = YES; 470 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 471 | MTL_ENABLE_DEBUG_INFO = YES; 472 | ONLY_ACTIVE_ARCH = YES; 473 | SDKROOT = iphoneos; 474 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 475 | TARGETED_DEVICE_FAMILY = "1,2"; 476 | }; 477 | name = Debug; 478 | }; 479 | 453B4EFD1CDE3F0A00BFB901 /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | ALWAYS_SEARCH_USER_PATHS = NO; 483 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 484 | CLANG_ANALYZER_NONNULL = YES; 485 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 486 | CLANG_CXX_LIBRARY = "libc++"; 487 | CLANG_ENABLE_MODULES = YES; 488 | CLANG_ENABLE_OBJC_ARC = YES; 489 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 490 | CLANG_WARN_BOOL_CONVERSION = YES; 491 | CLANG_WARN_COMMA = YES; 492 | CLANG_WARN_CONSTANT_CONVERSION = YES; 493 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 494 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 495 | CLANG_WARN_EMPTY_BODY = YES; 496 | CLANG_WARN_ENUM_CONVERSION = YES; 497 | CLANG_WARN_INFINITE_RECURSION = YES; 498 | CLANG_WARN_INT_CONVERSION = YES; 499 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 500 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 501 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 502 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 503 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 504 | CLANG_WARN_STRICT_PROTOTYPES = YES; 505 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 506 | CLANG_WARN_UNREACHABLE_CODE = YES; 507 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 508 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 509 | COPY_PHASE_STRIP = NO; 510 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 511 | ENABLE_NS_ASSERTIONS = NO; 512 | ENABLE_STRICT_OBJC_MSGSEND = YES; 513 | GCC_C_LANGUAGE_STANDARD = gnu99; 514 | GCC_NO_COMMON_BLOCKS = YES; 515 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 516 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 517 | GCC_WARN_UNDECLARED_SELECTOR = YES; 518 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 519 | GCC_WARN_UNUSED_FUNCTION = YES; 520 | GCC_WARN_UNUSED_VARIABLE = YES; 521 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 522 | MTL_ENABLE_DEBUG_INFO = NO; 523 | SDKROOT = iphoneos; 524 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 525 | TARGETED_DEVICE_FAMILY = "1,2"; 526 | VALIDATE_PRODUCT = YES; 527 | }; 528 | name = Release; 529 | }; 530 | 453B4EFF1CDE3F0A00BFB901 /* Debug */ = { 531 | isa = XCBuildConfiguration; 532 | buildSettings = { 533 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 534 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 535 | CODE_SIGN_STYLE = Manual; 536 | DEVELOPMENT_TEAM = ""; 537 | INFOPLIST_FILE = PMAlertController/Info.plist; 538 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 539 | MARKETING_VERSION = 4.0.1; 540 | PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertControllerSample; 541 | PRODUCT_NAME = "$(TARGET_NAME)"; 542 | PROVISIONING_PROFILE_SPECIFIER = ""; 543 | SWIFT_VERSION = 5.0; 544 | }; 545 | name = Debug; 546 | }; 547 | 453B4F001CDE3F0A00BFB901 /* Release */ = { 548 | isa = XCBuildConfiguration; 549 | buildSettings = { 550 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 551 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 552 | CODE_SIGN_STYLE = Manual; 553 | DEVELOPMENT_TEAM = ""; 554 | INFOPLIST_FILE = PMAlertController/Info.plist; 555 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 556 | MARKETING_VERSION = 4.0.1; 557 | PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertControllerSample; 558 | PRODUCT_NAME = "$(TARGET_NAME)"; 559 | PROVISIONING_PROFILE_SPECIFIER = ""; 560 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 561 | SWIFT_VERSION = 5.0; 562 | }; 563 | name = Release; 564 | }; 565 | 453B4F021CDE3F0A00BFB901 /* Debug */ = { 566 | isa = XCBuildConfiguration; 567 | buildSettings = { 568 | BUNDLE_LOADER = "$(TEST_HOST)"; 569 | INFOPLIST_FILE = PMAlertControllerTests/Info.plist; 570 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 571 | PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertControllerTests; 572 | PRODUCT_NAME = "$(TARGET_NAME)"; 573 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PMAlertController.app/PMAlertController"; 574 | }; 575 | name = Debug; 576 | }; 577 | 453B4F031CDE3F0A00BFB901 /* Release */ = { 578 | isa = XCBuildConfiguration; 579 | buildSettings = { 580 | BUNDLE_LOADER = "$(TEST_HOST)"; 581 | INFOPLIST_FILE = PMAlertControllerTests/Info.plist; 582 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 583 | PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertControllerTests; 584 | PRODUCT_NAME = "$(TARGET_NAME)"; 585 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PMAlertController.app/PMAlertController"; 586 | }; 587 | name = Release; 588 | }; 589 | 453B4F051CDE3F0A00BFB901 /* Debug */ = { 590 | isa = XCBuildConfiguration; 591 | buildSettings = { 592 | INFOPLIST_FILE = PMAlertControllerUITests/Info.plist; 593 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 594 | PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertControllerUITests; 595 | PRODUCT_NAME = "$(TARGET_NAME)"; 596 | TEST_TARGET_NAME = PMAlertController; 597 | }; 598 | name = Debug; 599 | }; 600 | 453B4F061CDE3F0A00BFB901 /* Release */ = { 601 | isa = XCBuildConfiguration; 602 | buildSettings = { 603 | INFOPLIST_FILE = PMAlertControllerUITests/Info.plist; 604 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 605 | PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertControllerUITests; 606 | PRODUCT_NAME = "$(TARGET_NAME)"; 607 | TEST_TARGET_NAME = PMAlertController; 608 | }; 609 | name = Release; 610 | }; 611 | 526FBB2C1CF0FD63005E5970 /* Debug */ = { 612 | isa = XCBuildConfiguration; 613 | buildSettings = { 614 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 615 | CURRENT_PROJECT_VERSION = 1; 616 | DEFINES_MODULE = YES; 617 | DYLIB_COMPATIBILITY_VERSION = 1; 618 | DYLIB_CURRENT_VERSION = 1; 619 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 620 | INFOPLIST_FILE = PMAlertController/Info.plist; 621 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 622 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 623 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 624 | PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertController; 625 | PRODUCT_NAME = "$(TARGET_NAME)"; 626 | SKIP_INSTALL = YES; 627 | SWIFT_VERSION = 5.0; 628 | VERSIONING_SYSTEM = "apple-generic"; 629 | VERSION_INFO_PREFIX = ""; 630 | }; 631 | name = Debug; 632 | }; 633 | 526FBB2D1CF0FD63005E5970 /* Release */ = { 634 | isa = XCBuildConfiguration; 635 | buildSettings = { 636 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 637 | CURRENT_PROJECT_VERSION = 1; 638 | DEFINES_MODULE = YES; 639 | DYLIB_COMPATIBILITY_VERSION = 1; 640 | DYLIB_CURRENT_VERSION = 1; 641 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 642 | INFOPLIST_FILE = PMAlertController/Info.plist; 643 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 644 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 645 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 646 | PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertController; 647 | PRODUCT_NAME = "$(TARGET_NAME)"; 648 | SKIP_INSTALL = YES; 649 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 650 | SWIFT_VERSION = 5.0; 651 | VERSIONING_SYSTEM = "apple-generic"; 652 | VERSION_INFO_PREFIX = ""; 653 | }; 654 | name = Release; 655 | }; 656 | /* End XCBuildConfiguration section */ 657 | 658 | /* Begin XCConfigurationList section */ 659 | 453B4ED11CDE3F0A00BFB901 /* Build configuration list for PBXProject "PMAlertController" */ = { 660 | isa = XCConfigurationList; 661 | buildConfigurations = ( 662 | 453B4EFC1CDE3F0A00BFB901 /* Debug */, 663 | 453B4EFD1CDE3F0A00BFB901 /* Release */, 664 | ); 665 | defaultConfigurationIsVisible = 0; 666 | defaultConfigurationName = Release; 667 | }; 668 | 453B4EFE1CDE3F0A00BFB901 /* Build configuration list for PBXNativeTarget "PMAlertControllerSample" */ = { 669 | isa = XCConfigurationList; 670 | buildConfigurations = ( 671 | 453B4EFF1CDE3F0A00BFB901 /* Debug */, 672 | 453B4F001CDE3F0A00BFB901 /* Release */, 673 | ); 674 | defaultConfigurationIsVisible = 0; 675 | defaultConfigurationName = Release; 676 | }; 677 | 453B4F011CDE3F0A00BFB901 /* Build configuration list for PBXNativeTarget "PMAlertControllerTests" */ = { 678 | isa = XCConfigurationList; 679 | buildConfigurations = ( 680 | 453B4F021CDE3F0A00BFB901 /* Debug */, 681 | 453B4F031CDE3F0A00BFB901 /* Release */, 682 | ); 683 | defaultConfigurationIsVisible = 0; 684 | defaultConfigurationName = Release; 685 | }; 686 | 453B4F041CDE3F0A00BFB901 /* Build configuration list for PBXNativeTarget "PMAlertControllerUITests" */ = { 687 | isa = XCConfigurationList; 688 | buildConfigurations = ( 689 | 453B4F051CDE3F0A00BFB901 /* Debug */, 690 | 453B4F061CDE3F0A00BFB901 /* Release */, 691 | ); 692 | defaultConfigurationIsVisible = 0; 693 | defaultConfigurationName = Release; 694 | }; 695 | 526FBB2B1CF0FD63005E5970 /* Build configuration list for PBXNativeTarget "PMAlertController" */ = { 696 | isa = XCConfigurationList; 697 | buildConfigurations = ( 698 | 526FBB2C1CF0FD63005E5970 /* Debug */, 699 | 526FBB2D1CF0FD63005E5970 /* Release */, 700 | ); 701 | defaultConfigurationIsVisible = 0; 702 | defaultConfigurationName = Release; 703 | }; 704 | /* End XCConfigurationList section */ 705 | }; 706 | rootObject = 453B4ECE1CDE3F0A00BFB901 /* Project object */; 707 | } 708 | -------------------------------------------------------------------------------- /PMAlertController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PMAlertController.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /PMAlertController.xcodeproj/xcshareddata/xcschemes/PMAlertController.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /PMAlertController.xcodeproj/xcuserdata/MacBookPro.xcuserdatad/xcschemes/PMAlertControllerSample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /PMAlertController.xcodeproj/xcuserdata/MacBookPro.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PMAlertController.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | PMAlertControllerSample.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 453B4ED51CDE3F0A00BFB901 21 | 22 | primary 23 | 24 | 25 | 453B4EE91CDE3F0A00BFB901 26 | 27 | primary 28 | 29 | 30 | 453B4EF41CDE3F0A00BFB901 31 | 32 | primary 33 | 34 | 35 | 526FBB211CF0FD63005E5970 36 | 37 | primary 38 | 39 | 40 | 52A3DD5F1CF0F891000C72E9 41 | 42 | primary 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /PMAlertController.xcodeproj/xcuserdata/pmusolino.xcuserdatad/xcschemes/PMAlertControllerSample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /PMAlertController.xcodeproj/xcuserdata/pmusolino.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PMAlertController.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | PMAlertControllerSample.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 453B4ED51CDE3F0A00BFB901 21 | 22 | primary 23 | 24 | 25 | 453B4EE91CDE3F0A00BFB901 26 | 27 | primary 28 | 29 | 30 | 453B4EF41CDE3F0A00BFB901 31 | 32 | primary 33 | 34 | 35 | 526FBB211CF0FD63005E5970 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /PMAlertController/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(MARKETING_VERSION) 21 | UILaunchStoryboardName 22 | LaunchScreen 23 | UIMainStoryboardFile 24 | Main 25 | 26 | 27 | -------------------------------------------------------------------------------- /PMAlertController/PMAlertController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PMAlertController.h 3 | // PMAlertController 4 | // 5 | // Created by Vittorio Monaco on 21/05/16. 6 | // Copyright © 2018 Codeido. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for PMAlertController. 12 | FOUNDATION_EXPORT double PMAlertControllerVersionNumber; 13 | 14 | //! Project version string for PMAlertController. 15 | FOUNDATION_EXPORT const unsigned char PMAlertControllerVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /PMAlertControllerSample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // PMAlertController 4 | // 5 | // Created by Paolo Musolino on 07/05/16. 6 | // Copyright © 2018 Codeido. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /PMAlertControllerSample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /PMAlertControllerSample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /PMAlertControllerSample/Assets.xcassets/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "triangle-background-17.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PMAlertControllerSample/Assets.xcassets/background.imageset/triangle-background-17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pmusolino/PMAlertController/bcb9a6ac8ebd82d1ae99f16c1400993669e5e488/PMAlertControllerSample/Assets.xcassets/background.imageset/triangle-background-17.png -------------------------------------------------------------------------------- /PMAlertControllerSample/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /PMAlertControllerSample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 37 | 50 | 63 | 76 | 89 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /PMAlertControllerSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /PMAlertControllerSample/Resources/flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pmusolino/PMAlertController/bcb9a6ac8ebd82d1ae99f16c1400993669e5e488/PMAlertControllerSample/Resources/flag.png -------------------------------------------------------------------------------- /PMAlertControllerSample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // PMAlertController 4 | // 5 | // Created by Paolo Musolino on 07/05/16. 6 | // Copyright © 2018 Codeido. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import PMAlertController 11 | 12 | class ViewController: UIViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | } 17 | 18 | override func viewDidAppear(_ animated: Bool) { 19 | super.viewDidAppear(animated) 20 | } 21 | 22 | override func didReceiveMemoryWarning() { 23 | super.didReceiveMemoryWarning() 24 | } 25 | 26 | @IBAction func showAlert(_ sender: AnyObject) { 27 | let alertVC = PMAlertController(title: "Locate your device", description: "Enables access to your location: discover what you can do when you're traveling and what is available near you.", image: UIImage(named: "flag.png"), style: .alert) //Image by freepik.com, taken on flaticon.com 28 | 29 | alertVC.addAction(PMAlertAction(title: "Cancel", style: .cancel, action: { () -> Void in 30 | print("Cancel") 31 | })) 32 | 33 | alertVC.addAction(PMAlertAction(title: "Allow", style: .default, action: { () in 34 | print("Allow") 35 | })) 36 | 37 | self.present(alertVC, animated: true, completion: nil) 38 | } 39 | 40 | @IBAction func showWalkthrough(_ sender: AnyObject) { 41 | 42 | let alertVC = PMAlertController(title: "Locate your device", description: "Enables access to your location: discover what you can do when you're traveling and what is available near you.", image: UIImage(named: "flag.png"), style: .walkthrough) //Image by freepik.com, taken on flaticon.com 43 | 44 | alertVC.addAction(PMAlertAction(title: "Cancel", style: .cancel, action: { () -> Void in 45 | print("Cancel") 46 | })) 47 | 48 | alertVC.addAction(PMAlertAction(title: "Allow", style: .default, action: { () in 49 | print("Allow") 50 | })) 51 | 52 | self.present(alertVC, animated: true, completion: nil) 53 | } 54 | 55 | @IBAction func showAlertWith3Buttons(_ sender: AnyObject) { 56 | 57 | let alertVC = PMAlertController(title: "Locate your device", description: "Enables access to your location: discover what you can do when you're traveling and what is available near you.", image: UIImage(named: "flag.png"), style: .alert) //Image by freepik.com, taken on flaticon.com 58 | 59 | alertVC.addAction(PMAlertAction(title: "Cancel", style: .cancel, action: { () -> Void in 60 | print("Cancel") 61 | })) 62 | 63 | alertVC.addAction(PMAlertAction(title: "No Thanks", style: .cancel, action: { () in 64 | print("No thanks") 65 | })) 66 | 67 | alertVC.addAction(PMAlertAction(title: "Allow", style: .default, action: { () in 68 | print("Allow") 69 | })) 70 | 71 | self.present(alertVC, animated: true, completion: nil) 72 | } 73 | 74 | @IBAction func showWalkthroughWith3Buttons(_ sender: AnyObject) { 75 | let alertVC = PMAlertController(title: "Locate your device", description: "Enables access to your location: discover what you can do when you're traveling and what is available near you.", image: UIImage(named: "flag.png"), style: .walkthrough) //Image by freepik.com, taken on flaticon.com 76 | 77 | alertVC.addAction(PMAlertAction(title: "Cancel", style: .cancel, action: { () -> Void in 78 | print("Cancel") 79 | })) 80 | 81 | alertVC.addAction(PMAlertAction(title: "No Thanks", style: .cancel, action: { () in 82 | print("No thanks") 83 | })) 84 | 85 | alertVC.addAction(PMAlertAction(title: "Allow", style: .default, action: { () in 86 | print("Allow") 87 | })) 88 | 89 | self.present(alertVC, animated: true, completion: nil) 90 | } 91 | 92 | @IBAction func showAlertWithTextEntry(_ sender: AnyObject) { 93 | let alertVC = PMAlertController(title: "Enter your device location", description: "If your device can't be found, you can manually enter its location, so our Sentinel Robots know where to find it", image: UIImage(named: "flag.png"), style: .alert) 94 | 95 | alertVC.addTextField { (textField) in 96 | textField?.placeholder = "Location..." 97 | } 98 | 99 | alertVC.addAction(PMAlertAction(title: "Cancel", style: .cancel)) 100 | 101 | alertVC.addAction(PMAlertAction(title: "Ok", style: .default, action: { () in 102 | print (alertVC.textFields[0].text ?? "") 103 | })) 104 | 105 | self.present(alertVC, animated: true, completion: nil) 106 | } 107 | 108 | @IBAction func showWalkthroughWithCustomPaddings(_ sender: AnyObject) { 109 | let alertVC = PMAlertController(title: "Locate your device", description: "Enables access to your location: discover what you can do when you're traveling and what is available near you.", image: UIImage(named: "flag.png"), style: .walkthrough) //Image by freepik.com, taken on flaticon.com 110 | 111 | 112 | alertVC.headerViewTopSpaceConstraint.constant = 20 113 | alertVC.alertContentStackViewLeadingConstraint.constant = 20 114 | alertVC.alertContentStackViewTrailingConstraint.constant = 20 115 | alertVC.alertContentStackViewTopConstraint.constant = 20 116 | alertVC.alertActionStackViewLeadingConstraint.constant = 20 117 | alertVC.alertActionStackViewTrailingConstraint.constant = 20 118 | alertVC.alertActionStackViewTopConstraint.constant = 20 119 | alertVC.alertActionStackViewBottomConstraint.constant = 20 120 | alertVC.view.layoutIfNeeded() 121 | 122 | alertVC.addAction(PMAlertAction(title: "Cancel", style: .cancel, action: { () -> Void in 123 | print("Cancel") 124 | })) 125 | 126 | alertVC.addAction(PMAlertAction(title: "Allow", style: .default, action: { () in 127 | print("Allow") 128 | })) 129 | 130 | self.present(alertVC, animated: true, completion: nil) 131 | } 132 | 133 | } 134 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Icon 3 |

4 | 5 | 6 | [![Language](https://img.shields.io/badge/Swift-4%20%26%205-orange.svg)]() 7 | [![GitHub license](https://img.shields.io/badge/License-MIT-lightgrey)](https://github.com/pmusolino/PMAlertController/blob/master/LICENSE) 8 | [![Pod version](https://img.shields.io/badge/Cocoapods-compatible%20-blue)](https://cocoapods.org/pods/PMAlertController) 9 | [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-yellow.svg)](https://github.com/Carthage/Carthage) 10 | 11 | 12 | PMAlertController is a small library that allows you to substitute Apple's uncustomizable `UIAlertController`, with a beautiful and totally customizable alert that you can use in your iOS app. Enjoy! 13 | 14 |

15 | Icon 16 |

17 | 18 | ## Features 19 | ---------------- 20 | 21 | - [x] Header View 22 | - [x] Header Image (Optional) 23 | - [x] Title 24 | - [x] Description message 25 | - [x] Customizations: fonts, colors, dimensions & more 26 | - [x] 1, 2 buttons (horizontally) or 3+ buttons (vertically) 27 | - [x] Closure when a button is pressed 28 | - [x] Text Fields support 29 | - [x] Similar implementation to UIAlertController 30 | - [x] Cocoapods 31 | - [x] Carthage 32 | - [x] Animation with UIKit Dynamics 33 | - [x] Objective-C compatibility 34 | - [x] Swift 4, Swift 4.2 & Swift 5 support 35 | - [ ] Swift Package Manager 36 | 37 | 38 | ## Requirements 39 | ---------------- 40 | 41 | - iOS 9.0+ 42 | - Xcode 10+ 43 | 44 | ## CocoaPods 45 | ---------------- 46 | 47 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: 48 | 49 | ```bash 50 | $ gem install cocoapods 51 | ``` 52 | 53 | To integrate PMAlertController into your Xcode project using CocoaPods, specify it in your `Podfile`: 54 | 55 | 56 | ```ruby 57 | source 'https://github.com/CocoaPods/Specs.git' 58 | platform :ios, '9.0' 59 | use_frameworks! 60 | 61 | pod 'PMAlertController' 62 | ``` 63 | 64 | Then, run the following command: 65 | 66 | ```bash 67 | $ pod install 68 | ``` 69 | 70 | ## Carthage 71 | ---------------- 72 | 73 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. 74 | 75 | You can install Carthage with [Homebrew](http://brew.sh/) using the following command: 76 | 77 | ```bash 78 | $ brew update 79 | $ brew install carthage 80 | ``` 81 | 82 | To integrate PMAlertController into your Xcode project using Carthage, specify it in your `Cartfile`: 83 | 84 | ```ogdl 85 | github "pmusolino/PMAlertController" 86 | ``` 87 | 88 | Run `carthage update` to build the framework and drag the built `PMAlertController.framework` into your Xcode project. 89 | 90 | ## Manually 91 | ---------------- 92 | 1. Download and drop ```/Library``` folder in your project. 93 | 2. Congratulations! 94 | 95 | ## Usage 96 | ---------------- 97 | The usage is very similar to `UIAlertController`. 98 | `PMAlertController` has two styles: Alert & Walkthrough. 99 | 100 | **Alert Style:** with this style, the alert has the width of 270 points, like Apple's `UIAlertController`. 101 | 102 | **Walkthrough Style:** with walkthrough, the alert has the width of the screen minus 18 points from the left and the right bounds. This mode is intended to be used before authorization requests like the ones for location, push notifications and more. 103 | 104 | #### Show a simple alert with two buttons and one textfield 105 | 106 | ```swift 107 | //This code works with Swift 5 108 | 109 | let alertVC = PMAlertController(title: "A Title", description: "My Description", image: UIImage(named: "img.png"), style: .alert) 110 | 111 | alertVC.addAction(PMAlertAction(title: "Cancel", style: .cancel, action: { () -> Void in 112 | print("Capture action Cancel") 113 | })) 114 | 115 | alertVC.addAction(PMAlertAction(title: "OK", style: .default, action: { () in 116 | print("Capture action OK") 117 | })) 118 | 119 | alertVC.addTextField { (textField) in 120 | textField?.placeholder = "Location..." 121 | } 122 | 123 | self.present(alertVC, animated: true, completion: nil) 124 | 125 | ``` 126 | 127 | ## Swift compatibility 128 | 129 | - If you use **Swift 5.0 or higher**, you can use the [latest release](https://github.com/pmusolino/PMAlertController/releases). 130 | 131 | - If you use **Swift 4**, you can use the [release 3.5.0](https://github.com/pmusolino/PMAlertController/releases/tag/3.5.0). 132 | 133 | - If you use **Swift 3**, you can use the [release 2.1.3](https://github.com/pmusolino/PMAlertController/releases/tag/2.1.3). 134 | 135 | - If you use **Swift 2.3**, you can use the [release 1.1.0](https://github.com/pmusolino/PMAlertController/releases/tag/1.1.0) 136 | 137 | - If you use **Swift 2.2**, you can use the [release 1.0.5](https://github.com/pmusolino/PMAlertController/releases/tag/1.0.5) 138 | 139 | 140 | ## Third Party Bindings 141 | 142 | ### React Native 143 | You may now use this library with [React Native](https://github.com/facebook/react-native) via the module [here](https://github.com/prscX/react-native-styled-dialogs) 144 | 145 | 146 | ## Contributing 147 | 148 | - If you **need help** or you'd like to **ask a general question**, open an issue. 149 | - If you **found a bug**, open an issue. 150 | - If you **have a feature request**, open an issue. 151 | - If you **want to contribute**, submit a pull request. 152 | 153 | 154 | ## Acknowledgements 155 | 156 | **Made with ❤️ by [Paolo Musolino](https://github.com/pmusolino).** 157 | 158 | ***Follow me on:*** 159 | #### 💼 [Linkedin](https://www.linkedin.com/in/paolomusolino/) 160 | 161 | #### 🤖 [Twitter](https://twitter.com/pmusolino) 162 | 163 | #### 🌇 [Instagram](https://www.instagram.com/pmusolino/) 164 | 165 | #### 👨🏼‍🎤 [Facebook](https://www.facebook.com/paolomusolino) 166 | 167 | 168 | ## MIT License 169 | ---------------- 170 | PMAlertController is available under the MIT license. See the LICENSE file for more info. 171 | -------------------------------------------------------------------------------- /logo_pmalertcontroller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pmusolino/PMAlertController/bcb9a6ac8ebd82d1ae99f16c1400993669e5e488/logo_pmalertcontroller.png -------------------------------------------------------------------------------- /preview_pmalertacontroller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pmusolino/PMAlertController/bcb9a6ac8ebd82d1ae99f16c1400993669e5e488/preview_pmalertacontroller.png --------------------------------------------------------------------------------