├── .swift_version
├── CDAlertView
├── Classes
│ ├── .gitkeep
│ ├── ImageHelper.swift
│ ├── CDAlertViewType.swift
│ ├── CDAlertHeaderView.swift
│ ├── LayoutConstraintsExtension.swift
│ └── CDAlertView.swift
├── Resources
│ └── Assets
│ │ ├── check@1x.png
│ │ ├── check@2x.png
│ │ ├── check@3x.png
│ │ ├── error@1x.png
│ │ ├── error@2x.png
│ │ ├── error@3x.png
│ │ ├── alarmFilled@1x.png
│ │ ├── alarmFilled@2x.png
│ │ ├── alarmFilled@3x.png
│ │ ├── alarmOutline@1x.png
│ │ ├── alarmOutline@2x.png
│ │ ├── alarmOutline@3x.png
│ │ ├── warningFilled@1x.png
│ │ ├── warningFilled@2x.png
│ │ ├── warningFilled@3x.png
│ │ ├── warningOutline@1x.png
│ │ ├── warningOutline@2x.png
│ │ ├── warningOutline@3x.png
│ │ ├── notificationFilled@1x.png
│ │ ├── notificationFilled@2x.png
│ │ ├── notificationFilled@3x.png
│ │ ├── notificationOutline@1x.png
│ │ ├── notificationOutline@2x.png
│ │ └── notificationOutline@3x.png
├── CDAlertView.h
└── Info.plist
├── Screenshots
├── 1.gif
├── 2.gif
└── 3.gif
├── CDAlertView.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── xcshareddata
│ └── xcschemes
│ │ └── CDAlertView.xcscheme
└── project.pbxproj
├── _config.yml
├── Example
├── CDAlertViewExample.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── project.pbxproj
├── CDAlertViewExample.xcworkspace
│ ├── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── contents.xcworkspacedata
├── Podfile
└── CDAlertViewExample
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Info.plist
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── AppDelegate.swift
│ └── ViewController.swift
├── .travis.yml
├── CDAlertViewTests
├── Info.plist
└── CDAlertViewTests.swift
├── LICENSE
├── CDAlertView.podspec
├── .gitignore
├── CODE_OF_CONDUCT.md
├── index.md
└── README.md
/.swift_version:
--------------------------------------------------------------------------------
1 | 5
2 |
--------------------------------------------------------------------------------
/CDAlertView/Classes/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Screenshots/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/Screenshots/1.gif
--------------------------------------------------------------------------------
/Screenshots/2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/Screenshots/2.gif
--------------------------------------------------------------------------------
/Screenshots/3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/Screenshots/3.gif
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/check@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/check@1x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/check@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/check@2x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/check@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/check@3x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/error@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/error@1x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/error@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/error@2x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/error@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/error@3x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/alarmFilled@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/alarmFilled@1x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/alarmFilled@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/alarmFilled@2x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/alarmFilled@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/alarmFilled@3x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/alarmOutline@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/alarmOutline@1x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/alarmOutline@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/alarmOutline@2x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/alarmOutline@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/alarmOutline@3x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/warningFilled@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/warningFilled@1x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/warningFilled@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/warningFilled@2x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/warningFilled@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/warningFilled@3x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/warningOutline@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/warningOutline@1x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/warningOutline@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/warningOutline@2x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/warningOutline@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/warningOutline@3x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/notificationFilled@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/notificationFilled@1x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/notificationFilled@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/notificationFilled@2x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/notificationFilled@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/notificationFilled@3x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/notificationOutline@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/notificationOutline@1x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/notificationOutline@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/notificationOutline@2x.png
--------------------------------------------------------------------------------
/CDAlertView/Resources/Assets/notificationOutline@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/HEAD/CDAlertView/Resources/Assets/notificationOutline@3x.png
--------------------------------------------------------------------------------
/CDAlertView.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | title: CDAlertView
2 | description: Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift
3 | google_analytics:
4 | show_downloads: true
5 | theme: jekyll-theme-cayman
6 |
7 | gems:
8 | - jekyll-mentions
9 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CDAlertView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CDAlertView/CDAlertView.h:
--------------------------------------------------------------------------------
1 | //
2 | // CDAlertView.h
3 | // CDAlertView
4 | //
5 | // Created by Candost Dagdeviren on 29/11/2016.
6 | // Copyright © 2016 Candost Dagdeviren. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for CDAlertView.
12 | FOUNDATION_EXPORT double CDAlertViewVersionNumber;
13 |
14 | //! Project version string for CDAlertView.
15 | FOUNDATION_EXPORT const unsigned char CDAlertViewVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 | platform :ios, '12.0'
3 | inhibit_all_warnings!
4 | target ‘CDAlertViewExample' do
5 | pod 'CDAlertView', :path => '../'
6 | post_install do |installer|
7 | installer.pods_project.targets.each do |target|
8 | target.build_configurations.each do |config|
9 | config.build_settings['ENABLE_BITCODE'] = 'NO'
10 | config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
11 | config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
12 | config.build_settings['SWIFT_VERSION'] = '5.0'
13 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/CDAlertView/Classes/ImageHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ImageHelper.swift
3 | // Pods
4 | //
5 | // Created by Candost Dagdeviren on 02/11/2016.
6 | //
7 | //
8 |
9 | import Foundation
10 |
11 | class ImageHelper
12 | {
13 | class func loadImage(name: String?) -> UIImage? {
14 | guard let imageName = name else { return nil }
15 |
16 | let podBundle = Bundle(for: ImageHelper.self)
17 | guard let url = podBundle.url(forResource: "CDAlertView", withExtension: "bundle") else { return nil }
18 |
19 | let bundle = Bundle(url: url)
20 | return UIImage(named: imageName, in: bundle, compatibleWith: nil)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * http://www.objc.io/issue-6/travis-ci.html
3 | # * https://github.com/supermarin/xcpretty#usage
4 |
5 | osx_image: xcode12.2
6 | language: swift
7 | xcode_workspace: Example/CDAlertViewExample.xcworkspace
8 | xcode_sdk: iphonesimulator12.0
9 | xcode_scheme: CDAlertViewExample
10 | podfile: Example/Podfile
11 | on:
12 | repo: candostdagdeviren/CDAlertView
13 | tags: true
14 | before_install:
15 | - gem install cocoapods
16 | - pod install --project-directory=Example
17 | - brew update
18 | - brew outdated carthage || brew upgrade carthage
19 | before_deploy:
20 | - carthage build --no-skip-current
21 | script:
22 | - set -o pipefail
23 | - xcodebuild -version
24 | - pod lib lint
25 |
--------------------------------------------------------------------------------
/CDAlertViewTests/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 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CDAlertView/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 | 0.3.1
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample/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" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Candost Dagdeviren
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/CDAlertViewTests/CDAlertViewTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CDAlertViewTests.swift
3 | // CDAlertViewTests
4 | //
5 | // Created by Candost Dagdeviren on 29/11/2016.
6 | // Copyright © 2016 Candost Dagdeviren. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import CDAlertView
11 |
12 | class CDAlertViewTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | // Use XCTAssert and related functions to verify your tests produce the correct results.
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measure {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/CDAlertView.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'CDAlertView'
3 | s.version = '0.11.0'
4 | s.summary = 'Highly customizable alert/notification/success/error/alarm popup'
5 | s.description = <<-DESC
6 | CDAlertView is highly customizable alert popup written in Swift 5. Usage is similar to UIAlertController.
7 | DESC
8 |
9 | s.homepage = 'https://github.com/candostdagdeviren/CDAlertView'
10 | s.screenshots = 'https://cloud.githubusercontent.com/assets/1971963/20238308/4bc1516e-a8e8-11e6-8e8b-c1a088f5daa0.png'
11 | s.license = { :type => 'MIT', :file => 'LICENSE' }
12 | s.author = { 'Candost Dagdeviren' => 'candostdagdeviren@gmail.com' }
13 | s.source = { :git => 'https://github.com/candostdagdeviren/CDAlertView.git', :tag => s.version.to_s }
14 | s.social_media_url = 'https://twitter.com/candostdagdevrn'
15 |
16 | s.ios.deployment_target = '12.0'
17 |
18 | s.source_files = 'CDAlertView/Classes/**/*'
19 | s.swift_version = '5.0'
20 | s.resource_bundles = {
21 | 'CDAlertView' => ['CDAlertView/Resources/Assets/*.*']
22 | }
23 |
24 | s.frameworks = 'UIKit'
25 | end
26 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIViewControllerBasedStatusBarAppearance
6 |
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
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 |
40 |
41 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | .DS_Store
6 |
7 | ## Build generated
8 | build/
9 | DerivedData/
10 |
11 | ## Various settings
12 | *.pbxuser
13 | !default.pbxuser
14 | *.mode1v3
15 | !default.mode1v3
16 | *.mode2v3
17 | !default.mode2v3
18 | *.perspectivev3
19 | !default.perspectivev3
20 | xcuserdata/
21 |
22 | ## Other
23 | *.moved-aside
24 | *.xcuserstate
25 |
26 | ## Obj-C/Swift specific
27 | *.hmap
28 | *.ipa
29 | *.dSYM.zip
30 | *.dSYM
31 |
32 | ## Playgrounds
33 | timeline.xctimeline
34 | playground.xcworkspace
35 |
36 | # Swift Package Manager
37 | #
38 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
39 | # Packages/
40 | .build/
41 |
42 | # CocoaPods
43 | #
44 | # We recommend against adding the Pods directory to your .gitignore. However
45 | # you should judge for yourself, the pros and cons are mentioned at:
46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
47 | #
48 | Pods/
49 | AlertView.xcworkspace
50 | Podfile.lock
51 |
52 | # Carthage
53 | #
54 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
55 | # Carthage/Checkouts
56 |
57 | Carthage/Build
58 |
59 | # fastlane
60 | #
61 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
62 | # screenshots whenever they are needed.
63 | # For more information about the recommended setup visit:
64 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
65 |
66 | fastlane/report.xml
67 | fastlane/Preview.html
68 | fastlane/screenshots
69 | fastlane/test_output
70 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample/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 |
28 |
--------------------------------------------------------------------------------
/CDAlertView/Classes/CDAlertViewType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CDAlertViewType.swift
3 | // CDAlertView
4 | //
5 | // Created by Luca Pizzini on 03/12/20.
6 | // Copyright © 2020 Candost Dagdeviren. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public enum CDAlertViewType
12 | {
13 | case error, warning, success, notification, alarm, noImage, custom(image: UIImage)
14 |
15 | // This is needed because we can't do a comparison of enums
16 | // if it has an associated value.
17 | func hasImage() -> Bool {
18 | switch self {
19 | case .noImage:
20 | return false
21 | default:
22 | return true
23 | }
24 | }
25 |
26 | var fillColor: UIColor? {
27 | switch self {
28 | case .error:
29 | return UIColor(red: 235/255, green: 61/255, blue: 65/255, alpha: 1)
30 | case .success:
31 | return UIColor(red: 65/255, green: 158/255, blue: 57/255, alpha: 1)
32 | case .warning:
33 | return UIColor(red: 255/255, green: 149/255, blue: 0/255, alpha: 1)
34 | case .notification:
35 | return UIColor(red: 27/255, green: 169/255, blue: 225/255, alpha: 1)
36 | case .alarm:
37 | return UIColor(red: 196/255, green: 52/255, blue: 46/255, alpha: 1)
38 | case .custom, .noImage:
39 | return nil
40 | }
41 | }
42 |
43 | func image(isIconFilled: Bool) -> UIImage? {
44 | switch self {
45 | case .error:
46 | return ImageHelper.loadImage(name: "error")
47 | case .success:
48 | return ImageHelper.loadImage(name: "check")
49 | case .warning:
50 | let imageName = isIconFilled ? "warningFilled" : "warningOutline"
51 | return ImageHelper.loadImage(name: imageName)
52 | case .notification:
53 | let imageName = isIconFilled ? "notificationFilled" : "notificationOutline"
54 | return ImageHelper.loadImage(name: imageName)
55 | case .alarm:
56 | let imageName = isIconFilled ? "alarmFilled" : "alarmOutline"
57 | return ImageHelper.loadImage(name: imageName)
58 | case .custom(let image):
59 | return image
60 | case .noImage:
61 | return nil
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // CDAlertViewExample
4 | //
5 | // Created by Candost Dagdeviren on 29/11/2016.
6 | // Copyright © 2016 Candost Dagdeviren. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 |
21 | func applicationWillResignActive(_ application: UIApplication) {
22 | // 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.
23 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
24 | }
25 |
26 | func applicationDidEnterBackground(_ application: UIApplication) {
27 | // 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.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | func applicationWillEnterForeground(_ application: UIApplication) {
32 | // 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.
33 | }
34 |
35 | func applicationDidBecomeActive(_ application: UIApplication) {
36 | // 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.
37 | }
38 |
39 | func applicationWillTerminate(_ application: UIApplication) {
40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
41 | }
42 |
43 |
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // CDAlertViewExample
4 | //
5 | // Created by Candost Dagdeviren on 29/11/2016.
6 | // Copyright © 2016 Candost Dagdeviren. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import CDAlertView
11 |
12 | class ViewController: UIViewController {
13 |
14 | @IBOutlet weak var tableView: UITableView!
15 |
16 | override func viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | tableView.delegate = self
20 | tableView.dataSource = self
21 | }
22 |
23 | override var preferredStatusBarStyle: UIStatusBarStyle {
24 | return .lightContent
25 | }
26 | }
27 |
28 | extension ViewController: UITableViewDelegate, UITableViewDataSource
29 | {
30 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
31 | return CDAlertViewType.allCases.count
32 | }
33 |
34 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
35 | let cell = UITableViewCell()
36 | let alertViewType = CDAlertViewType.allCases[indexPath.row]
37 |
38 | cell.textLabel?.text = alertViewType.description
39 | cell.accessoryType = .disclosureIndicator
40 |
41 | return cell
42 | }
43 |
44 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
45 | let alertViewType = CDAlertViewType.allCases[indexPath.row]
46 |
47 | let alert = CDAlertView(title: alertViewType.description, message: "Example message", type: alertViewType)
48 | let action = CDAlertViewAction(title: "DONE")
49 | alert.isTextFieldHidden = false
50 | alert.add(action: action)
51 | alert.hideAnimations = { (center, transform, alpha) in
52 | transform = .identity
53 | alpha = 0
54 | }
55 |
56 | alert.show() { (alert) in
57 | print("completed")
58 | }
59 | }
60 | }
61 |
62 | extension CDAlertViewType : CaseIterable
63 | {
64 | public static var allCases: [CDAlertViewType] {
65 | return [.error, .warning, .success, .notification, .alarm, .noImage, .custom(image: UIImage())]
66 | }
67 |
68 | var description: String {
69 | switch self {
70 | case .error:
71 | return "Error"
72 | case .success:
73 | return "Success"
74 | case .warning:
75 | return "Warning"
76 | case .notification:
77 | return "Notification"
78 | case .alarm:
79 | return "Alarm"
80 | case .custom:
81 | return "Custom"
82 | case .noImage:
83 | return "No image"
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at candostdagdeviren@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CDAlertView.xcodeproj/xcshareddata/xcschemes/CDAlertView.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
34 |
40 |
41 |
42 |
43 |
44 |
50 |
51 |
52 |
53 |
54 |
55 |
66 |
67 |
73 |
74 |
75 |
76 |
77 |
78 |
84 |
85 |
91 |
92 |
93 |
94 |
96 |
97 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/CDAlertView/Classes/CDAlertHeaderView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CDAlertHeaderView.swift
3 | // CDAlertView
4 | //
5 | // Created by Candost Dagdeviren on 10/30/2016.
6 | // Copyright (c) 2016 Candost Dagdeviren. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | internal class CDAlertHeaderView: UIView {
12 |
13 | // MARK: Properties
14 |
15 | internal var circleFillColor: UIColor? {
16 | didSet {
17 | if let cfc = circleFillColor {
18 | fillColor = cfc
19 | }
20 | }
21 | }
22 | internal var isIconFilled: Bool = false
23 | internal var alertBackgroundColor: UIColor = UIColor.white.withAlphaComponent(0.9)
24 | internal var hasShadow: Bool = true
25 | internal var hasRoundCorners = true
26 | private var fillColor: UIColor!
27 | private var type: CDAlertViewType?
28 | private var imageView: UIImageView?
29 |
30 | convenience init(type: CDAlertViewType?, isIconFilled: Bool) {
31 | self.init(frame: .zero)
32 | self.type = type
33 | self.isIconFilled = isIconFilled
34 | backgroundColor = UIColor.clear
35 | fillColor = type?.fillColor ?? UIColor.white.withAlphaComponent(0.9)
36 | imageView = createImageView()
37 | }
38 |
39 | // MARK: UIView
40 |
41 | override func draw(_ rect: CGRect) {
42 | var cornerRadii = CGSize(width: 8, height: 8)
43 | if hasRoundCorners == false {
44 | cornerRadii = CGSize(width: 0, height: 0)
45 | }
46 | let path = UIBezierPath(roundedRect: CGRect(x: 0, y: 16, width: rect.size.width, height: rect.size.height-16),
47 | byRoundingCorners: [.topLeft, .topRight],
48 | cornerRadii: cornerRadii)
49 | alertBackgroundColor.setFill()
50 | path.fill()
51 |
52 | if type?.hasImage() == true {
53 | let curve = UIBezierPath(arcCenter: CGPoint(x: rect.size.width/2, y: 28),
54 | radius: 28,
55 | startAngle:6.84 * CGFloat.pi / 6,
56 | endAngle: 11.155 * CGFloat.pi / 6,
57 | clockwise: true)
58 | alertBackgroundColor.setFill()
59 | curve.fill()
60 | }
61 |
62 | let innerCircle = UIBezierPath(arcCenter: CGPoint(x: rect.size.width/2, y: 28),
63 | radius: 24,
64 | startAngle:0,
65 | endAngle: 2 * CGFloat.pi,
66 | clockwise: true)
67 | fillColor.setFill()
68 | innerCircle.fill()
69 |
70 | if hasShadow {
71 | let shadowPath = UIBezierPath()
72 | shadowPath.move(to: CGPoint(x: 0.0, y: rect.size.height))
73 | shadowPath.addLine(to: CGPoint(x: 0, y: 16))
74 | shadowPath.addLine(to: CGPoint(x: (rect.size.width/2)-15, y: 16))
75 | shadowPath.addArc(withCenter: CGPoint(x: rect.size.width/2, y: 28),
76 | radius: 28,
77 | startAngle: 6.84 * CGFloat.pi / 6,
78 | endAngle: 11.155 * CGFloat.pi / 6,
79 | clockwise: true)
80 | shadowPath.addLine(to: CGPoint(x: rect.size.width, y: 16))
81 | shadowPath.addLine(to: CGPoint(x: rect.size.width, y: rect.size.height))
82 | shadowPath.addLine(to: CGPoint(x: rect.size.width-10, y: rect.size.height-5))
83 | shadowPath.addLine(to: CGPoint(x: 10, y: rect.size.height-5))
84 | shadowPath.close()
85 |
86 | self.setShadow(withPath: shadowPath)
87 | }
88 | }
89 |
90 | // MARK: Private
91 |
92 | private func createImageView() -> UIImageView? {
93 | guard let type = type else { return nil }
94 |
95 | let imageView = UIImageView(frame: .zero)
96 | imageView.image = type.image(isIconFilled: self.isIconFilled)
97 | imageView.contentMode = .center
98 | addSubview(imageView)
99 | imageView.translatesAutoresizingMaskIntoConstraints = false
100 | imageView.cd_centerHorizontally()
101 |
102 | imageView.cd_alignToTop(of: self, margin: 12, multiplier: 1)
103 | imageView.cd_setHeight(32)
104 | imageView.cd_setWidth(32)
105 |
106 | return imageView
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample/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 |
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 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/CDAlertView/Classes/LayoutConstraintsExtension.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LayoutConstraintsExtension.swift
3 | // Pods
4 | //
5 | // Created by Candost Dagdeviren on 01/11/2016.
6 | //
7 | //
8 |
9 | import Foundation
10 |
11 | internal extension UIView {
12 | func cd_alignToTop(of view: UIView, margin: CGFloat, multiplier: CGFloat) {
13 | self.superview!.addConstraint(NSLayoutConstraint(item: self,
14 | attribute: .top,
15 | relatedBy: .equal,
16 | toItem: view,
17 | attribute: .top,
18 | multiplier: multiplier,
19 | constant: margin))
20 | }
21 |
22 | func cd_alignTopToParent(with margin: CGFloat) {
23 | cd_alignToTop(of: self.superview!, margin: margin, multiplier: 1)
24 | }
25 |
26 | func cd_alignBottomToParent(with margin: CGFloat) {
27 | cd_alignToBottom(of: self.superview!, margin: margin)
28 | }
29 |
30 | func cd_alignToBottom(of view: UIView, margin: CGFloat) {
31 | self.superview!.addConstraint(NSLayoutConstraint(item: self,
32 | attribute: .bottom,
33 | relatedBy: .equal,
34 | toItem: view,
35 | attribute: .bottom,
36 | multiplier: 1,
37 | constant: -margin))
38 | }
39 |
40 | func cd_alignLeftToParent(with margin: CGFloat) {
41 | cd_alignToLeft(of: self.superview!, margin: margin)
42 | }
43 |
44 | func cd_alignToLeft(of view: UIView, margin: CGFloat) {
45 | self.superview!.addConstraint(NSLayoutConstraint(item: self,
46 | attribute: .left,
47 | relatedBy: .equal,
48 | toItem: view,
49 | attribute: .left,
50 | multiplier: 1,
51 | constant: margin))
52 | }
53 |
54 | func cd_alignRightToParent(with margin: CGFloat) {
55 | cd_alignToRight(of: self.superview!, margin: margin)
56 | }
57 |
58 | func cd_alignToRight(of view: UIView, margin: CGFloat) {
59 | self.superview!.addConstraint(NSLayoutConstraint(item: self,
60 | attribute: .right,
61 | relatedBy: .equal,
62 | toItem: view,
63 | attribute: .right,
64 | multiplier: 1,
65 | constant: -margin))
66 | }
67 |
68 | func cd_alignToParent(with margin: CGFloat) {
69 | translatesAutoresizingMaskIntoConstraints = false
70 | cd_alignTopToParent(with: margin)
71 | cd_alignLeftToParent(with: margin)
72 | cd_alignRightToParent(with: margin)
73 | cd_alignBottomToParent(with: margin)
74 | }
75 |
76 | func cd_setHeight(_ height: CGFloat) {
77 | self.addConstraint(NSLayoutConstraint(item: self,
78 | attribute: .height,
79 | relatedBy: .equal,
80 | toItem: nil,
81 | attribute: .notAnAttribute,
82 | multiplier: 1,
83 | constant: height))
84 | }
85 |
86 | func cd_setMaxHeight(_ height: CGFloat) {
87 | self.addConstraint(NSLayoutConstraint(item: self,
88 | attribute: .height,
89 | relatedBy: .lessThanOrEqual,
90 | toItem: nil,
91 | attribute: .notAnAttribute,
92 | multiplier: 1,
93 | constant: height))
94 | }
95 |
96 | func cd_setWidth(_ width: CGFloat) {
97 | self.addConstraint(NSLayoutConstraint(item: self,
98 | attribute: .width,
99 | relatedBy: .equal,
100 | toItem: nil,
101 | attribute: .notAnAttribute,
102 | multiplier: 1,
103 | constant: width))
104 | }
105 |
106 | func cd_centerHorizontally() {
107 | self.superview!.addConstraint(NSLayoutConstraint(item: self,
108 | attribute: .centerX,
109 | relatedBy: .equal,
110 | toItem: self.superview,
111 | attribute: .centerX,
112 | multiplier: 1,
113 | constant: 0))
114 | }
115 |
116 | func cd_centerVertically() {
117 | self.superview!.addConstraint(NSLayoutConstraint(item: self,
118 | attribute: .centerY,
119 | relatedBy: .equal,
120 | toItem: self.superview,
121 | attribute: .centerY,
122 | multiplier: 1,
123 | constant: 0))
124 | }
125 |
126 | func cd_place(below view: UIView, margin: CGFloat) {
127 | self.superview!.addConstraint(NSLayoutConstraint(item: self,
128 | attribute: .top,
129 | relatedBy: .equal,
130 | toItem: view,
131 | attribute: .bottom,
132 | multiplier: 1,
133 | constant: margin))
134 | }
135 |
136 | func cd_place(above view: UIView, margin: CGFloat) {
137 | self.superview!.addConstraint(NSLayoutConstraint(item: self,
138 | attribute: .bottom,
139 | relatedBy: .equal,
140 | toItem: view,
141 | attribute: .top,
142 | multiplier: 1,
143 | constant: margin))
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/index.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | [](https://github.com/Carthage/Carthage)
4 | [](http://cocoadocs.org/docsets/CDAlertView/)
5 | [](https://travis-ci.org/candostdagdeviren/CDAlertView/)
6 | [](https://developer.apple.com/swift)
7 | [](https://developer.apple.com/resources/)
8 | [](https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/master/LICENSE)
9 |
10 | CDAlertView is highly customizable alert popup written in Swift. Usage is similar to `UIAlertController`.
11 |
12 | ### Screenshots
13 |
14 | 
15 |
16 | ### Animations
17 |
18 | 
19 | 
20 | 
21 |
22 | ## Usage
23 |
24 | Basic usage without any buttons:
25 |
26 | ```swift
27 | CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .notification).show()
28 | ```
29 | **NOTE:** You can use it without buttons. Touch outside of the popup or move it will disappear it if there is no action button. If there is an action button, only pressing button will disappear it.
30 |
31 | To add new buttons:
32 | ```swift
33 | let alert = CDAlertView(title: "Awesome Title", message: "Are you in?!", type: .notification)
34 | let doneAction = CDAlertViewAction(title: "Sure! 💪")
35 | alert.add(action: doneAction)
36 | let nevermindAction = CDAlertViewAction(title: "Nevermind 😑")
37 | alert.add(action: nevermindAction)
38 | alert.show()
39 | ```
40 |
41 | To enable text field in popup:
42 | ```swift
43 | alert.isTextFieldHidden = false
44 | ```
45 |
46 | Custom view is also supported. If you want to use custom view, you are responsible for the height of custom view. Custom view is used in `UIStackView`.
47 | ```swift
48 | let myCustomView = UIVIew(frame: myFrame)
49 | // Don't forget to handle height of `myCustomView`
50 | alert.customView = myCustomView
51 | ```
52 |
53 | CDAlertView types:
54 |
55 | ```swift
56 | public enum CDAlertViewType {
57 | case error, warning, success, notification, alarm, noImage, custom(image:UIImage)
58 | }
59 | ```
60 |
61 | ## Initialization
62 |
63 | ### Advanced Alert Initialization
64 | To use it with your custom icon, initialize without type (or with .empty) and set your icon and background color:
65 |
66 | ```swift
67 | let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .custom(image: UIImage(named:"YourAwesomeImage")))
68 | alert.circleFillColor = UIColor.yourAmazingColor
69 | ```
70 |
71 | ### Hide Alert with your animation
72 | ```swift
73 | let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .success)
74 | alert.hideAnimations = { (center, transform, alpha) in
75 | transform = CGAffineTransform(scaleX: 3, y: 3)
76 | alpha = 0
77 | }
78 | alert.hideAnimationDuration = 0.88
79 | alert.show()
80 | ```
81 |
82 | ### Hide Alert with timer
83 | ```swift
84 | let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .success)
85 | alert.autoHideTime = 4.5 // This will hide alert box after 4.5 seconds
86 | ```
87 |
88 | ### List of Available CDAlertView Options
89 |
90 | `titleTextColor: UIColor` -> Sets title's text color
91 |
92 | `messageTextColor: UIColor` -> Sets message's text color
93 |
94 | `titleFont: UIFont` -> Sets title's font
95 |
96 | `messageFont: UIFont` -> Sets message's font
97 |
98 | `isHeaderIconFilled: Bool` -> Chooses filled icons instead of outline ones. Default is `false`.
99 |
100 | `alertBackgroundColor: UIColor` -> Sets popup's background color.
101 |
102 | `popupWidth: CGFloat` -> Width of the popup view
103 |
104 | `hasRoundedCorners: Bool` -> Apply rounded corners to alert view. Default is `true`.
105 |
106 | `hasShadow: Bool` -> Apply shadows around the popup. Defualt is `true`.
107 |
108 | `circleFillColor: UIColor` -> Sets background color of header icon. (Color of circle area)
109 |
110 | `isActionButtonsVertical: Bool` -> Alignes action buttons vertical. Default is `false`. Maximum number of horizontal buttons is 3.
111 |
112 | `hideAnimationDuration: TimeInterval` -> Sets the animation duration of hide animation
113 |
114 | `hideAnimations: CDAlertAnimationBlock` -> Sets the hiding animations depending on the `center`, `transform` and `alpha` values. You can create your animations by changing these values for alert popup.
115 |
116 | If you enabled text field with setting `isTextFieldHidden` property to `false`, following properties will be available also:
117 |
118 | `textFieldFont: UIFont` -> Font of textField's text
119 |
120 | `textFieldIsSecureTextEntry: Bool` -> Sets the `isSecureTextEntry` property of `UITextField`
121 |
122 | `textFieldReturnKeyType: UIReturnKeyType` -> Sets the `returnKeyType` property of `UITextField`
123 |
124 | `textFieldTextAlignment: NSTextAlignment` -> Sets the `textAlignment` property of `UITextField`. Default is `.left`.
125 |
126 | `textFieldPlaceholderText: String?` -> Sets the placeholder text for `UITextField`.
127 |
128 | `textFieldAutocapitalizationType: UITextAutocapitalizationType` -> Sets the `autocapitalizationType` property of `UITextField`. Default is `.none`.
129 |
130 | `textFieldBackgroundColor: UIColor` -> Sets `UITextField`'s background color.
131 |
132 | `textFieldTintColor: UIColor` -> Sets `UITextField`'s tint color.
133 |
134 | `textFieldText: String?` -> Sets & gets `UITextField`'s text.
135 |
136 | `textFieldHeight: CGFloat` -> Sets the height of `UITextField`.
137 |
138 | `textFieldDelegate: UITextViewDelegate?` -> Sets the delegate of `UITextField`. Default delegate is `CDAlertView`. If you overwrite this, you're responsible for resigning the `UITextField`.
139 |
140 | `autoHideTime: TimeInterval?` -> Sets the time interval for dismiss time. Default is `nil`.
141 |
142 | ### Advanced action initialization:
143 |
144 | `font`, `textColor`, `backgroundColor`, `handler` are all optional and has default parameter values. You can initilize with them or set them after initialization.
145 |
146 | ```swift
147 | let action = CDAlertViewAction(title: "Action Title", font: UIFont.yourCustomFont, textColor: UIColor.yourTextColor, backgroundColor: UIColor.yourBackgroundColor, handler: { action in })
148 | alertView.addAction(action)
149 | ```
150 |
151 | **NOTE:** Aligning buttons vertical and horizontal is possible. But using more than 3 buttons in horizontal placement is not possible.
152 |
153 | ### List of CDAlertViewAction Options
154 |
155 | `buttonTitle: String` -> Set's the action button title
156 |
157 | `buttonTextColor: UIColor` -> Sets the action button title color. Default value is RGB(27,169,225).
158 |
159 | `buttonFont: UIFont` -> Sets the action button title font. Default value is `UIFont.systemFont(ofSize: 17)`.
160 |
161 | `buttonBackgroundColor: UIColor` -> Sets the background color of action button. If not set, it uses `alertBackgroundColor` of CDAlertView.
162 |
163 | ### List of available methods
164 |
165 | `textFieldBecomeFirstResponder()` -> Calls the `becomeFirstResponder()` method of `textField` if `alert.isTextFieldHidden` set to `true`. Otherwise, does nothing.
166 |
167 | `textFieldResignFirstResponder()` -> Calls the `resignFirstResponder()` method of `textField` if `alert.isTextFieldHidden` set to `true`. Otherwise, does nothing.
168 |
169 | ## Example
170 |
171 | To run the example project, clone the repo, and run `pod install` from the Example directory first.
172 |
173 | ## Installation
174 |
175 | **This library supports Swift 4. Use `0.6.1` or older versions for Swift 3.1 support.**
176 |
177 | ### Using [CocoaPods](http://cocoapods.org)
178 |
179 | CDAlertView is available through CocoaPods. To install it, simply add the following line to your `Podfile`:
180 |
181 | ```ruby
182 | pod "CDAlertView"
183 | ```
184 |
185 | ### Using [Carthage](https://github.com/Carthage/Carthage)
186 |
187 | CDAlertView is available through Carthage. To install it, simply add the following line to your `Cartfile`:
188 |
189 | ```
190 | github "candostdagdeviren/CDAlertView"
191 | ```
192 |
193 | ## Requirements
194 |
195 | * Xcode 9
196 | * Swift 4
197 | * iOS 9.0+
198 |
199 | ### Icons
200 |
201 | Thanks to [Icons8](https://icons8.com/) for beautiful icons.
202 |
203 | ## License
204 |
205 | CDAlertView is available under the MIT license. See the LICENSE file for more info.
206 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | [](https://github.com/Carthage/Carthage)
4 | [](http://cocoadocs.org/docsets/CDAlertView/)
5 | [](https://travis-ci.org/candostdagdeviren/CDAlertView/)
6 | [](https://developer.apple.com/swift)
7 | [](https://developer.apple.com/resources/)
8 | [](https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/master/LICENSE)
9 |
10 | CDAlertView is highly customizable alert popup written in Swift. Usage is similar to `UIAlertController`.
11 |
12 | ### Screenshots
13 |
14 | 
15 |
16 | ### Animations
17 |
18 | 
19 | 
20 | 
21 |
22 | ## Usage
23 |
24 | Basic usage without any buttons:
25 |
26 | ```swift
27 | CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .notification).show()
28 | ```
29 | **NOTE:** You can use it without buttons. Touch outside of the popup or move it will disappear it if there is no action button. If there is an action button, only pressing button will disappear it.
30 |
31 | To add new buttons:
32 | ```swift
33 | let alert = CDAlertView(title: "Awesome Title", message: "Are you in?!", type: .notification)
34 | let doneAction = CDAlertViewAction(title: "Sure! 💪")
35 | alert.add(action: doneAction)
36 | let nevermindAction = CDAlertViewAction(title: "Nevermind 😑")
37 | alert.add(action: nevermindAction)
38 | alert.show()
39 | ```
40 |
41 | To enable text field in popup:
42 | ```swift
43 | alert.isTextFieldHidden = false
44 | ```
45 |
46 | Custom view is also supported. If you want to use custom view, you are responsible for the height of custom view. Custom view is used in `UIStackView`.
47 | ```swift
48 | let myCustomView = UIVIew(frame: myFrame)
49 | // Don't forget to handle height of `myCustomView`
50 | alert.customView = myCustomView
51 | ```
52 |
53 | CDAlertView types:
54 |
55 | ```swift
56 | public enum CDAlertViewType {
57 | case error, warning, success, notification, alarm, noImage, custom(image:UIImage)
58 | }
59 | ```
60 |
61 | ## Initialization
62 |
63 | ### Advanced Alert Initialization
64 | To use it with your custom icon, initialize without type (or with .empty) and set your icon and background color:
65 |
66 | ```swift
67 | let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .custom(image: UIImage(named:"YourAwesomeImage")))
68 | alert.circleFillColor = UIColor.yourAmazingColor
69 | ```
70 |
71 | ### Hide Alert with your animation
72 | ```swift
73 | let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .success)
74 | alert.hideAnimations = { (center, transform, alpha) in
75 | transform = CGAffineTransform(scaleX: 3, y: 3)
76 | alpha = 0
77 | }
78 | alert.hideAnimationDuration = 0.88
79 | alert.show()
80 | ```
81 |
82 | ### Hide Alert with timer
83 | ```swift
84 | let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .success)
85 | alert.autoHideTime = 4.5 // This will hide alert box after 4.5 seconds
86 | ```
87 |
88 | ### List of Available CDAlertView Options
89 |
90 | `titleTextColor: UIColor` -> Sets title's text color
91 |
92 | `messageTextColor: UIColor` -> Sets message's text color
93 |
94 | `titleFont: UIFont` -> Sets title's font
95 |
96 | `messageFont: UIFont` -> Sets message's font
97 |
98 | `isHeaderIconFilled: Bool` -> Chooses filled icons instead of outline ones. Default is `false`.
99 |
100 | `alertBackgroundColor: UIColor` -> Sets popup's background color.
101 |
102 | `popupWidth: CGFloat` -> Width of the popup view
103 |
104 | `hasRoundedCorners: Bool` -> Apply rounded corners to alert view. Default is `true`.
105 |
106 | `hasShadow: Bool` -> Apply shadows around the popup. Defualt is `true`.
107 |
108 | `circleFillColor: UIColor` -> Sets background color of header icon. (Color of circle area)
109 |
110 | `isActionButtonsVertical: Bool` -> Alignes action buttons vertical. Default is `false`. Maximum number of horizontal buttons is 3.
111 |
112 | `canHideWhenTapBack` -> Hide self when tapped backgroundView. Default is `false`.
113 |
114 | `hideAnimationDuration: TimeInterval` -> Sets the animation duration of hide animation
115 |
116 | `hideAnimations: CDAlertAnimationBlock` -> Sets the hiding animations depending on the `center`, `transform` and `alpha` values. You can create your animations by changing these values for alert popup.
117 |
118 | If you enabled text field with setting `isTextFieldHidden` property to `false`, following properties will be available also:
119 |
120 | `textFieldFont: UIFont` -> Font of textField's text
121 |
122 | `textFieldIsSecureTextEntry: Bool` -> Sets the `isSecureTextEntry` property of `UITextField`
123 |
124 | `textFieldReturnKeyType: UIReturnKeyType` -> Sets the `returnKeyType` property of `UITextField`
125 |
126 | `textFieldTextAlignment: NSTextAlignment` -> Sets the `textAlignment` property of `UITextField`. Default is `.left`.
127 |
128 | `textFieldPlaceholderText: String?` -> Sets the placeholder text for `UITextField`.
129 |
130 | `textFieldAutocapitalizationType: UITextAutocapitalizationType` -> Sets the `autocapitalizationType` property of `UITextField`. Default is `.none`.
131 |
132 | `textFieldBackgroundColor: UIColor` -> Sets `UITextField`'s background color.
133 |
134 | `textFieldTintColor: UIColor` -> Sets `UITextField`'s tint color.
135 |
136 | `textFieldText: String?` -> Sets & gets `UITextField`'s text.
137 |
138 | `textFieldHeight: CGFloat` -> Sets the height of `UITextField`.
139 |
140 | `textFieldDelegate: UITextViewDelegate?` -> Sets the delegate of `UITextField`. Default delegate is `CDAlertView`. If you overwrite this, you're responsible for resigning the `UITextField`.
141 |
142 | `autoHideTime: TimeInterval?` -> Sets the time interval for dismiss time. Default is `nil`.
143 |
144 | ### Advanced action initialization:
145 |
146 | `font`, `textColor`, `backgroundColor`, `handler` are all optional and has default parameter values. You can initilize with them or set them after initialization.
147 |
148 | ```swift
149 | let action = CDAlertViewAction(title: "Action Title", font: UIFont.yourCustomFont, textColor: UIColor.yourTextColor, backgroundColor: UIColor.yourBackgroundColor, handler: { action in })
150 | alertView.addAction(action)
151 | ```
152 |
153 | **NOTE:** Aligning buttons vertical and horizontal is possible. But using more than 3 buttons in horizontal placement is not possible.
154 |
155 | ### List of CDAlertViewAction Options
156 |
157 | `buttonTitle: String` -> Set's the action button title
158 |
159 | `buttonTextColor: UIColor` -> Sets the action button title color. Default value is RGB(27,169,225).
160 |
161 | `buttonFont: UIFont` -> Sets the action button title font. Default value is `UIFont.systemFont(ofSize: 17)`.
162 |
163 | `buttonBackgroundColor: UIColor` -> Sets the background color of action button. If not set, it uses `alertBackgroundColor` of CDAlertView.
164 |
165 | ### List of available methods
166 |
167 | `textFieldBecomeFirstResponder()` -> Calls the `becomeFirstResponder()` method of `textField` if `alert.isTextFieldHidden` set to `true`. Otherwise, does nothing.
168 |
169 | `textFieldResignFirstResponder()` -> Calls the `resignFirstResponder()` method of `textField` if `alert.isTextFieldHidden` set to `true`. Otherwise, does nothing.
170 |
171 | ## Example
172 |
173 | To run the example project, clone the repo, and run `pod install` from the Example directory first.
174 |
175 | ## Installation
176 |
177 | **This library supports Swift 5. Use `0.9.1` for Swift 4.2. Use `0.6.1` for Swift 3.1.**
178 |
179 | ### Using [CocoaPods](http://cocoapods.org)
180 |
181 | CDAlertView is available through CocoaPods. To install it, simply add the following line to your `Podfile`:
182 |
183 | ```ruby
184 | pod "CDAlertView"
185 | ```
186 |
187 | ### Using [Carthage](https://github.com/Carthage/Carthage)
188 |
189 | CDAlertView is available through Carthage. To install it, simply add the following line to your `Cartfile`:
190 |
191 | ```
192 | github "candostdagdeviren/CDAlertView"
193 | ```
194 |
195 | ## Requirements
196 |
197 | * Xcode 9
198 | * Swift 4
199 | * iOS 9.0+
200 |
201 | ### Icons
202 |
203 | Thanks to [Icons8](https://icons8.com/) for beautiful icons.
204 |
205 | ## License
206 |
207 | CDAlertView is available under the MIT license. See the LICENSE file for more info.
208 |
--------------------------------------------------------------------------------
/Example/CDAlertViewExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 49A1B2191DEDA5EB00DF4686 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A1B2181DEDA5EB00DF4686 /* AppDelegate.swift */; };
11 | 49A1B21B1DEDA5EB00DF4686 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A1B21A1DEDA5EB00DF4686 /* ViewController.swift */; };
12 | 49A1B21E1DEDA5EB00DF4686 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 49A1B21C1DEDA5EB00DF4686 /* Main.storyboard */; };
13 | 49A1B2201DEDA5EB00DF4686 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 49A1B21F1DEDA5EB00DF4686 /* Assets.xcassets */; };
14 | 49A1B2231DEDA5EB00DF4686 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 49A1B2211DEDA5EB00DF4686 /* LaunchScreen.storyboard */; };
15 | 6D3AEB5084C60E045E262A87 /* Pods_CDAlertViewExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26B27F39EA7DAE92814C869C /* Pods_CDAlertViewExample.framework */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXFileReference section */
19 | 0BBAC47961DDBE902E0783A7 /* Pods-CDAlertViewExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CDAlertViewExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-CDAlertViewExample/Pods-CDAlertViewExample.release.xcconfig"; sourceTree = ""; };
20 | 26B27F39EA7DAE92814C869C /* Pods_CDAlertViewExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CDAlertViewExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
21 | 49A1B2151DEDA5EB00DF4686 /* CDAlertViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CDAlertViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
22 | 49A1B2181DEDA5EB00DF4686 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
23 | 49A1B21A1DEDA5EB00DF4686 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
24 | 49A1B21D1DEDA5EB00DF4686 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
25 | 49A1B21F1DEDA5EB00DF4686 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
26 | 49A1B2221DEDA5EB00DF4686 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
27 | 49A1B2241DEDA5EB00DF4686 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
28 | C812B8CD3E2119CCA5D92B27 /* Pods-CDAlertViewExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CDAlertViewExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CDAlertViewExample/Pods-CDAlertViewExample.debug.xcconfig"; sourceTree = ""; };
29 | /* End PBXFileReference section */
30 |
31 | /* Begin PBXFrameworksBuildPhase section */
32 | 49A1B2121DEDA5EB00DF4686 /* Frameworks */ = {
33 | isa = PBXFrameworksBuildPhase;
34 | buildActionMask = 2147483647;
35 | files = (
36 | 6D3AEB5084C60E045E262A87 /* Pods_CDAlertViewExample.framework in Frameworks */,
37 | );
38 | runOnlyForDeploymentPostprocessing = 0;
39 | };
40 | /* End PBXFrameworksBuildPhase section */
41 |
42 | /* Begin PBXGroup section */
43 | 49A1B20C1DEDA5EB00DF4686 = {
44 | isa = PBXGroup;
45 | children = (
46 | 49A1B2171DEDA5EB00DF4686 /* CDAlertViewExample */,
47 | 49A1B2161DEDA5EB00DF4686 /* Products */,
48 | 6A24226019CE7BFB6B777655 /* Pods */,
49 | 6195E2E8ED2F3D761D7EB306 /* Frameworks */,
50 | );
51 | sourceTree = "";
52 | };
53 | 49A1B2161DEDA5EB00DF4686 /* Products */ = {
54 | isa = PBXGroup;
55 | children = (
56 | 49A1B2151DEDA5EB00DF4686 /* CDAlertViewExample.app */,
57 | );
58 | name = Products;
59 | sourceTree = "";
60 | };
61 | 49A1B2171DEDA5EB00DF4686 /* CDAlertViewExample */ = {
62 | isa = PBXGroup;
63 | children = (
64 | 49A1B2181DEDA5EB00DF4686 /* AppDelegate.swift */,
65 | 49A1B21A1DEDA5EB00DF4686 /* ViewController.swift */,
66 | 49A1B21C1DEDA5EB00DF4686 /* Main.storyboard */,
67 | 49A1B21F1DEDA5EB00DF4686 /* Assets.xcassets */,
68 | 49A1B2211DEDA5EB00DF4686 /* LaunchScreen.storyboard */,
69 | 49A1B2241DEDA5EB00DF4686 /* Info.plist */,
70 | );
71 | path = CDAlertViewExample;
72 | sourceTree = "";
73 | };
74 | 6195E2E8ED2F3D761D7EB306 /* Frameworks */ = {
75 | isa = PBXGroup;
76 | children = (
77 | 26B27F39EA7DAE92814C869C /* Pods_CDAlertViewExample.framework */,
78 | );
79 | name = Frameworks;
80 | sourceTree = "";
81 | };
82 | 6A24226019CE7BFB6B777655 /* Pods */ = {
83 | isa = PBXGroup;
84 | children = (
85 | C812B8CD3E2119CCA5D92B27 /* Pods-CDAlertViewExample.debug.xcconfig */,
86 | 0BBAC47961DDBE902E0783A7 /* Pods-CDAlertViewExample.release.xcconfig */,
87 | );
88 | name = Pods;
89 | sourceTree = "";
90 | };
91 | /* End PBXGroup section */
92 |
93 | /* Begin PBXNativeTarget section */
94 | 49A1B2141DEDA5EB00DF4686 /* CDAlertViewExample */ = {
95 | isa = PBXNativeTarget;
96 | buildConfigurationList = 49A1B2271DEDA5EB00DF4686 /* Build configuration list for PBXNativeTarget "CDAlertViewExample" */;
97 | buildPhases = (
98 | 19C8DB7BCFF3AAA5060DA14A /* [CP] Check Pods Manifest.lock */,
99 | 49A1B2111DEDA5EB00DF4686 /* Sources */,
100 | 49A1B2121DEDA5EB00DF4686 /* Frameworks */,
101 | 49A1B2131DEDA5EB00DF4686 /* Resources */,
102 | D561740633B64D2FBA5F8C1A /* [CP] Embed Pods Frameworks */,
103 | );
104 | buildRules = (
105 | );
106 | dependencies = (
107 | );
108 | name = CDAlertViewExample;
109 | productName = CDAlertViewExample;
110 | productReference = 49A1B2151DEDA5EB00DF4686 /* CDAlertViewExample.app */;
111 | productType = "com.apple.product-type.application";
112 | };
113 | /* End PBXNativeTarget section */
114 |
115 | /* Begin PBXProject section */
116 | 49A1B20D1DEDA5EB00DF4686 /* Project object */ = {
117 | isa = PBXProject;
118 | attributes = {
119 | LastSwiftUpdateCheck = 0810;
120 | LastUpgradeCheck = 1220;
121 | ORGANIZATIONNAME = "Candost Dagdeviren";
122 | TargetAttributes = {
123 | 49A1B2141DEDA5EB00DF4686 = {
124 | CreatedOnToolsVersion = 8.1;
125 | ProvisioningStyle = Automatic;
126 | };
127 | };
128 | };
129 | buildConfigurationList = 49A1B2101DEDA5EB00DF4686 /* Build configuration list for PBXProject "CDAlertViewExample" */;
130 | compatibilityVersion = "Xcode 3.2";
131 | developmentRegion = English;
132 | hasScannedForEncodings = 0;
133 | knownRegions = (
134 | English,
135 | en,
136 | Base,
137 | );
138 | mainGroup = 49A1B20C1DEDA5EB00DF4686;
139 | productRefGroup = 49A1B2161DEDA5EB00DF4686 /* Products */;
140 | projectDirPath = "";
141 | projectRoot = "";
142 | targets = (
143 | 49A1B2141DEDA5EB00DF4686 /* CDAlertViewExample */,
144 | );
145 | };
146 | /* End PBXProject section */
147 |
148 | /* Begin PBXResourcesBuildPhase section */
149 | 49A1B2131DEDA5EB00DF4686 /* Resources */ = {
150 | isa = PBXResourcesBuildPhase;
151 | buildActionMask = 2147483647;
152 | files = (
153 | 49A1B2231DEDA5EB00DF4686 /* LaunchScreen.storyboard in Resources */,
154 | 49A1B2201DEDA5EB00DF4686 /* Assets.xcassets in Resources */,
155 | 49A1B21E1DEDA5EB00DF4686 /* Main.storyboard in Resources */,
156 | );
157 | runOnlyForDeploymentPostprocessing = 0;
158 | };
159 | /* End PBXResourcesBuildPhase section */
160 |
161 | /* Begin PBXShellScriptBuildPhase section */
162 | 19C8DB7BCFF3AAA5060DA14A /* [CP] Check Pods Manifest.lock */ = {
163 | isa = PBXShellScriptBuildPhase;
164 | buildActionMask = 2147483647;
165 | files = (
166 | );
167 | inputPaths = (
168 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
169 | "${PODS_ROOT}/Manifest.lock",
170 | );
171 | name = "[CP] Check Pods Manifest.lock";
172 | outputPaths = (
173 | "$(DERIVED_FILE_DIR)/Pods-CDAlertViewExample-checkManifestLockResult.txt",
174 | );
175 | runOnlyForDeploymentPostprocessing = 0;
176 | shellPath = /bin/sh;
177 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
178 | showEnvVarsInLog = 0;
179 | };
180 | D561740633B64D2FBA5F8C1A /* [CP] Embed Pods Frameworks */ = {
181 | isa = PBXShellScriptBuildPhase;
182 | buildActionMask = 2147483647;
183 | files = (
184 | );
185 | inputPaths = (
186 | "${PODS_ROOT}/Target Support Files/Pods-CDAlertViewExample/Pods-CDAlertViewExample-frameworks.sh",
187 | "${BUILT_PRODUCTS_DIR}/CDAlertView/CDAlertView.framework",
188 | );
189 | name = "[CP] Embed Pods Frameworks";
190 | outputPaths = (
191 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CDAlertView.framework",
192 | );
193 | runOnlyForDeploymentPostprocessing = 0;
194 | shellPath = /bin/sh;
195 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CDAlertViewExample/Pods-CDAlertViewExample-frameworks.sh\"\n";
196 | showEnvVarsInLog = 0;
197 | };
198 | /* End PBXShellScriptBuildPhase section */
199 |
200 | /* Begin PBXSourcesBuildPhase section */
201 | 49A1B2111DEDA5EB00DF4686 /* Sources */ = {
202 | isa = PBXSourcesBuildPhase;
203 | buildActionMask = 2147483647;
204 | files = (
205 | 49A1B21B1DEDA5EB00DF4686 /* ViewController.swift in Sources */,
206 | 49A1B2191DEDA5EB00DF4686 /* AppDelegate.swift in Sources */,
207 | );
208 | runOnlyForDeploymentPostprocessing = 0;
209 | };
210 | /* End PBXSourcesBuildPhase section */
211 |
212 | /* Begin PBXVariantGroup section */
213 | 49A1B21C1DEDA5EB00DF4686 /* Main.storyboard */ = {
214 | isa = PBXVariantGroup;
215 | children = (
216 | 49A1B21D1DEDA5EB00DF4686 /* Base */,
217 | );
218 | name = Main.storyboard;
219 | sourceTree = "";
220 | };
221 | 49A1B2211DEDA5EB00DF4686 /* LaunchScreen.storyboard */ = {
222 | isa = PBXVariantGroup;
223 | children = (
224 | 49A1B2221DEDA5EB00DF4686 /* Base */,
225 | );
226 | name = LaunchScreen.storyboard;
227 | sourceTree = "";
228 | };
229 | /* End PBXVariantGroup section */
230 |
231 | /* Begin XCBuildConfiguration section */
232 | 49A1B2251DEDA5EB00DF4686 /* Debug */ = {
233 | isa = XCBuildConfiguration;
234 | buildSettings = {
235 | ALWAYS_SEARCH_USER_PATHS = NO;
236 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
237 | CLANG_ANALYZER_NONNULL = YES;
238 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
239 | CLANG_CXX_LIBRARY = "libc++";
240 | CLANG_ENABLE_MODULES = YES;
241 | CLANG_ENABLE_OBJC_ARC = YES;
242 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
243 | CLANG_WARN_BOOL_CONVERSION = YES;
244 | CLANG_WARN_COMMA = YES;
245 | CLANG_WARN_CONSTANT_CONVERSION = YES;
246 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
247 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
248 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
249 | CLANG_WARN_EMPTY_BODY = YES;
250 | CLANG_WARN_ENUM_CONVERSION = YES;
251 | CLANG_WARN_INFINITE_RECURSION = YES;
252 | CLANG_WARN_INT_CONVERSION = YES;
253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
257 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
258 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
259 | CLANG_WARN_STRICT_PROTOTYPES = YES;
260 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
261 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
262 | CLANG_WARN_UNREACHABLE_CODE = YES;
263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
264 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
265 | COPY_PHASE_STRIP = NO;
266 | DEBUG_INFORMATION_FORMAT = dwarf;
267 | ENABLE_STRICT_OBJC_MSGSEND = YES;
268 | ENABLE_TESTABILITY = YES;
269 | GCC_C_LANGUAGE_STANDARD = gnu99;
270 | GCC_DYNAMIC_NO_PIC = NO;
271 | GCC_NO_COMMON_BLOCKS = YES;
272 | GCC_OPTIMIZATION_LEVEL = 0;
273 | GCC_PREPROCESSOR_DEFINITIONS = (
274 | "DEBUG=1",
275 | "$(inherited)",
276 | );
277 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
278 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
279 | GCC_WARN_UNDECLARED_SELECTOR = YES;
280 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
281 | GCC_WARN_UNUSED_FUNCTION = YES;
282 | GCC_WARN_UNUSED_VARIABLE = YES;
283 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
284 | MTL_ENABLE_DEBUG_INFO = YES;
285 | ONLY_ACTIVE_ARCH = YES;
286 | SDKROOT = iphoneos;
287 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
288 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
289 | SWIFT_VERSION = 5.0;
290 | };
291 | name = Debug;
292 | };
293 | 49A1B2261DEDA5EB00DF4686 /* Release */ = {
294 | isa = XCBuildConfiguration;
295 | buildSettings = {
296 | ALWAYS_SEARCH_USER_PATHS = NO;
297 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
298 | CLANG_ANALYZER_NONNULL = YES;
299 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
300 | CLANG_CXX_LIBRARY = "libc++";
301 | CLANG_ENABLE_MODULES = YES;
302 | CLANG_ENABLE_OBJC_ARC = YES;
303 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
304 | CLANG_WARN_BOOL_CONVERSION = YES;
305 | CLANG_WARN_COMMA = YES;
306 | CLANG_WARN_CONSTANT_CONVERSION = YES;
307 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
308 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
309 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
310 | CLANG_WARN_EMPTY_BODY = YES;
311 | CLANG_WARN_ENUM_CONVERSION = YES;
312 | CLANG_WARN_INFINITE_RECURSION = YES;
313 | CLANG_WARN_INT_CONVERSION = YES;
314 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
315 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
316 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
317 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
318 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
319 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
320 | CLANG_WARN_STRICT_PROTOTYPES = YES;
321 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
322 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
323 | CLANG_WARN_UNREACHABLE_CODE = YES;
324 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
325 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
326 | COPY_PHASE_STRIP = NO;
327 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
328 | ENABLE_NS_ASSERTIONS = NO;
329 | ENABLE_STRICT_OBJC_MSGSEND = YES;
330 | GCC_C_LANGUAGE_STANDARD = gnu99;
331 | GCC_NO_COMMON_BLOCKS = YES;
332 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
333 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
334 | GCC_WARN_UNDECLARED_SELECTOR = YES;
335 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
336 | GCC_WARN_UNUSED_FUNCTION = YES;
337 | GCC_WARN_UNUSED_VARIABLE = YES;
338 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
339 | MTL_ENABLE_DEBUG_INFO = NO;
340 | SDKROOT = iphoneos;
341 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
342 | SWIFT_VERSION = 5.0;
343 | VALIDATE_PRODUCT = YES;
344 | };
345 | name = Release;
346 | };
347 | 49A1B2281DEDA5EB00DF4686 /* Debug */ = {
348 | isa = XCBuildConfiguration;
349 | baseConfigurationReference = C812B8CD3E2119CCA5D92B27 /* Pods-CDAlertViewExample.debug.xcconfig */;
350 | buildSettings = {
351 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
352 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
353 | INFOPLIST_FILE = CDAlertViewExample/Info.plist;
354 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
355 | PRODUCT_BUNDLE_IDENTIFIER = com.candostdagdeviren.CDAlertViewExample;
356 | PRODUCT_NAME = "$(TARGET_NAME)";
357 | SWIFT_VERSION = 5.0;
358 | };
359 | name = Debug;
360 | };
361 | 49A1B2291DEDA5EB00DF4686 /* Release */ = {
362 | isa = XCBuildConfiguration;
363 | baseConfigurationReference = 0BBAC47961DDBE902E0783A7 /* Pods-CDAlertViewExample.release.xcconfig */;
364 | buildSettings = {
365 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
366 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
367 | INFOPLIST_FILE = CDAlertViewExample/Info.plist;
368 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
369 | PRODUCT_BUNDLE_IDENTIFIER = com.candostdagdeviren.CDAlertViewExample;
370 | PRODUCT_NAME = "$(TARGET_NAME)";
371 | SWIFT_VERSION = 5.0;
372 | };
373 | name = Release;
374 | };
375 | /* End XCBuildConfiguration section */
376 |
377 | /* Begin XCConfigurationList section */
378 | 49A1B2101DEDA5EB00DF4686 /* Build configuration list for PBXProject "CDAlertViewExample" */ = {
379 | isa = XCConfigurationList;
380 | buildConfigurations = (
381 | 49A1B2251DEDA5EB00DF4686 /* Debug */,
382 | 49A1B2261DEDA5EB00DF4686 /* Release */,
383 | );
384 | defaultConfigurationIsVisible = 0;
385 | defaultConfigurationName = Release;
386 | };
387 | 49A1B2271DEDA5EB00DF4686 /* Build configuration list for PBXNativeTarget "CDAlertViewExample" */ = {
388 | isa = XCConfigurationList;
389 | buildConfigurations = (
390 | 49A1B2281DEDA5EB00DF4686 /* Debug */,
391 | 49A1B2291DEDA5EB00DF4686 /* Release */,
392 | );
393 | defaultConfigurationIsVisible = 0;
394 | defaultConfigurationName = Release;
395 | };
396 | /* End XCConfigurationList section */
397 | };
398 | rootObject = 49A1B20D1DEDA5EB00DF4686 /* Project object */;
399 | }
400 |
--------------------------------------------------------------------------------
/CDAlertView/Classes/CDAlertView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CDAlertView.swift
3 | // CDAlertView
4 | //
5 | // Created by Candost Dagdeviren on 10/30/2016.
6 | // Copyright (c) 2016 Candost Dagdeviren. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | fileprivate protocol CDAlertViewActionDelegate: class {
12 | func didTap(action: CDAlertViewAction)
13 | }
14 |
15 | open class CDAlertViewAction: NSObject {
16 | public var buttonTitle: String?
17 | public var buttonTextColor: UIColor?
18 | public var buttonFont: UIFont?
19 | public var buttonBackgroundColor: UIColor?
20 |
21 | fileprivate weak var delegate: CDAlertViewActionDelegate?
22 |
23 | private var handlerBlock: ((CDAlertViewAction) -> Swift.Bool)?
24 |
25 | public convenience init(title: String?,
26 | font: UIFont? = UIFont.systemFont(ofSize: 17),
27 | textColor: UIColor? = UIColor(red: 27 / 255, green: 169 / 255, blue: 225 / 255, alpha: 1),
28 | backgroundColor: UIColor? = nil,
29 | handler: ((CDAlertViewAction) -> Swift.Bool)? = nil) {
30 | self.init()
31 | buttonTitle = title
32 | buttonTextColor = textColor
33 | buttonFont = font
34 | buttonBackgroundColor = backgroundColor
35 | handlerBlock = handler
36 | }
37 |
38 | @objc func didTap() {
39 | guard let handler = handlerBlock else {
40 | self.delegate?.didTap(action: self)
41 | return
42 | }
43 | if handler(self) == false {
44 | return
45 | }
46 | self.delegate?.didTap(action: self)
47 | }
48 | }
49 |
50 | open class CDAlertView: UIView {
51 |
52 | static let defaultComponentsColor: UIColor = UIColor(red: 50 / 255,
53 | green: 51 / 255,
54 | blue: 53 / 255,
55 | alpha: 1)
56 |
57 | public var actionSeparatorColor: UIColor = defaultComponentsColor.withAlphaComponent(0.12)
58 | public var titleTextColor: UIColor = defaultComponentsColor
59 | public var messageTextColor: UIColor = defaultComponentsColor
60 | public var textFieldTextColor: UIColor = defaultComponentsColor
61 |
62 | public var titleFont: UIFont = UIFont.boldSystemFont(ofSize: 17) {
63 | didSet {
64 | titleLabel.font = titleFont
65 | }
66 | }
67 |
68 | public var messageFont: UIFont = UIFont.systemFont(ofSize: 13) {
69 | didSet {
70 | messageLabel.font = messageFont
71 | }
72 | }
73 |
74 | public var textFieldFont: UIFont = UIFont.systemFont(ofSize: 15) {
75 | didSet {
76 | textField.font = textFieldFont
77 | }
78 | }
79 |
80 | public var textFieldReturnKeyType: UIReturnKeyType = .default {
81 | didSet {
82 | textField.returnKeyType = textFieldReturnKeyType
83 | }
84 | }
85 |
86 | public var textFieldIsSecureTextEntry: Bool = false {
87 | didSet {
88 | textField.isSecureTextEntry = textFieldIsSecureTextEntry
89 | }
90 | }
91 |
92 | public var textFieldTextAlignment: NSTextAlignment = .left {
93 | didSet {
94 | textField.textAlignment = textFieldTextAlignment
95 | }
96 | }
97 |
98 | public var textFieldPlaceholderText: String? = nil {
99 | didSet {
100 | textField.placeholder = textFieldPlaceholderText
101 | }
102 | }
103 |
104 | public var isTextFieldHidden: Bool = true {
105 | didSet {
106 | textField.isHidden = isTextFieldHidden
107 |
108 | if !isTextFieldHidden {
109 | NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
110 | NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
111 | }
112 | }
113 | }
114 |
115 | public var textFieldKeyboardType: UIKeyboardType = .`default` {
116 | didSet {
117 | textField.keyboardType = textFieldKeyboardType
118 | }
119 | }
120 |
121 | public var textFieldAutocapitalizationType: UITextAutocapitalizationType = .none {
122 | didSet {
123 | textField.autocapitalizationType = textFieldAutocapitalizationType
124 | }
125 | }
126 |
127 | public var textFieldAutocorrectionType: UITextAutocorrectionType = .default {
128 | didSet {
129 | textField.autocorrectionType = textFieldAutocorrectionType
130 | }
131 | }
132 |
133 | public var textFieldBackgroundColor: UIColor = UIColor.white.withAlphaComponent(0.9) {
134 | didSet {
135 | textField.backgroundColor = textFieldBackgroundColor
136 | }
137 | }
138 |
139 | public var textFieldTintColor: UIColor = UIColor.white.withAlphaComponent(0.9) {
140 | didSet {
141 | textField.tintColor = textFieldTintColor
142 | }
143 | }
144 |
145 | public var textFieldText: String? {
146 | get {
147 | return textField.text
148 | }
149 | set {
150 | textField.text = newValue
151 | }
152 | }
153 |
154 | public weak var textFieldDelegate: UITextFieldDelegate? {
155 | didSet {
156 | textField.delegate = textFieldDelegate
157 | }
158 | }
159 |
160 | public var hasRoundCorners = true
161 |
162 | public var customView: UIView?
163 |
164 | public var canHideWhenTapBack = false
165 |
166 | public var hideAnimations: CDAlertAnimationBlock?
167 |
168 | public var hideAnimationDuration: TimeInterval = 0.5
169 |
170 | public var autoHideTime: TimeInterval? = nil
171 |
172 | public var textFieldHeight: CGFloat = 35.0
173 |
174 | public var isActionButtonsVertical: Bool = false
175 |
176 | public var hasShadow: Bool = true
177 |
178 | public var isHeaderIconFilled: Bool = false
179 |
180 | public var alertBackgroundColor: UIColor = UIColor.white.withAlphaComponent(0.9)
181 |
182 | public var circleFillColor: UIColor? = nil
183 |
184 | public var popupWidth: CGFloat = 255.0
185 |
186 | public typealias CDAlertAnimationBlock = ((_ center: inout CGPoint, _ transform: inout CGAffineTransform, _ alpha: inout CGFloat) -> Void)?
187 |
188 | fileprivate var popupCenterYPositionBeforeKeyboard: CGFloat?
189 |
190 | fileprivate var popupView: UIView = UIView(frame: .zero)
191 |
192 | fileprivate var popupCenter: CGPoint {
193 | get {
194 | return popupView.center
195 | }
196 | set {
197 | popupView.center = newValue
198 | }
199 | }
200 |
201 | fileprivate var popupTransform: CGAffineTransform {
202 | get {
203 | return popupView.transform
204 | }
205 | set {
206 | popupView.transform = newValue
207 | }
208 | }
209 |
210 | fileprivate var popupAlpha: CGFloat {
211 | get {
212 | return popupView.alpha
213 | }
214 | set {
215 | popupView.alpha = newValue
216 | }
217 | }
218 |
219 | private struct CDAlertViewConstants {
220 | let headerHeight: CGFloat = 56
221 | let headerHeightWithoutCircle: CGFloat = 30
222 | let activeVelocity: CGFloat = 150
223 | let minVelocity: CGFloat = 300
224 | let separatorThickness: CGFloat = 1.0 / UIScreen.main.scale
225 | }
226 |
227 | private var buttonsHeight: CGFloat {
228 | get {
229 | return self.actions.count > 0 ? 44.0 : 0
230 | }
231 | }
232 |
233 | private var popupViewInitialFrame: CGRect!
234 | private let constants = CDAlertViewConstants()
235 | private var backgroundView: UIView = UIView(frame: .zero)
236 | private var coverView: UIView = UIView(frame: .zero)
237 | private var completionBlock: ((CDAlertView) -> Swift.Void)?
238 | private var contentStackView: UIStackView = UIStackView(frame: .zero)
239 | private var buttonContainer: UIStackView = UIStackView(frame: .zero)
240 | private var headerView: CDAlertHeaderView!
241 | private var buttonView: UIView = UIView(frame: .zero)
242 | private var titleLabel: UILabel = UILabel(frame: .zero)
243 | private var messageLabel: UILabel = UILabel(frame: .zero)
244 | private var textField: UITextField = UITextField(frame: .zero)
245 | private var type: CDAlertViewType!
246 | private var isKeyboardVisible: Bool = false
247 | weak private var hideTimer: Timer!
248 | public var headerHeight: CGFloat = CDAlertViewConstants().headerHeight
249 |
250 | private lazy var actions: [CDAlertViewAction] = [CDAlertViewAction]()
251 |
252 | public convenience init(title: String?,
253 | message: String?,
254 | type: CDAlertViewType? = nil) {
255 | self.init(frame: .zero)
256 |
257 | self.backgroundColor = CDAlertView.defaultComponentsColor.withAlphaComponent(0.4)
258 |
259 | if let t = title {
260 | titleLabel.text = t
261 | }
262 |
263 | if let m = message {
264 | messageLabel.text = m
265 | }
266 |
267 | self.type = type
268 | }
269 |
270 | override open func layoutSubviews() {
271 | super.layoutSubviews()
272 |
273 | if hasShadow {
274 | let path = UIBezierPath()
275 | path.move(to: CGPoint(x: 0.0, y: popupView.bounds.size.height))
276 | path.addLine(to: CGPoint(x: 0, y: headerHeight))
277 | path.addLine(to: CGPoint(x: popupView.bounds.size.width,
278 | y: CGFloat(headerHeight - 5)))
279 | path.addLine(to: CGPoint(x: popupView.bounds.size.width,
280 | y: popupView.bounds.size.height))
281 | path.close()
282 |
283 | popupView.setShadow(withPath: path)
284 | }
285 | }
286 |
287 | public func show(_ completion: ((CDAlertView) -> Void)? = nil) {
288 | UIApplication.shared.keyWindow?.addSubview(self)
289 |
290 | cd_alignToParent(with: 0)
291 | addSubview(backgroundView)
292 | backgroundView.cd_alignToParent(with: 0)
293 |
294 | if !isActionButtonsVertical && actions.count > 3 {
295 | debugPrint("CDAlertView: You can't use more than 3 actions in horizontal mode. If you need more than 3 buttons, consider using vertical alignment for buttons. Setting vertical alignments for buttons is available via isActionButtonsVertical property of AlertView")
296 | actions.removeSubrange(3..,
372 | with event: UIEvent?) {
373 | if actions.count == 0 || canHideWhenTapBack {
374 | touches.forEach { (touch) in
375 | if touch.view == self.backgroundView {
376 | self.hide(animations: self.hideAnimations, isPopupAnimated: true)
377 | }
378 | }
379 | }
380 | }
381 |
382 | @objc func keyboardWillShow(_ notification: Notification) {
383 | guard !isKeyboardVisible,
384 | let userInfo = notification.userInfo,
385 | let keyboardSize = (userInfo[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue,
386 | let coverViewWindowCoordinates = coverView.superview?.convert(CGPoint(x: 0, y: coverView.frame.maxY), to: nil),
387 | coverViewWindowCoordinates.y > (keyboardSize.minY - keyboardSize.height) else {
388 | return
389 | }
390 |
391 | popupCenterYPositionBeforeKeyboard = popupView.center.y
392 |
393 | let difference = coverViewWindowCoordinates.y - (keyboardSize.minY - keyboardSize.height)
394 | popupView.center.y -= difference
395 |
396 | isKeyboardVisible = true
397 | }
398 |
399 | @objc func keyboardWillHide(_ notification: Notification) {
400 | guard let initialY = self.popupCenterYPositionBeforeKeyboard else {
401 | return
402 | }
403 |
404 | UIView.animate(withDuration: 0.5, delay: 0.2, options: .allowAnimatedContent, animations: { [weak self] in
405 | guard let strongSelf = self else { return }
406 | strongSelf.popupView.center.y = initialY
407 | })
408 |
409 | self.isKeyboardVisible = false
410 | }
411 |
412 | @objc func popupMoved(recognizer: UIPanGestureRecognizer) {
413 | let location = recognizer.location(in: backgroundView)
414 | UIView.animate(withDuration: 0, animations: {
415 | self.popupView.center = location
416 | })
417 |
418 | switch recognizer.state {
419 | case .ended:
420 | let location = recognizer.location(in: backgroundView)
421 | let origin = CGPoint(x: backgroundView.center.x - popupViewInitialFrame.size.width / 2,
422 | y: backgroundView.center.y - popupViewInitialFrame.size.height / 2)
423 | let velocity = recognizer.velocity(in: backgroundView)
424 | let hasMovedOutside = !CGRect(origin: origin, size: popupViewInitialFrame.size).contains(location) ||
425 | velocity.x > constants.activeVelocity ||
426 | velocity.y > constants.activeVelocity
427 |
428 | if hasMovedOutside {
429 | UIView.animate(withDuration: 1, animations: {
430 | self.popupView.center = self.calculatePopupViewOffScreenCenter(from: velocity)
431 | self.hide(animations: self.hideAnimations, isPopupAnimated: false)
432 | })
433 | } else {
434 | UIView.animate(withDuration: 0.5, animations: {
435 | self.popupView.center = self.backgroundView.center
436 | })
437 | }
438 |
439 | case .cancelled:
440 | UIView.animate(withDuration: 0, animations: {
441 | self.popupView.center = self.backgroundView.center
442 | })
443 |
444 | default:
445 | break
446 | }
447 | }
448 |
449 | // MARK: Private
450 |
451 | private func calculatePopupViewOffScreenCenter(from velocity: CGPoint) -> CGPoint {
452 | var velocityX = velocity.x
453 | var velocityY = velocity.y
454 | var offScreenCenter = popupView.center
455 |
456 | velocityX = velocityX >= 0 ?
457 | (velocityX < constants.minVelocity ? 0 : velocityX):
458 | (velocityX > -constants.minVelocity ? 0 : velocityX)
459 |
460 | velocityY = velocityY >= 0 ?
461 | (velocityY < constants.minVelocity ? constants.minVelocity : velocityY):
462 | (velocityY > -constants.minVelocity ? -constants.minVelocity : velocityY)
463 |
464 | offScreenCenter.x += velocityX
465 | offScreenCenter.y += velocityY
466 |
467 | return offScreenCenter
468 | }
469 |
470 | private func roundBottomOfCoverView() {
471 | guard hasRoundCorners == true else {return}
472 | let roundCornersPath = UIBezierPath(roundedRect: CGRect(x: 0.0,
473 | y: 0.0,
474 | width: popupWidth,
475 | height: coverView.frame.size.height),
476 | byRoundingCorners: [.bottomLeft, .bottomRight],
477 | cornerRadii: CGSize(width: 8.0,
478 | height: 8.0))
479 | let roundLayer = CAShapeLayer()
480 | roundLayer.path = roundCornersPath.cgPath
481 | coverView.layer.mask = roundLayer
482 | }
483 |
484 | private func createViews() {
485 | popupView.backgroundColor = UIColor.clear
486 | backgroundView.addSubview(popupView)
487 |
488 | createHeaderView()
489 | createButtonContainer()
490 | createStackView()
491 | createTitleLabel()
492 | createMessageLabel()
493 |
494 | if let customView = customView {
495 | createCustomView(customView)
496 | }
497 |
498 | if !isTextFieldHidden {
499 | createTextField()
500 | }
501 |
502 | popupView.translatesAutoresizingMaskIntoConstraints = false
503 | popupView.cd_centerHorizontally()
504 | popupView.cd_centerVertically()
505 | popupView.cd_setWidth(popupWidth)
506 | popupView.cd_setMaxHeight(430)
507 | popupView.sizeToFit()
508 | popupView.layoutIfNeeded()
509 |
510 | if actions.count == 0 {
511 | roundBottomOfCoverView()
512 |
513 | let gestureRecognizer = UIPanGestureRecognizer(target: self,
514 | action: #selector(popupMoved(recognizer:)))
515 | popupView.addGestureRecognizer(gestureRecognizer)
516 | }
517 | }
518 |
519 | private func createHeaderView() {
520 | headerView = CDAlertHeaderView(type: type, isIconFilled: isHeaderIconFilled)
521 | headerView.backgroundColor = UIColor.clear
522 | headerView.hasRoundCorners = hasRoundCorners
523 | headerView.alertBackgroundColor = alertBackgroundColor
524 | if type.hasImage() == true {
525 | headerView.circleFillColor = circleFillColor
526 | headerView.hasShadow = hasShadow
527 | }
528 | else {
529 | headerView.hasShadow = false
530 | headerView.circleFillColor = .clear
531 | headerHeight = constants.headerHeightWithoutCircle
532 | }
533 | popupView.addSubview(headerView)
534 | headerView.translatesAutoresizingMaskIntoConstraints = false
535 | headerView.cd_alignTopToParent(with: 0)
536 | headerView.cd_alignLeftToParent(with: 0)
537 | headerView.cd_alignRightToParent(with: 0)
538 | headerView.cd_setHeight(headerHeight)
539 | }
540 |
541 | private func createButtonContainer() {
542 | var height = buttonsHeight + constants.separatorThickness
543 | buttonView.backgroundColor = UIColor.clear
544 | buttonView.layer.masksToBounds = true
545 | if isActionButtonsVertical {
546 | height = (buttonsHeight + constants.separatorThickness) * CGFloat(actions.count)
547 | }
548 | let roundCornersPath = UIBezierPath(roundedRect: CGRect(x: 0.0,
549 | y: 0.0,
550 | width: popupWidth,
551 | height: height),
552 | byRoundingCorners: [.bottomLeft, .bottomRight],
553 | cornerRadii: CGSize(width: 8.0, height: 8.0))
554 | if hasRoundCorners == true {
555 | let roundLayer = CAShapeLayer()
556 | roundLayer.path = roundCornersPath.cgPath
557 | buttonView.layer.mask = roundLayer
558 | }
559 | popupView.addSubview(buttonView)
560 | buttonView.translatesAutoresizingMaskIntoConstraints = false
561 | buttonView.cd_alignBottomToParent(with: 0)
562 | buttonView.cd_alignLeftToParent(with: 0)
563 | buttonView.cd_alignRightToParent(with: 0)
564 | if actions.count == 0 {
565 | buttonView.cd_setHeight(0)
566 | } else {
567 | let backgroundColoredView = UIView(frame: .zero)
568 | backgroundColoredView.backgroundColor = actionSeparatorColor
569 | buttonView.addSubview(backgroundColoredView)
570 | backgroundColoredView.cd_alignToParent(with: 0)
571 |
572 | buttonContainer.spacing = constants.separatorThickness
573 | if isActionButtonsVertical {
574 | buttonContainer.axis = .vertical
575 | } else {
576 | buttonContainer.axis = .horizontal
577 | }
578 | buttonView.cd_setHeight(height)
579 | buttonContainer.translatesAutoresizingMaskIntoConstraints = false
580 | backgroundColoredView.addSubview(buttonContainer)
581 | buttonContainer.cd_alignTopToParent(with: constants.separatorThickness)
582 | buttonContainer.cd_alignBottomToParent(with: 0)
583 | buttonContainer.cd_alignLeftToParent(with: 0)
584 | buttonContainer.cd_alignRightToParent(with: 0)
585 | }
586 | }
587 |
588 | private func createStackView() {
589 | coverView.backgroundColor = alertBackgroundColor
590 | popupView.addSubview(coverView)
591 | coverView.translatesAutoresizingMaskIntoConstraints = false
592 | coverView.cd_alignLeftToParent(with: 0)
593 | coverView.cd_alignRightToParent(with: 0)
594 | coverView.cd_place(below: headerView, margin: 0)
595 | coverView.cd_place(above: buttonView, margin: 0)
596 | contentStackView.distribution = .equalSpacing
597 | contentStackView.axis = .vertical
598 | contentStackView.spacing = 8
599 | coverView.addSubview(contentStackView)
600 | contentStackView.translatesAutoresizingMaskIntoConstraints = false
601 | contentStackView.cd_alignTopToParent(with: 0)
602 | contentStackView.cd_alignBottomToParent(with: 16)
603 | contentStackView.cd_alignRightToParent(with: 16)
604 | contentStackView.cd_alignLeftToParent(with: 16)
605 | }
606 |
607 | private func createTitleLabel() {
608 | titleLabel.numberOfLines = 0
609 | titleLabel.textAlignment = .center
610 | titleLabel.cd_setMaxHeight(100)
611 | titleLabel.textColor = titleTextColor
612 | titleLabel.font = titleFont
613 | contentStackView.addArrangedSubview(titleLabel)
614 | }
615 |
616 | private func createMessageLabel() {
617 | messageLabel.numberOfLines = 0
618 | messageLabel.textAlignment = .center
619 | messageLabel.textColor = messageTextColor
620 | messageLabel.cd_setMaxHeight(290)
621 | messageLabel.font = messageFont
622 | contentStackView.addArrangedSubview(messageLabel)
623 | }
624 |
625 | private func createCustomView(_ custom: UIView) {
626 | custom.clipsToBounds = true
627 | contentStackView.addArrangedSubview(custom)
628 | }
629 |
630 | private func createTextField() {
631 | if textFieldDelegate == nil {
632 | textField.delegate = self
633 | }
634 |
635 | textField.font = textFieldFont
636 | textField.textColor = textFieldTextColor
637 | textField.clearButtonMode = .whileEditing
638 | textField.isSecureTextEntry = textFieldIsSecureTextEntry
639 | textField.returnKeyType = textFieldReturnKeyType
640 | textField.textAlignment = textFieldTextAlignment
641 | textField.borderStyle = .roundedRect
642 | textField.isHidden = isTextFieldHidden
643 | textField.placeholder = textFieldPlaceholderText
644 | textField.autocapitalizationType = textFieldAutocapitalizationType
645 | textField.cd_setHeight(textFieldHeight)
646 | contentStackView.addArrangedSubview(textField)
647 | }
648 |
649 | private func loadActionButtons() {
650 | guard actions.count != 0 else { return }
651 | for action in buttonContainer.arrangedSubviews {
652 | buttonContainer.removeArrangedSubview(action)
653 | }
654 |
655 | for action in actions {
656 | action.delegate = self
657 | let button = UIButton(type: .system)
658 | if let bc = action.buttonBackgroundColor {
659 | button.backgroundColor = bc
660 | } else {
661 | button.backgroundColor = alertBackgroundColor
662 | }
663 |
664 | button.setTitle(action.buttonTitle, for: .normal)
665 | button.setTitleColor(action.buttonTextColor, for: .normal)
666 | button.titleLabel?.font = action.buttonFont
667 | button.titleLabel?.numberOfLines = 0
668 | button.titleLabel?.textAlignment = .center
669 | button.titleLabel?.lineBreakMode = .byWordWrapping
670 | button.addTarget(action, action: #selector(action.didTap), for: .touchUpInside)
671 | buttonContainer.addArrangedSubview(button)
672 | button.translatesAutoresizingMaskIntoConstraints = false
673 | if isActionButtonsVertical {
674 | button.cd_setWidth(buttonContainer.frame.size.width)
675 | } else {
676 | button.cd_setWidth((buttonContainer.frame.size.width - CGFloat(actions.count - 1) * constants.separatorThickness) / CGFloat(actions.count))
677 | }
678 |
679 | button.cd_setHeight(CGFloat(buttonsHeight))
680 | }
681 | }
682 | }
683 |
684 | extension CDAlertView: CDAlertViewActionDelegate {
685 | internal func didTap(action: CDAlertViewAction) {
686 | self.hide(animations: self.hideAnimations, isPopupAnimated: true)
687 | }
688 | }
689 |
690 | extension CDAlertView: UITextFieldDelegate {
691 | public func textFieldShouldReturn(_ textField: UITextField) -> Bool {
692 | textField.resignFirstResponder()
693 | return true
694 | }
695 | }
696 |
697 | extension UIView {
698 | public func setShadow(withPath path: UIBezierPath) {
699 | layer.shadowColor = UIColor.black.cgColor
700 | layer.shadowOpacity = 0.2
701 | layer.shadowRadius = 4
702 | layer.shadowOffset = CGSize.zero
703 | layer.masksToBounds = false
704 | layer.shadowPath = path.cgPath
705 | }
706 | }
707 |
--------------------------------------------------------------------------------
/CDAlertView.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 493E78D620AA3DFD009BE1D5 /* warningFilled@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78BE20AA3DFC009BE1D5 /* warningFilled@3x.png */; };
11 | 493E78D720AA3DFD009BE1D5 /* notificationFilled@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78BF20AA3DFC009BE1D5 /* notificationFilled@2x.png */; };
12 | 493E78D820AA3DFD009BE1D5 /* error@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C020AA3DFC009BE1D5 /* error@3x.png */; };
13 | 493E78D920AA3DFD009BE1D5 /* notificationOutline@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C120AA3DFC009BE1D5 /* notificationOutline@1x.png */; };
14 | 493E78DA20AA3DFD009BE1D5 /* warningOutline@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C220AA3DFC009BE1D5 /* warningOutline@2x.png */; };
15 | 493E78DB20AA3DFD009BE1D5 /* warningOutline@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C320AA3DFC009BE1D5 /* warningOutline@3x.png */; };
16 | 493E78DC20AA3DFD009BE1D5 /* error@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C420AA3DFC009BE1D5 /* error@2x.png */; };
17 | 493E78DD20AA3DFD009BE1D5 /* notificationFilled@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C520AA3DFC009BE1D5 /* notificationFilled@3x.png */; };
18 | 493E78DE20AA3DFD009BE1D5 /* warningFilled@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C620AA3DFC009BE1D5 /* warningFilled@2x.png */; };
19 | 493E78DF20AA3DFD009BE1D5 /* alarmOutline@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C720AA3DFC009BE1D5 /* alarmOutline@2x.png */; };
20 | 493E78E020AA3DFD009BE1D5 /* alarmFilled@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C820AA3DFC009BE1D5 /* alarmFilled@2x.png */; };
21 | 493E78E120AA3DFD009BE1D5 /* alarmFilled@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78C920AA3DFC009BE1D5 /* alarmFilled@3x.png */; };
22 | 493E78E220AA3DFD009BE1D5 /* check@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78CA20AA3DFC009BE1D5 /* check@1x.png */; };
23 | 493E78E320AA3DFD009BE1D5 /* alarmOutline@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78CB20AA3DFC009BE1D5 /* alarmOutline@3x.png */; };
24 | 493E78E420AA3DFD009BE1D5 /* check@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78CC20AA3DFC009BE1D5 /* check@2x.png */; };
25 | 493E78E520AA3DFD009BE1D5 /* check@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78CD20AA3DFC009BE1D5 /* check@3x.png */; };
26 | 493E78E620AA3DFD009BE1D5 /* alarmFilled@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78CE20AA3DFC009BE1D5 /* alarmFilled@1x.png */; };
27 | 493E78E720AA3DFD009BE1D5 /* alarmOutline@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78CF20AA3DFC009BE1D5 /* alarmOutline@1x.png */; };
28 | 493E78E820AA3DFD009BE1D5 /* notificationOutline@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78D020AA3DFC009BE1D5 /* notificationOutline@3x.png */; };
29 | 493E78E920AA3DFD009BE1D5 /* error@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78D120AA3DFC009BE1D5 /* error@1x.png */; };
30 | 493E78EA20AA3DFD009BE1D5 /* warningFilled@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78D220AA3DFC009BE1D5 /* warningFilled@1x.png */; };
31 | 493E78EB20AA3DFD009BE1D5 /* warningOutline@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78D320AA3DFC009BE1D5 /* warningOutline@1x.png */; };
32 | 493E78EC20AA3DFD009BE1D5 /* notificationFilled@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78D420AA3DFC009BE1D5 /* notificationFilled@1x.png */; };
33 | 493E78ED20AA3DFD009BE1D5 /* notificationOutline@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 493E78D520AA3DFC009BE1D5 /* notificationOutline@2x.png */; };
34 | 49A1B1F01DEDA4A300DF4686 /* CDAlertView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49A1B1E61DEDA4A300DF4686 /* CDAlertView.framework */; };
35 | 49A1B1F51DEDA4A300DF4686 /* CDAlertViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A1B1F41DEDA4A300DF4686 /* CDAlertViewTests.swift */; };
36 | 49A1B1F71DEDA4A300DF4686 /* CDAlertView.h in Headers */ = {isa = PBXBuildFile; fileRef = 49A1B1E91DEDA4A300DF4686 /* CDAlertView.h */; settings = {ATTRIBUTES = (Public, ); }; };
37 | 49A1B2081DEDA51800DF4686 /* CDAlertHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A1B2041DEDA51800DF4686 /* CDAlertHeaderView.swift */; };
38 | 49A1B2091DEDA51800DF4686 /* CDAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A1B2051DEDA51800DF4686 /* CDAlertView.swift */; };
39 | 49A1B20A1DEDA51800DF4686 /* ImageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A1B2061DEDA51800DF4686 /* ImageHelper.swift */; };
40 | 49A1B20B1DEDA51800DF4686 /* LayoutConstraintsExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A1B2071DEDA51800DF4686 /* LayoutConstraintsExtension.swift */; };
41 | EA67FC392578DC0100B5E533 /* CDAlertViewType.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA67FC382578DC0100B5E533 /* CDAlertViewType.swift */; };
42 | /* End PBXBuildFile section */
43 |
44 | /* Begin PBXContainerItemProxy section */
45 | 49A1B1F11DEDA4A300DF4686 /* PBXContainerItemProxy */ = {
46 | isa = PBXContainerItemProxy;
47 | containerPortal = 49A1B1DD1DEDA4A300DF4686 /* Project object */;
48 | proxyType = 1;
49 | remoteGlobalIDString = 49A1B1E51DEDA4A300DF4686;
50 | remoteInfo = CDAlertView;
51 | };
52 | /* End PBXContainerItemProxy section */
53 |
54 | /* Begin PBXFileReference section */
55 | 493E78BE20AA3DFC009BE1D5 /* warningFilled@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "warningFilled@3x.png"; sourceTree = ""; };
56 | 493E78BF20AA3DFC009BE1D5 /* notificationFilled@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notificationFilled@2x.png"; sourceTree = ""; };
57 | 493E78C020AA3DFC009BE1D5 /* error@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "error@3x.png"; sourceTree = ""; };
58 | 493E78C120AA3DFC009BE1D5 /* notificationOutline@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notificationOutline@1x.png"; sourceTree = ""; };
59 | 493E78C220AA3DFC009BE1D5 /* warningOutline@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "warningOutline@2x.png"; sourceTree = ""; };
60 | 493E78C320AA3DFC009BE1D5 /* warningOutline@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "warningOutline@3x.png"; sourceTree = ""; };
61 | 493E78C420AA3DFC009BE1D5 /* error@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "error@2x.png"; sourceTree = ""; };
62 | 493E78C520AA3DFC009BE1D5 /* notificationFilled@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notificationFilled@3x.png"; sourceTree = ""; };
63 | 493E78C620AA3DFC009BE1D5 /* warningFilled@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "warningFilled@2x.png"; sourceTree = ""; };
64 | 493E78C720AA3DFC009BE1D5 /* alarmOutline@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "alarmOutline@2x.png"; sourceTree = ""; };
65 | 493E78C820AA3DFC009BE1D5 /* alarmFilled@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "alarmFilled@2x.png"; sourceTree = ""; };
66 | 493E78C920AA3DFC009BE1D5 /* alarmFilled@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "alarmFilled@3x.png"; sourceTree = ""; };
67 | 493E78CA20AA3DFC009BE1D5 /* check@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "check@1x.png"; sourceTree = ""; };
68 | 493E78CB20AA3DFC009BE1D5 /* alarmOutline@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "alarmOutline@3x.png"; sourceTree = ""; };
69 | 493E78CC20AA3DFC009BE1D5 /* check@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "check@2x.png"; sourceTree = ""; };
70 | 493E78CD20AA3DFC009BE1D5 /* check@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "check@3x.png"; sourceTree = ""; };
71 | 493E78CE20AA3DFC009BE1D5 /* alarmFilled@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "alarmFilled@1x.png"; sourceTree = ""; };
72 | 493E78CF20AA3DFC009BE1D5 /* alarmOutline@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "alarmOutline@1x.png"; sourceTree = ""; };
73 | 493E78D020AA3DFC009BE1D5 /* notificationOutline@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notificationOutline@3x.png"; sourceTree = ""; };
74 | 493E78D120AA3DFC009BE1D5 /* error@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "error@1x.png"; sourceTree = ""; };
75 | 493E78D220AA3DFC009BE1D5 /* warningFilled@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "warningFilled@1x.png"; sourceTree = ""; };
76 | 493E78D320AA3DFC009BE1D5 /* warningOutline@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "warningOutline@1x.png"; sourceTree = ""; };
77 | 493E78D420AA3DFC009BE1D5 /* notificationFilled@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notificationFilled@1x.png"; sourceTree = ""; };
78 | 493E78D520AA3DFC009BE1D5 /* notificationOutline@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "notificationOutline@2x.png"; sourceTree = ""; };
79 | 49A1B1E61DEDA4A300DF4686 /* CDAlertView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CDAlertView.framework; sourceTree = BUILT_PRODUCTS_DIR; };
80 | 49A1B1E91DEDA4A300DF4686 /* CDAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDAlertView.h; sourceTree = ""; };
81 | 49A1B1EA1DEDA4A300DF4686 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
82 | 49A1B1EF1DEDA4A300DF4686 /* CDAlertViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDAlertViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
83 | 49A1B1F41DEDA4A300DF4686 /* CDAlertViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CDAlertViewTests.swift; sourceTree = ""; };
84 | 49A1B1F61DEDA4A300DF4686 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
85 | 49A1B2041DEDA51800DF4686 /* CDAlertHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CDAlertHeaderView.swift; sourceTree = ""; };
86 | 49A1B2051DEDA51800DF4686 /* CDAlertView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CDAlertView.swift; sourceTree = ""; };
87 | 49A1B2061DEDA51800DF4686 /* ImageHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageHelper.swift; sourceTree = ""; };
88 | 49A1B2071DEDA51800DF4686 /* LayoutConstraintsExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutConstraintsExtension.swift; sourceTree = ""; };
89 | EA67FC382578DC0100B5E533 /* CDAlertViewType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CDAlertViewType.swift; sourceTree = ""; };
90 | /* End PBXFileReference section */
91 |
92 | /* Begin PBXFrameworksBuildPhase section */
93 | 49A1B1E21DEDA4A300DF4686 /* Frameworks */ = {
94 | isa = PBXFrameworksBuildPhase;
95 | buildActionMask = 2147483647;
96 | files = (
97 | );
98 | runOnlyForDeploymentPostprocessing = 0;
99 | };
100 | 49A1B1EC1DEDA4A300DF4686 /* Frameworks */ = {
101 | isa = PBXFrameworksBuildPhase;
102 | buildActionMask = 2147483647;
103 | files = (
104 | 49A1B1F01DEDA4A300DF4686 /* CDAlertView.framework in Frameworks */,
105 | );
106 | runOnlyForDeploymentPostprocessing = 0;
107 | };
108 | /* End PBXFrameworksBuildPhase section */
109 |
110 | /* Begin PBXGroup section */
111 | 493E78BC20AA3DFC009BE1D5 /* Resources */ = {
112 | isa = PBXGroup;
113 | children = (
114 | 493E78BD20AA3DFC009BE1D5 /* Assets */,
115 | );
116 | path = Resources;
117 | sourceTree = "";
118 | };
119 | 493E78BD20AA3DFC009BE1D5 /* Assets */ = {
120 | isa = PBXGroup;
121 | children = (
122 | 493E78BE20AA3DFC009BE1D5 /* warningFilled@3x.png */,
123 | 493E78BF20AA3DFC009BE1D5 /* notificationFilled@2x.png */,
124 | 493E78C020AA3DFC009BE1D5 /* error@3x.png */,
125 | 493E78C120AA3DFC009BE1D5 /* notificationOutline@1x.png */,
126 | 493E78C220AA3DFC009BE1D5 /* warningOutline@2x.png */,
127 | 493E78C320AA3DFC009BE1D5 /* warningOutline@3x.png */,
128 | 493E78C420AA3DFC009BE1D5 /* error@2x.png */,
129 | 493E78C520AA3DFC009BE1D5 /* notificationFilled@3x.png */,
130 | 493E78C620AA3DFC009BE1D5 /* warningFilled@2x.png */,
131 | 493E78C720AA3DFC009BE1D5 /* alarmOutline@2x.png */,
132 | 493E78C820AA3DFC009BE1D5 /* alarmFilled@2x.png */,
133 | 493E78C920AA3DFC009BE1D5 /* alarmFilled@3x.png */,
134 | 493E78CA20AA3DFC009BE1D5 /* check@1x.png */,
135 | 493E78CB20AA3DFC009BE1D5 /* alarmOutline@3x.png */,
136 | 493E78CC20AA3DFC009BE1D5 /* check@2x.png */,
137 | 493E78CD20AA3DFC009BE1D5 /* check@3x.png */,
138 | 493E78CE20AA3DFC009BE1D5 /* alarmFilled@1x.png */,
139 | 493E78CF20AA3DFC009BE1D5 /* alarmOutline@1x.png */,
140 | 493E78D020AA3DFC009BE1D5 /* notificationOutline@3x.png */,
141 | 493E78D120AA3DFC009BE1D5 /* error@1x.png */,
142 | 493E78D220AA3DFC009BE1D5 /* warningFilled@1x.png */,
143 | 493E78D320AA3DFC009BE1D5 /* warningOutline@1x.png */,
144 | 493E78D420AA3DFC009BE1D5 /* notificationFilled@1x.png */,
145 | 493E78D520AA3DFC009BE1D5 /* notificationOutline@2x.png */,
146 | );
147 | path = Assets;
148 | sourceTree = "";
149 | };
150 | 49A1B1DC1DEDA4A300DF4686 = {
151 | isa = PBXGroup;
152 | children = (
153 | 49A1B1E81DEDA4A300DF4686 /* CDAlertView */,
154 | 49A1B1F31DEDA4A300DF4686 /* CDAlertViewTests */,
155 | 49A1B1E71DEDA4A300DF4686 /* Products */,
156 | );
157 | sourceTree = "";
158 | };
159 | 49A1B1E71DEDA4A300DF4686 /* Products */ = {
160 | isa = PBXGroup;
161 | children = (
162 | 49A1B1E61DEDA4A300DF4686 /* CDAlertView.framework */,
163 | 49A1B1EF1DEDA4A300DF4686 /* CDAlertViewTests.xctest */,
164 | );
165 | name = Products;
166 | sourceTree = "";
167 | };
168 | 49A1B1E81DEDA4A300DF4686 /* CDAlertView */ = {
169 | isa = PBXGroup;
170 | children = (
171 | 493E78BC20AA3DFC009BE1D5 /* Resources */,
172 | 49A1B2001DEDA4BA00DF4686 /* Classes */,
173 | 49A1B1E91DEDA4A300DF4686 /* CDAlertView.h */,
174 | 49A1B1EA1DEDA4A300DF4686 /* Info.plist */,
175 | );
176 | path = CDAlertView;
177 | sourceTree = "";
178 | };
179 | 49A1B1F31DEDA4A300DF4686 /* CDAlertViewTests */ = {
180 | isa = PBXGroup;
181 | children = (
182 | 49A1B1F41DEDA4A300DF4686 /* CDAlertViewTests.swift */,
183 | 49A1B1F61DEDA4A300DF4686 /* Info.plist */,
184 | );
185 | path = CDAlertViewTests;
186 | sourceTree = "";
187 | };
188 | 49A1B2001DEDA4BA00DF4686 /* Classes */ = {
189 | isa = PBXGroup;
190 | children = (
191 | 49A1B2041DEDA51800DF4686 /* CDAlertHeaderView.swift */,
192 | 49A1B2051DEDA51800DF4686 /* CDAlertView.swift */,
193 | EA67FC382578DC0100B5E533 /* CDAlertViewType.swift */,
194 | 49A1B2061DEDA51800DF4686 /* ImageHelper.swift */,
195 | 49A1B2071DEDA51800DF4686 /* LayoutConstraintsExtension.swift */,
196 | );
197 | path = Classes;
198 | sourceTree = "";
199 | };
200 | /* End PBXGroup section */
201 |
202 | /* Begin PBXHeadersBuildPhase section */
203 | 49A1B1E31DEDA4A300DF4686 /* Headers */ = {
204 | isa = PBXHeadersBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 49A1B1F71DEDA4A300DF4686 /* CDAlertView.h in Headers */,
208 | );
209 | runOnlyForDeploymentPostprocessing = 0;
210 | };
211 | /* End PBXHeadersBuildPhase section */
212 |
213 | /* Begin PBXNativeTarget section */
214 | 49A1B1E51DEDA4A300DF4686 /* CDAlertView */ = {
215 | isa = PBXNativeTarget;
216 | buildConfigurationList = 49A1B1FA1DEDA4A300DF4686 /* Build configuration list for PBXNativeTarget "CDAlertView" */;
217 | buildPhases = (
218 | 49A1B1E11DEDA4A300DF4686 /* Sources */,
219 | 49A1B1E21DEDA4A300DF4686 /* Frameworks */,
220 | 49A1B1E31DEDA4A300DF4686 /* Headers */,
221 | 49A1B1E41DEDA4A300DF4686 /* Resources */,
222 | );
223 | buildRules = (
224 | );
225 | dependencies = (
226 | );
227 | name = CDAlertView;
228 | productName = CDAlertView;
229 | productReference = 49A1B1E61DEDA4A300DF4686 /* CDAlertView.framework */;
230 | productType = "com.apple.product-type.framework";
231 | };
232 | 49A1B1EE1DEDA4A300DF4686 /* CDAlertViewTests */ = {
233 | isa = PBXNativeTarget;
234 | buildConfigurationList = 49A1B1FD1DEDA4A300DF4686 /* Build configuration list for PBXNativeTarget "CDAlertViewTests" */;
235 | buildPhases = (
236 | 49A1B1EB1DEDA4A300DF4686 /* Sources */,
237 | 49A1B1EC1DEDA4A300DF4686 /* Frameworks */,
238 | 49A1B1ED1DEDA4A300DF4686 /* Resources */,
239 | );
240 | buildRules = (
241 | );
242 | dependencies = (
243 | 49A1B1F21DEDA4A300DF4686 /* PBXTargetDependency */,
244 | );
245 | name = CDAlertViewTests;
246 | productName = CDAlertViewTests;
247 | productReference = 49A1B1EF1DEDA4A300DF4686 /* CDAlertViewTests.xctest */;
248 | productType = "com.apple.product-type.bundle.unit-test";
249 | };
250 | /* End PBXNativeTarget section */
251 |
252 | /* Begin PBXProject section */
253 | 49A1B1DD1DEDA4A300DF4686 /* Project object */ = {
254 | isa = PBXProject;
255 | attributes = {
256 | LastSwiftUpdateCheck = 0810;
257 | LastUpgradeCheck = 1020;
258 | ORGANIZATIONNAME = "Candost Dagdeviren";
259 | TargetAttributes = {
260 | 49A1B1E51DEDA4A300DF4686 = {
261 | CreatedOnToolsVersion = 8.1;
262 | LastSwiftMigration = 1020;
263 | ProvisioningStyle = Automatic;
264 | };
265 | 49A1B1EE1DEDA4A300DF4686 = {
266 | CreatedOnToolsVersion = 8.1;
267 | LastSwiftMigration = 1020;
268 | ProvisioningStyle = Automatic;
269 | };
270 | };
271 | };
272 | buildConfigurationList = 49A1B1E01DEDA4A300DF4686 /* Build configuration list for PBXProject "CDAlertView" */;
273 | compatibilityVersion = "Xcode 3.2";
274 | developmentRegion = English;
275 | hasScannedForEncodings = 0;
276 | knownRegions = (
277 | English,
278 | en,
279 | );
280 | mainGroup = 49A1B1DC1DEDA4A300DF4686;
281 | productRefGroup = 49A1B1E71DEDA4A300DF4686 /* Products */;
282 | projectDirPath = "";
283 | projectRoot = "";
284 | targets = (
285 | 49A1B1E51DEDA4A300DF4686 /* CDAlertView */,
286 | 49A1B1EE1DEDA4A300DF4686 /* CDAlertViewTests */,
287 | );
288 | };
289 | /* End PBXProject section */
290 |
291 | /* Begin PBXResourcesBuildPhase section */
292 | 49A1B1E41DEDA4A300DF4686 /* Resources */ = {
293 | isa = PBXResourcesBuildPhase;
294 | buildActionMask = 2147483647;
295 | files = (
296 | 493E78E220AA3DFD009BE1D5 /* check@1x.png in Resources */,
297 | 493E78EA20AA3DFD009BE1D5 /* warningFilled@1x.png in Resources */,
298 | 493E78EC20AA3DFD009BE1D5 /* notificationFilled@1x.png in Resources */,
299 | 493E78D820AA3DFD009BE1D5 /* error@3x.png in Resources */,
300 | 493E78E020AA3DFD009BE1D5 /* alarmFilled@2x.png in Resources */,
301 | 493E78DE20AA3DFD009BE1D5 /* warningFilled@2x.png in Resources */,
302 | 493E78E820AA3DFD009BE1D5 /* notificationOutline@3x.png in Resources */,
303 | 493E78E320AA3DFD009BE1D5 /* alarmOutline@3x.png in Resources */,
304 | 493E78E920AA3DFD009BE1D5 /* error@1x.png in Resources */,
305 | 493E78E420AA3DFD009BE1D5 /* check@2x.png in Resources */,
306 | 493E78DB20AA3DFD009BE1D5 /* warningOutline@3x.png in Resources */,
307 | 493E78D920AA3DFD009BE1D5 /* notificationOutline@1x.png in Resources */,
308 | 493E78E520AA3DFD009BE1D5 /* check@3x.png in Resources */,
309 | 493E78E120AA3DFD009BE1D5 /* alarmFilled@3x.png in Resources */,
310 | 493E78ED20AA3DFD009BE1D5 /* notificationOutline@2x.png in Resources */,
311 | 493E78D620AA3DFD009BE1D5 /* warningFilled@3x.png in Resources */,
312 | 493E78DF20AA3DFD009BE1D5 /* alarmOutline@2x.png in Resources */,
313 | 493E78DA20AA3DFD009BE1D5 /* warningOutline@2x.png in Resources */,
314 | 493E78E620AA3DFD009BE1D5 /* alarmFilled@1x.png in Resources */,
315 | 493E78D720AA3DFD009BE1D5 /* notificationFilled@2x.png in Resources */,
316 | 493E78DD20AA3DFD009BE1D5 /* notificationFilled@3x.png in Resources */,
317 | 493E78E720AA3DFD009BE1D5 /* alarmOutline@1x.png in Resources */,
318 | 493E78DC20AA3DFD009BE1D5 /* error@2x.png in Resources */,
319 | 493E78EB20AA3DFD009BE1D5 /* warningOutline@1x.png in Resources */,
320 | );
321 | runOnlyForDeploymentPostprocessing = 0;
322 | };
323 | 49A1B1ED1DEDA4A300DF4686 /* Resources */ = {
324 | isa = PBXResourcesBuildPhase;
325 | buildActionMask = 2147483647;
326 | files = (
327 | );
328 | runOnlyForDeploymentPostprocessing = 0;
329 | };
330 | /* End PBXResourcesBuildPhase section */
331 |
332 | /* Begin PBXSourcesBuildPhase section */
333 | 49A1B1E11DEDA4A300DF4686 /* Sources */ = {
334 | isa = PBXSourcesBuildPhase;
335 | buildActionMask = 2147483647;
336 | files = (
337 | 49A1B20B1DEDA51800DF4686 /* LayoutConstraintsExtension.swift in Sources */,
338 | EA67FC392578DC0100B5E533 /* CDAlertViewType.swift in Sources */,
339 | 49A1B2091DEDA51800DF4686 /* CDAlertView.swift in Sources */,
340 | 49A1B2081DEDA51800DF4686 /* CDAlertHeaderView.swift in Sources */,
341 | 49A1B20A1DEDA51800DF4686 /* ImageHelper.swift in Sources */,
342 | );
343 | runOnlyForDeploymentPostprocessing = 0;
344 | };
345 | 49A1B1EB1DEDA4A300DF4686 /* Sources */ = {
346 | isa = PBXSourcesBuildPhase;
347 | buildActionMask = 2147483647;
348 | files = (
349 | 49A1B1F51DEDA4A300DF4686 /* CDAlertViewTests.swift in Sources */,
350 | );
351 | runOnlyForDeploymentPostprocessing = 0;
352 | };
353 | /* End PBXSourcesBuildPhase section */
354 |
355 | /* Begin PBXTargetDependency section */
356 | 49A1B1F21DEDA4A300DF4686 /* PBXTargetDependency */ = {
357 | isa = PBXTargetDependency;
358 | target = 49A1B1E51DEDA4A300DF4686 /* CDAlertView */;
359 | targetProxy = 49A1B1F11DEDA4A300DF4686 /* PBXContainerItemProxy */;
360 | };
361 | /* End PBXTargetDependency section */
362 |
363 | /* Begin XCBuildConfiguration section */
364 | 49A1B1F81DEDA4A300DF4686 /* Debug */ = {
365 | isa = XCBuildConfiguration;
366 | buildSettings = {
367 | ALWAYS_SEARCH_USER_PATHS = NO;
368 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
369 | CLANG_ANALYZER_NONNULL = YES;
370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
371 | CLANG_CXX_LIBRARY = "libc++";
372 | CLANG_ENABLE_MODULES = YES;
373 | CLANG_ENABLE_OBJC_ARC = YES;
374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
375 | CLANG_WARN_BOOL_CONVERSION = YES;
376 | CLANG_WARN_COMMA = YES;
377 | CLANG_WARN_CONSTANT_CONVERSION = YES;
378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
380 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
381 | CLANG_WARN_EMPTY_BODY = YES;
382 | CLANG_WARN_ENUM_CONVERSION = YES;
383 | CLANG_WARN_INFINITE_RECURSION = YES;
384 | CLANG_WARN_INT_CONVERSION = YES;
385 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
386 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
387 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
388 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
389 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
390 | CLANG_WARN_STRICT_PROTOTYPES = YES;
391 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
392 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
393 | CLANG_WARN_UNREACHABLE_CODE = YES;
394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
396 | COPY_PHASE_STRIP = NO;
397 | CURRENT_PROJECT_VERSION = 1;
398 | DEBUG_INFORMATION_FORMAT = dwarf;
399 | ENABLE_STRICT_OBJC_MSGSEND = YES;
400 | ENABLE_TESTABILITY = YES;
401 | GCC_C_LANGUAGE_STANDARD = gnu99;
402 | GCC_DYNAMIC_NO_PIC = NO;
403 | GCC_NO_COMMON_BLOCKS = YES;
404 | GCC_OPTIMIZATION_LEVEL = 0;
405 | GCC_PREPROCESSOR_DEFINITIONS = (
406 | "DEBUG=1",
407 | "$(inherited)",
408 | );
409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
411 | GCC_WARN_UNDECLARED_SELECTOR = YES;
412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
413 | GCC_WARN_UNUSED_FUNCTION = YES;
414 | GCC_WARN_UNUSED_VARIABLE = YES;
415 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
416 | MTL_ENABLE_DEBUG_INFO = YES;
417 | ONLY_ACTIVE_ARCH = YES;
418 | SDKROOT = iphoneos;
419 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
420 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
421 | SWIFT_VERSION = 4.2;
422 | TARGETED_DEVICE_FAMILY = "1,2";
423 | VERSIONING_SYSTEM = "apple-generic";
424 | VERSION_INFO_PREFIX = "";
425 | };
426 | name = Debug;
427 | };
428 | 49A1B1F91DEDA4A300DF4686 /* Release */ = {
429 | isa = XCBuildConfiguration;
430 | buildSettings = {
431 | ALWAYS_SEARCH_USER_PATHS = NO;
432 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
433 | CLANG_ANALYZER_NONNULL = YES;
434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
435 | CLANG_CXX_LIBRARY = "libc++";
436 | CLANG_ENABLE_MODULES = YES;
437 | CLANG_ENABLE_OBJC_ARC = YES;
438 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
439 | CLANG_WARN_BOOL_CONVERSION = YES;
440 | CLANG_WARN_COMMA = YES;
441 | CLANG_WARN_CONSTANT_CONVERSION = YES;
442 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
443 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
444 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
445 | CLANG_WARN_EMPTY_BODY = YES;
446 | CLANG_WARN_ENUM_CONVERSION = YES;
447 | CLANG_WARN_INFINITE_RECURSION = YES;
448 | CLANG_WARN_INT_CONVERSION = YES;
449 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
450 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
451 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
452 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
453 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
454 | CLANG_WARN_STRICT_PROTOTYPES = YES;
455 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
456 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
457 | CLANG_WARN_UNREACHABLE_CODE = YES;
458 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
459 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
460 | COPY_PHASE_STRIP = NO;
461 | CURRENT_PROJECT_VERSION = 1;
462 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
463 | ENABLE_NS_ASSERTIONS = NO;
464 | ENABLE_STRICT_OBJC_MSGSEND = YES;
465 | GCC_C_LANGUAGE_STANDARD = gnu99;
466 | GCC_NO_COMMON_BLOCKS = YES;
467 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
468 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
469 | GCC_WARN_UNDECLARED_SELECTOR = YES;
470 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
471 | GCC_WARN_UNUSED_FUNCTION = YES;
472 | GCC_WARN_UNUSED_VARIABLE = YES;
473 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
474 | MTL_ENABLE_DEBUG_INFO = NO;
475 | SDKROOT = iphoneos;
476 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
477 | SWIFT_VERSION = 4.2;
478 | TARGETED_DEVICE_FAMILY = "1,2";
479 | VALIDATE_PRODUCT = YES;
480 | VERSIONING_SYSTEM = "apple-generic";
481 | VERSION_INFO_PREFIX = "";
482 | };
483 | name = Release;
484 | };
485 | 49A1B1FB1DEDA4A300DF4686 /* Debug */ = {
486 | isa = XCBuildConfiguration;
487 | buildSettings = {
488 | CLANG_ENABLE_MODULES = YES;
489 | CODE_SIGN_IDENTITY = "";
490 | DEFINES_MODULE = YES;
491 | DYLIB_COMPATIBILITY_VERSION = 1;
492 | DYLIB_CURRENT_VERSION = 1;
493 | DYLIB_INSTALL_NAME_BASE = "@rpath";
494 | INFOPLIST_FILE = CDAlertView/Info.plist;
495 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
496 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
497 | PRODUCT_BUNDLE_IDENTIFIER = com.candostdagdeviren.CDAlertView;
498 | PRODUCT_NAME = "$(TARGET_NAME)";
499 | SKIP_INSTALL = YES;
500 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
501 | SWIFT_VERSION = 5.0;
502 | };
503 | name = Debug;
504 | };
505 | 49A1B1FC1DEDA4A300DF4686 /* Release */ = {
506 | isa = XCBuildConfiguration;
507 | buildSettings = {
508 | CLANG_ENABLE_MODULES = YES;
509 | CODE_SIGN_IDENTITY = "";
510 | DEFINES_MODULE = YES;
511 | DYLIB_COMPATIBILITY_VERSION = 1;
512 | DYLIB_CURRENT_VERSION = 1;
513 | DYLIB_INSTALL_NAME_BASE = "@rpath";
514 | INFOPLIST_FILE = CDAlertView/Info.plist;
515 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
516 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
517 | PRODUCT_BUNDLE_IDENTIFIER = com.candostdagdeviren.CDAlertView;
518 | PRODUCT_NAME = "$(TARGET_NAME)";
519 | SKIP_INSTALL = YES;
520 | SWIFT_VERSION = 5.0;
521 | };
522 | name = Release;
523 | };
524 | 49A1B1FE1DEDA4A300DF4686 /* Debug */ = {
525 | isa = XCBuildConfiguration;
526 | buildSettings = {
527 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
528 | INFOPLIST_FILE = CDAlertViewTests/Info.plist;
529 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
530 | PRODUCT_BUNDLE_IDENTIFIER = com.candostdagdeviren.CDAlertViewTests;
531 | PRODUCT_NAME = "$(TARGET_NAME)";
532 | SWIFT_VERSION = 5.0;
533 | };
534 | name = Debug;
535 | };
536 | 49A1B1FF1DEDA4A300DF4686 /* Release */ = {
537 | isa = XCBuildConfiguration;
538 | buildSettings = {
539 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
540 | INFOPLIST_FILE = CDAlertViewTests/Info.plist;
541 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
542 | PRODUCT_BUNDLE_IDENTIFIER = com.candostdagdeviren.CDAlertViewTests;
543 | PRODUCT_NAME = "$(TARGET_NAME)";
544 | SWIFT_VERSION = 5.0;
545 | };
546 | name = Release;
547 | };
548 | /* End XCBuildConfiguration section */
549 |
550 | /* Begin XCConfigurationList section */
551 | 49A1B1E01DEDA4A300DF4686 /* Build configuration list for PBXProject "CDAlertView" */ = {
552 | isa = XCConfigurationList;
553 | buildConfigurations = (
554 | 49A1B1F81DEDA4A300DF4686 /* Debug */,
555 | 49A1B1F91DEDA4A300DF4686 /* Release */,
556 | );
557 | defaultConfigurationIsVisible = 0;
558 | defaultConfigurationName = Release;
559 | };
560 | 49A1B1FA1DEDA4A300DF4686 /* Build configuration list for PBXNativeTarget "CDAlertView" */ = {
561 | isa = XCConfigurationList;
562 | buildConfigurations = (
563 | 49A1B1FB1DEDA4A300DF4686 /* Debug */,
564 | 49A1B1FC1DEDA4A300DF4686 /* Release */,
565 | );
566 | defaultConfigurationIsVisible = 0;
567 | defaultConfigurationName = Release;
568 | };
569 | 49A1B1FD1DEDA4A300DF4686 /* Build configuration list for PBXNativeTarget "CDAlertViewTests" */ = {
570 | isa = XCConfigurationList;
571 | buildConfigurations = (
572 | 49A1B1FE1DEDA4A300DF4686 /* Debug */,
573 | 49A1B1FF1DEDA4A300DF4686 /* Release */,
574 | );
575 | defaultConfigurationIsVisible = 0;
576 | defaultConfigurationName = Release;
577 | };
578 | /* End XCConfigurationList section */
579 | };
580 | rootObject = 49A1B1DD1DEDA4A300DF4686 /* Project object */;
581 | }
582 |
--------------------------------------------------------------------------------