├── .github
├── FUNDING.yml
└── stale.yml
├── .gitignore
├── .travis.yml
├── AppIcons
├── cardcast.png
├── envision.png
├── happy_scale.png
├── lukapizza.png
├── modernmagic8ball.png
├── q_talk_about_music.jpg
├── ris.png
├── stikkr.png
├── tsum.png
├── vh_dispatch.png
└── wanderings.png
├── Cartfile
├── Cartfile.resolved
├── Example
├── NotificationBanner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── NotificationBanner-Example.xcscheme
├── NotificationBanner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── NotificationBanner
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ ├── BasicNotificationBannerCell.swift
│ ├── CustomBannerColors.swift
│ ├── ExampleView.swift
│ ├── ExampleViewController.swift
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-29x29@1x-1.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x-1.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x-1.png
│ │ │ ├── Icon-App-40x40@2x-2.png
│ │ │ ├── Icon-App-60x60@2x-1.png
│ │ │ ├── Icon-App-60x60@2x-2.png
│ │ │ ├── Icon-App-60x60@3x-1.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ └── Icon-App-76x76@2x.png
│ │ ├── Contents.json
│ │ ├── cubs_logo.imageset
│ │ │ ├── Contents.json
│ │ │ └── cubs_logo.png
│ │ ├── danger.imageset
│ │ │ ├── Contents.json
│ │ │ └── danger.png
│ │ ├── duke_logo.imageset
│ │ │ ├── Contents.json
│ │ │ └── duke_logo.png
│ │ ├── info.imageset
│ │ │ ├── Contents.json
│ │ │ └── info.png
│ │ ├── right_chevron.imageset
│ │ │ ├── Contents.json
│ │ │ └── right_chevron.png
│ │ ├── success.imageset
│ │ │ ├── Contents.json
│ │ │ └── success.png
│ │ ├── tab_bar_icon.imageset
│ │ │ ├── Contents.json
│ │ │ ├── tab_bar_icon.png
│ │ │ ├── tab_bar_icon@2x.png
│ │ │ └── tab_bar_icon@3x.png
│ │ └── unc_logo.imageset
│ │ │ ├── Contents.json
│ │ │ └── unc_logo.png
│ ├── Info.plist
│ └── NorthCarolinaBannerView.swift
├── Podfile
├── Podfile.lock
└── Pods
│ ├── Local Podspecs
│ ├── NotificationBanner.podspec.json
│ └── NotificationBannerSwift.podspec.json
│ ├── Manifest.lock
│ ├── MarqueeLabel
│ ├── LICENSE
│ ├── README.mdown
│ └── Sources
│ │ └── MarqueeLabel.swift
│ ├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ ├── Reveal-SDK
│ └── RevealServer
│ │ └── iOS
│ │ └── RevealServer.framework
│ │ ├── Headers
│ │ └── RevealServer.h
│ │ ├── Info.plist
│ │ ├── Modules
│ │ └── module.modulemap
│ │ ├── RevealServer
│ │ ├── Scripts
│ │ └── copy_and_codesign_revealserver.sh
│ │ └── _CodeSignature
│ │ └── CodeResources
│ ├── SnapKit
│ ├── LICENSE
│ ├── README.md
│ └── Source
│ │ ├── Constraint.swift
│ │ ├── ConstraintAttributes.swift
│ │ ├── ConstraintConfig.swift
│ │ ├── ConstraintConstantTarget.swift
│ │ ├── ConstraintDSL.swift
│ │ ├── ConstraintDescription.swift
│ │ ├── ConstraintInsetTarget.swift
│ │ ├── ConstraintInsets.swift
│ │ ├── ConstraintItem.swift
│ │ ├── ConstraintLayoutGuide+Extensions.swift
│ │ ├── ConstraintLayoutGuide.swift
│ │ ├── ConstraintLayoutGuideDSL.swift
│ │ ├── ConstraintLayoutSupport.swift
│ │ ├── ConstraintLayoutSupportDSL.swift
│ │ ├── ConstraintMaker.swift
│ │ ├── ConstraintMakerEditable.swift
│ │ ├── ConstraintMakerExtendable.swift
│ │ ├── ConstraintMakerFinalizable.swift
│ │ ├── ConstraintMakerPriortizable.swift
│ │ ├── ConstraintMakerRelatable.swift
│ │ ├── ConstraintMultiplierTarget.swift
│ │ ├── ConstraintOffsetTarget.swift
│ │ ├── ConstraintPriority.swift
│ │ ├── ConstraintPriorityTarget.swift
│ │ ├── ConstraintRelatableTarget.swift
│ │ ├── ConstraintRelation.swift
│ │ ├── ConstraintView+Extensions.swift
│ │ ├── ConstraintView.swift
│ │ ├── ConstraintViewDSL.swift
│ │ ├── Debugging.swift
│ │ ├── LayoutConstraint.swift
│ │ ├── LayoutConstraintItem.swift
│ │ ├── Typealiases.swift
│ │ └── UILayoutSupport+Extensions.swift
│ └── Target Support Files
│ ├── MarqueeLabel
│ ├── Info.plist
│ ├── MarqueeLabel-Info.plist
│ ├── MarqueeLabel-dummy.m
│ ├── MarqueeLabel-prefix.pch
│ ├── MarqueeLabel-umbrella.h
│ ├── MarqueeLabel.modulemap
│ └── MarqueeLabel.xcconfig
│ ├── NotificationBannerSwift
│ ├── Info.plist
│ ├── NotificationBannerSwift-Info.plist
│ ├── NotificationBannerSwift-dummy.m
│ ├── NotificationBannerSwift-prefix.pch
│ ├── NotificationBannerSwift-umbrella.h
│ ├── NotificationBannerSwift.modulemap
│ └── NotificationBannerSwift.xcconfig
│ ├── Pods-NotificationBanner_Example
│ ├── Info.plist
│ ├── Pods-NotificationBanner_Example-Info.plist
│ ├── Pods-NotificationBanner_Example-acknowledgements.markdown
│ ├── Pods-NotificationBanner_Example-acknowledgements.plist
│ ├── Pods-NotificationBanner_Example-dummy.m
│ ├── Pods-NotificationBanner_Example-frameworks.sh
│ ├── Pods-NotificationBanner_Example-resources.sh
│ ├── Pods-NotificationBanner_Example-umbrella.h
│ ├── Pods-NotificationBanner_Example.debug.xcconfig
│ ├── Pods-NotificationBanner_Example.modulemap
│ └── Pods-NotificationBanner_Example.release.xcconfig
│ ├── Reveal-SDK
│ └── Reveal-SDK.xcconfig
│ └── SnapKit
│ ├── Info.plist
│ ├── SnapKit-Info.plist
│ ├── SnapKit-dummy.m
│ ├── SnapKit-prefix.pch
│ ├── SnapKit-umbrella.h
│ ├── SnapKit.modulemap
│ └── SnapKit.xcconfig
├── LICENSE
├── NotificationBanner.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcshareddata
│ └── xcschemes
│ └── NotificationBanner.xcscheme
├── NotificationBanner
├── Assets
│ ├── .gitkeep
│ ├── basic.gif
│ ├── custom.gif
│ ├── floating.gif
│ ├── growing.gif
│ ├── header.png
│ ├── side_views.gif
│ ├── stacked.gif
│ └── status_bar.gif
├── Classes
│ ├── .gitkeep
│ ├── BannerColors.swift
│ ├── BannerHapticGenerator.swift
│ ├── BannerPositionFrame.swift
│ ├── BannerStyle.swift
│ ├── BaseNotificationBanner.swift
│ ├── FloatingNotificationBanner.swift
│ ├── GrowingNotificationBanner.swift
│ ├── NotificationBanner.swift
│ ├── NotificationBannerQueue.swift
│ ├── NotificationBannerUtilities.swift
│ ├── StatusBarNotificationBanner.swift
│ ├── String+heightForConstrainedWidth.swift
│ └── UIWindow+orientation.swift
└── Supporting Files
│ ├── Info.plist
│ └── NotificationBanner.h
├── NotificationBannerSwift.podspec
├── Package.resolved
├── Package.swift
├── README.md
└── _Pods.xcodeproj
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [daltron]
2 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 60
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 7
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - pinned
8 | - security
9 | # Label to use when marking an issue as stale
10 | staleLabel: wontfix
11 | # Comment to post when marking an issue as stale. Set to `false` to disable
12 | markComment: >
13 | This issue has been automatically marked as stale because it has not had
14 | recent activity. It will be closed if no further activity occurs. Thank you
15 | for your contributions.
16 | # Comment to post when closing a stale issue. Set to `false` to disable
17 | closeComment: >
18 | This issue has been automatically closed due to inactivity.
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OS X
2 | .DS_Store
3 |
4 | # Xcode
5 | build/
6 | *.pbxuser
7 | !default.pbxuser
8 | *.mode1v3
9 | !default.mode1v3
10 | *.mode2v3
11 | !default.mode2v3
12 | *.perspectivev3
13 | !default.perspectivev3
14 | xcuserdata/
15 | *.xccheckout
16 | profile
17 | *.moved-aside
18 | DerivedData
19 | *.hmap
20 | *.ipa
21 |
22 | # Bundler
23 | .bundle
24 |
25 | Carthage
26 | # We recommend against adding the Pods directory to your .gitignore. However
27 | # you should judge for yourself, the pros and cons are mentioned at:
28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
29 | #
30 | # Note: if you ignore the Pods directory, make sure to uncomment
31 | # `pod install` in .travis.yml
32 | #
33 | # Pods/
34 | .swiftpm
35 |
--------------------------------------------------------------------------------
/.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: xcode7.3
6 | language: objective-c
7 | # cache: cocoapods
8 | # podfile: Example/Podfile
9 | # before_install:
10 | # - gem install cocoapods # Since Travis is not always on latest version
11 | # - pod install --project-directory=Example
12 | script:
13 | - set -o pipefail && xcodebuild test -workspace Example/NotificationBanner.xcworkspace -scheme NotificationBanner-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
14 | - pod lib lint
15 |
--------------------------------------------------------------------------------
/AppIcons/cardcast.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/cardcast.png
--------------------------------------------------------------------------------
/AppIcons/envision.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/envision.png
--------------------------------------------------------------------------------
/AppIcons/happy_scale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/happy_scale.png
--------------------------------------------------------------------------------
/AppIcons/lukapizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/lukapizza.png
--------------------------------------------------------------------------------
/AppIcons/modernmagic8ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/modernmagic8ball.png
--------------------------------------------------------------------------------
/AppIcons/q_talk_about_music.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/q_talk_about_music.jpg
--------------------------------------------------------------------------------
/AppIcons/ris.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/ris.png
--------------------------------------------------------------------------------
/AppIcons/stikkr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/stikkr.png
--------------------------------------------------------------------------------
/AppIcons/tsum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/tsum.png
--------------------------------------------------------------------------------
/AppIcons/vh_dispatch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/vh_dispatch.png
--------------------------------------------------------------------------------
/AppIcons/wanderings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/AppIcons/wanderings.png
--------------------------------------------------------------------------------
/Cartfile:
--------------------------------------------------------------------------------
1 | # A scolling drop-in replacement for UILabel for long texts.
2 | github "cbpowell/MarqueeLabel" ~> 4.0.0
3 |
4 | # A Swift Autolayout DSL for iOS & OS X
5 | github "SnapKit/SnapKit" ~> 5.0.0
6 |
--------------------------------------------------------------------------------
/Cartfile.resolved:
--------------------------------------------------------------------------------
1 | github "SnapKit/SnapKit" "5.0.1"
2 | github "cbpowell/MarqueeLabel" "4.0.0"
3 |
--------------------------------------------------------------------------------
/Example/NotificationBanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/NotificationBanner.xcodeproj/xcshareddata/xcschemes/NotificationBanner-Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
93 |
94 |
95 |
96 |
97 |
98 |
104 |
106 |
112 |
113 |
114 |
115 |
117 |
118 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/Example/NotificationBanner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/NotificationBanner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/NotificationBanner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // NotificationBanner
4 | //
5 | // Created by Daltron on 03/18/2017.
6 | // Copyright (c) 2017 Daltron. 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]?) -> Bool {
17 |
18 | let navigationController = UINavigationController(rootViewController: ExampleViewController())
19 | let tabBarController = UITabBarController()
20 | tabBarController.viewControllers = [navigationController]
21 |
22 | let tab = tabBarController.tabBar.items![0]
23 | tab.image = #imageLiteral(resourceName: "tab_bar_icon").withRenderingMode(.alwaysOriginal)
24 | tab.imageInsets = UIEdgeInsets(top: 6, left: 0, bottom: -6, right: 0)
25 | tab.title = nil
26 |
27 | window = UIWindow(frame: UIScreen.main.bounds)
28 | window?.backgroundColor = .white
29 | window?.rootViewController = tabBarController
30 | window?.makeKeyAndVisible()
31 |
32 | return true
33 | }
34 |
35 | func applicationWillResignActive(_ application: UIApplication) {
36 | // 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.
37 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
38 | }
39 |
40 | func applicationDidEnterBackground(_ application: UIApplication) {
41 | // 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.
42 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
43 | }
44 |
45 | func applicationWillEnterForeground(_ application: UIApplication) {
46 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
47 | }
48 |
49 | func applicationDidBecomeActive(_ application: UIApplication) {
50 | // 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.
51 | }
52 |
53 | func applicationWillTerminate(_ application: UIApplication) {
54 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
55 | }
56 |
57 |
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/Example/NotificationBanner/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
22 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Example/NotificationBanner/BasicNotificationBannerCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NotificationBannerCell.swift
3 | // NotificationBanner
4 | //
5 | // Created by Dalton Hinterscher on 3/22/17.
6 | // Copyright © 2017 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class BasicNotificationBannerCell: UITableViewCell {
12 |
13 | private var coloredBlockView: UIImageView!
14 | private var titleLabel: UILabel!
15 | private var subtitleLabel: UILabel!
16 |
17 | init(reuseIdentifier: String?) {
18 | super.init(style: .default, reuseIdentifier: reuseIdentifier)
19 |
20 | coloredBlockView = UIImageView()
21 | coloredBlockView.contentMode = .scaleAspectFit
22 | contentView.addSubview(coloredBlockView)
23 |
24 | titleLabel = UILabel()
25 | titleLabel.font = UIFont.systemFont(ofSize: 20.0)
26 | contentView.addSubview(titleLabel)
27 |
28 | subtitleLabel = UILabel()
29 | subtitleLabel.font = UIFont.systemFont(ofSize: 14.0)
30 | subtitleLabel.textColor = .lightGray
31 | contentView.addSubview(subtitleLabel)
32 |
33 | coloredBlockView.snp.makeConstraints { (make) in
34 | make.top.equalToSuperview().offset(15)
35 | make.bottom.equalToSuperview().offset(-15)
36 | make.left.equalToSuperview().offset(15)
37 | make.width.equalTo(coloredBlockView.snp.height)
38 | }
39 |
40 | subtitleLabel.snp.remakeConstraints { (make) in
41 | make.left.equalTo(titleLabel)
42 | make.right.equalTo(titleLabel)
43 | make.bottom.equalTo(coloredBlockView)
44 | }
45 | }
46 |
47 | required init?(coder aDecoder: NSCoder) {
48 | fatalError("init(coder:) has not been implemented")
49 | }
50 |
51 | func update(blockColor: UIColor?, image: UIImage?, title: String, subtitle: String?) {
52 |
53 | if let image = image {
54 | coloredBlockView.image = image
55 | coloredBlockView.backgroundColor = .clear
56 | } else if let blockColor = blockColor {
57 | coloredBlockView.backgroundColor = blockColor
58 | coloredBlockView.image = nil
59 | }
60 |
61 | titleLabel.text = title
62 | subtitleLabel.text = subtitle
63 |
64 | if let _ = subtitle {
65 | subtitleLabel.isHidden = false
66 | titleLabel.snp.remakeConstraints { (make) in
67 | make.left.equalTo(coloredBlockView.snp.right).offset(15)
68 | make.right.equalToSuperview().offset(-15)
69 | make.top.equalTo(coloredBlockView)
70 | }
71 |
72 | } else {
73 | subtitleLabel.isHidden = true
74 | titleLabel.snp.remakeConstraints { (make) in
75 | make.left.equalTo(coloredBlockView.snp.right).offset(15)
76 | make.right.equalToSuperview().offset(-15)
77 | make.centerY.equalTo(coloredBlockView)
78 | }
79 | }
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/Example/NotificationBanner/CustomBannerColors.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CustomBannerColors.swift
3 | // NotificationBanner
4 | //
5 | // Created by Dalton Hinterscher on 4/29/17.
6 | // Copyright © 2017 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class CustomBannerColors: BannerColors {
12 |
13 | /* In this example, I only want to override the warning style. If it is not the warning style, then
14 | I simply call super and return the default value.
15 | */
16 | internal override func color(for style: BannerStyle) -> UIColor {
17 | switch style {
18 | case .danger: return super.color(for: style)
19 | case .info: return super.color(for: style)
20 | case .customView: return super.color(for: style)
21 | case .success: return super.color(for: style)
22 | case .warning: return UIColor(red:0.99, green:0.40, blue:0.13, alpha:1.00)
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.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 | "size" : "29x29",
15 | "idiom" : "iphone",
16 | "filename" : "Icon-App-29x29@1x.png",
17 | "scale" : "1x"
18 | },
19 | {
20 | "size" : "29x29",
21 | "idiom" : "iphone",
22 | "filename" : "Icon-App-29x29@2x-1.png",
23 | "scale" : "2x"
24 | },
25 | {
26 | "size" : "29x29",
27 | "idiom" : "iphone",
28 | "filename" : "Icon-App-29x29@3x.png",
29 | "scale" : "3x"
30 | },
31 | {
32 | "size" : "40x40",
33 | "idiom" : "iphone",
34 | "filename" : "Icon-App-40x40@2x-1.png",
35 | "scale" : "2x"
36 | },
37 | {
38 | "size" : "40x40",
39 | "idiom" : "iphone",
40 | "filename" : "Icon-App-60x60@2x-1.png",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "iphone",
45 | "size" : "57x57",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "iphone",
50 | "size" : "57x57",
51 | "scale" : "2x"
52 | },
53 | {
54 | "size" : "60x60",
55 | "idiom" : "iphone",
56 | "filename" : "Icon-App-60x60@2x-2.png",
57 | "scale" : "2x"
58 | },
59 | {
60 | "size" : "60x60",
61 | "idiom" : "iphone",
62 | "filename" : "Icon-App-60x60@3x.png",
63 | "scale" : "3x"
64 | },
65 | {
66 | "idiom" : "ipad",
67 | "size" : "20x20",
68 | "scale" : "1x"
69 | },
70 | {
71 | "idiom" : "ipad",
72 | "size" : "20x20",
73 | "scale" : "2x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@1x-1.png",
79 | "scale" : "1x"
80 | },
81 | {
82 | "size" : "29x29",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-29x29@2x.png",
85 | "scale" : "2x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@1x.png",
91 | "scale" : "1x"
92 | },
93 | {
94 | "size" : "40x40",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-40x40@2x-2.png",
97 | "scale" : "2x"
98 | },
99 | {
100 | "idiom" : "ipad",
101 | "size" : "50x50",
102 | "scale" : "1x"
103 | },
104 | {
105 | "idiom" : "ipad",
106 | "size" : "50x50",
107 | "scale" : "2x"
108 | },
109 | {
110 | "idiom" : "ipad",
111 | "size" : "72x72",
112 | "scale" : "1x"
113 | },
114 | {
115 | "idiom" : "ipad",
116 | "size" : "72x72",
117 | "scale" : "2x"
118 | },
119 | {
120 | "size" : "76x76",
121 | "idiom" : "ipad",
122 | "filename" : "Icon-App-76x76@1x.png",
123 | "scale" : "1x"
124 | },
125 | {
126 | "size" : "76x76",
127 | "idiom" : "ipad",
128 | "filename" : "Icon-App-76x76@2x.png",
129 | "scale" : "2x"
130 | },
131 | {
132 | "size" : "83.5x83.5",
133 | "idiom" : "ipad",
134 | "filename" : "Icon-App-60x60@3x-1.png",
135 | "scale" : "2x"
136 | },
137 | {
138 | "idiom" : "ios-marketing",
139 | "size" : "1024x1024",
140 | "scale" : "1x"
141 | }
142 | ],
143 | "info" : {
144 | "version" : 1,
145 | "author" : "xcode"
146 | }
147 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@1x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@1x-1.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-2.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@2x-1.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@2x-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@2x-2.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@3x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@3x-1.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/cubs_logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "cubs_logo.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/cubs_logo.imageset/cubs_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/cubs_logo.imageset/cubs_logo.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/danger.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "danger.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/danger.imageset/danger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/danger.imageset/danger.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/duke_logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "duke_logo.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/duke_logo.imageset/duke_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/duke_logo.imageset/duke_logo.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/info.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "info.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/info.imageset/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/info.imageset/info.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/right_chevron.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "right_chevron.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/right_chevron.imageset/right_chevron.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/right_chevron.imageset/right_chevron.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/success.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "success.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/success.imageset/success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/success.imageset/success.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/tab_bar_icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "tab_bar_icon.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "tab_bar_icon@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "tab_bar_icon@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/tab_bar_icon.imageset/tab_bar_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/tab_bar_icon.imageset/tab_bar_icon.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/tab_bar_icon.imageset/tab_bar_icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/tab_bar_icon.imageset/tab_bar_icon@2x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/tab_bar_icon.imageset/tab_bar_icon@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/tab_bar_icon.imageset/tab_bar_icon@3x.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/unc_logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "unc_logo.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/NotificationBanner/Images.xcassets/unc_logo.imageset/unc_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/NotificationBanner/Images.xcassets/unc_logo.imageset/unc_logo.png
--------------------------------------------------------------------------------
/Example/NotificationBanner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Example/NotificationBanner/NorthCarolinaBannerView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NorthCarolinaBannerView.swift
3 | // NotificationBanner
4 | //
5 | // Created by Dalton Hinterscher on 3/22/17.
6 | // Copyright © 2017 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class NorthCarolinaBannerView: UIView {
12 |
13 | init() {
14 | super.init(frame: .zero)
15 | backgroundColor = .white
16 |
17 | let uncView = teamView(image: #imageLiteral(resourceName: "unc_logo"), record: "27-0", onLeft: true)
18 | let dukeView = teamView(image: #imageLiteral(resourceName: "duke_logo"), record: "18-9", onLeft: false)
19 |
20 | let centerView = UIView()
21 | addSubview(centerView)
22 |
23 | let scoreLabel = UILabel()
24 | scoreLabel.font = UIFont.systemFont(ofSize: 25.0)
25 | scoreLabel.text = "98 - 63"
26 | centerView.addSubview(scoreLabel)
27 |
28 | let finalLabel = UILabel()
29 | finalLabel.font = UIFont.boldSystemFont(ofSize: 15.0)
30 | finalLabel.text = "Final"
31 | centerView.addSubview(finalLabel)
32 |
33 | centerView.snp.makeConstraints { (make) in
34 | make.centerY.equalToSuperview()
35 | make.left.equalTo(uncView.snp.right).offset(10)
36 | make.right.equalTo(dukeView.snp.left).offset(-10)
37 | make.bottom.equalTo(finalLabel)
38 | }
39 |
40 | scoreLabel.snp.makeConstraints { (make) in
41 | make.top.equalToSuperview()
42 | make.centerX.equalTo(centerView)
43 | }
44 |
45 | finalLabel.snp.makeConstraints { (make) in
46 | make.top.equalTo(scoreLabel.snp.bottom)
47 | make.centerX.equalTo(centerView)
48 | }
49 |
50 | }
51 |
52 | required init?(coder aDecoder: NSCoder) {
53 | fatalError("init(coder:) has not been implemented")
54 | }
55 |
56 | private func teamView(image: UIImage, record: String, onLeft: Bool) -> UIView {
57 |
58 | let teamView = UIView()
59 | addSubview(teamView)
60 |
61 | let imageView = UIImageView(image: image)
62 | imageView.contentMode = .scaleAspectFit
63 | teamView.addSubview(imageView)
64 |
65 | let recordLabel = UILabel()
66 | recordLabel.font = UIFont.systemFont(ofSize: 12.5)
67 | recordLabel.text = onLeft ? "32-0" : "18-10"
68 | recordLabel.textAlignment = .center
69 | teamView.addSubview(recordLabel)
70 |
71 |
72 | imageView.snp.makeConstraints { (make) in
73 | make.top.equalToSuperview()
74 | make.left.equalToSuperview()
75 | make.right.equalToSuperview()
76 | make.height.equalTo(imageView.snp.width)
77 | }
78 |
79 | recordLabel.snp.makeConstraints { (make) in
80 | make.top.equalTo(imageView.snp.bottom).offset(2.5)
81 | make.left.equalToSuperview()
82 | make.right.equalToSuperview()
83 | }
84 |
85 | teamView.snp.makeConstraints { (make) in
86 | make.centerY.equalToSuperview()
87 | if onLeft {
88 | make.left.equalToSuperview().offset(15)
89 | } else {
90 | make.right.equalToSuperview().offset(-15)
91 | }
92 | make.bottom.equalTo(recordLabel)
93 | make.width.equalTo(40)
94 | }
95 |
96 | return teamView
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 | platform :ios, '10.0'
3 |
4 | target 'NotificationBanner_Example' do
5 | pod 'NotificationBannerSwift', :path => '../'
6 | pod 'Reveal-SDK', :configurations => ['Debug']
7 | end
8 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - MarqueeLabel (4.0.0)
3 | - NotificationBannerSwift (3.0.1):
4 | - MarqueeLabel (~> 4.0.0)
5 | - SnapKit (~> 5.0.0)
6 | - Reveal-SDK (24)
7 | - SnapKit (5.0.0)
8 |
9 | DEPENDENCIES:
10 | - NotificationBannerSwift (from `../`)
11 | - Reveal-SDK
12 |
13 | SPEC REPOS:
14 | https://github.com/CocoaPods/Specs.git:
15 | - MarqueeLabel
16 | - Reveal-SDK
17 | - SnapKit
18 |
19 | EXTERNAL SOURCES:
20 | NotificationBannerSwift:
21 | :path: "../"
22 |
23 | SPEC CHECKSUMS:
24 | MarqueeLabel: b55b26e690b6ad41faedd95cbf5eae6f1d1735b4
25 | NotificationBannerSwift: 4fbb64e7740ce16543c08c1fb2df895e30b8e3e1
26 | Reveal-SDK: 5d7e56b8f018c0a88b3a2c10bf68d598bbd3b071
27 | SnapKit: fd22d10eb9aff484d79a8724eab922c1ddf89bcf
28 |
29 | PODFILE CHECKSUM: 9da8a8eebe6c6fde318fed3c4233a33c797d63ad
30 |
31 | COCOAPODS: 1.8.4
32 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/NotificationBanner.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "NotificationBanner",
3 | "version": "0.1.0",
4 | "summary": "A short description of NotificationBanner.",
5 | "description": "TODO: Add long description of the pod here.",
6 | "homepage": "https://github.com/Daltron/NotificationBanner",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "Daltron": "daltonhint4@gmail.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/Daltron/NotificationBanner.git",
16 | "tag": "0.1.0"
17 | },
18 | "platforms": {
19 | "ios": "9.0"
20 | },
21 | "source_files": "NotificationBanner/Classes/**/*",
22 | "dependencies": {
23 | "SnapKit": [
24 | "~> 3.2.0"
25 | ],
26 | "MarqueeLabel/Swift": [
27 |
28 | ]
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/NotificationBannerSwift.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "NotificationBannerSwift",
3 | "version": "3.0.1",
4 | "summary": "The easiest way to display in app notification banners in iOS.",
5 | "description": "NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banners and drop down alerts an absolute breeze in iOS.",
6 | "homepage": "https://github.com/Daltron/NotificationBanner",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "Daltron": "daltonhint4@gmail.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/Daltron/NotificationBanner.git",
16 | "tag": "3.0.1"
17 | },
18 | "platforms": {
19 | "ios": "10.0"
20 | },
21 | "swift_versions": "5.0",
22 | "source_files": "NotificationBanner/Classes/**/*",
23 | "dependencies": {
24 | "SnapKit": [
25 | "~> 5.0.0"
26 | ],
27 | "MarqueeLabel": [
28 | "~> 4.0.0"
29 | ]
30 | },
31 | "swift_version": "5.0"
32 | }
33 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - MarqueeLabel (4.0.0)
3 | - NotificationBannerSwift (3.0.1):
4 | - MarqueeLabel (~> 4.0.0)
5 | - SnapKit (~> 5.0.0)
6 | - Reveal-SDK (24)
7 | - SnapKit (5.0.0)
8 |
9 | DEPENDENCIES:
10 | - NotificationBannerSwift (from `../`)
11 | - Reveal-SDK
12 |
13 | SPEC REPOS:
14 | https://github.com/CocoaPods/Specs.git:
15 | - MarqueeLabel
16 | - Reveal-SDK
17 | - SnapKit
18 |
19 | EXTERNAL SOURCES:
20 | NotificationBannerSwift:
21 | :path: "../"
22 |
23 | SPEC CHECKSUMS:
24 | MarqueeLabel: b55b26e690b6ad41faedd95cbf5eae6f1d1735b4
25 | NotificationBannerSwift: 4fbb64e7740ce16543c08c1fb2df895e30b8e3e1
26 | Reveal-SDK: 5d7e56b8f018c0a88b3a2c10bf68d598bbd3b071
27 | SnapKit: fd22d10eb9aff484d79a8724eab922c1ddf89bcf
28 |
29 | PODFILE CHECKSUM: 9da8a8eebe6c6fde318fed3c4233a33c797d63ad
30 |
31 | COCOAPODS: 1.8.4
32 |
--------------------------------------------------------------------------------
/Example/Pods/MarqueeLabel/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2017 Charles Powell
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation
5 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
6 | to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 |
10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
11 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
12 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
13 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
14 | IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Headers/RevealServer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright © 2015 Itty Bitty Apps, Pty Ltd. All rights reserved.
3 |
4 | #import
5 |
6 | //! Project version number for RevealServer.
7 | FOUNDATION_EXPORT double RevealServerVersionNumber;
8 |
9 | //! Project version string for RevealServer.
10 | FOUNDATION_EXPORT const unsigned char RevealServerVersionString[];
11 |
12 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Info.plist
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Modules/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module RevealServer {
2 | umbrella header "RevealServer.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/RevealServer:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/RevealServer
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Scripts/copy_and_codesign_revealserver.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -o errexit
3 | set -o nounset
4 |
5 | # Ensure that we have a valid OTHER_LDFLAGS environment variable
6 | OTHER_LDFLAGS=${OTHER_LDFLAGS:=""}
7 |
8 | # Ensure that we have a valid REVEAL_SERVER_FILENAME environment variable
9 | REVEAL_SERVER_FILENAME=${REVEAL_SERVER_FILENAME:="RevealServer.framework"}
10 |
11 | # Ensure that we have a valid REVEAL_SERVER_PATH environment variable
12 | REVEAL_SERVER_PATH=${REVEAL_SERVER_PATH:="${SRCROOT}/${REVEAL_SERVER_FILENAME}"}
13 |
14 | # The path to copy the framework to
15 | app_frameworks_dir="${CODESIGNING_FOLDER_PATH}/Frameworks"
16 |
17 | copy_library() {
18 | mkdir -p "$app_frameworks_dir"
19 | cp -vRf "$REVEAL_SERVER_PATH" "${app_frameworks_dir}/"
20 | }
21 |
22 | codesign_library() {
23 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" ]; then
24 | codesign -fs "${EXPANDED_CODE_SIGN_IDENTITY}" "${app_frameworks_dir}/${REVEAL_SERVER_FILENAME}"
25 | fi
26 | }
27 |
28 | main() {
29 | if [[ $OTHER_LDFLAGS =~ "RevealServer" ]]; then
30 | if [ -e "$REVEAL_SERVER_PATH" ]; then
31 | copy_library
32 | codesign_library
33 | echo "${REVEAL_SERVER_FILENAME} is included in this build, and has been copied to $CODESIGNING_FOLDER_PATH"
34 | else
35 | echo "${REVEAL_SERVER_FILENAME} is not included in this build, as it could not be found at $REVEAL_SERVER_PATH"
36 | fi
37 | else
38 | echo "${REVEAL_SERVER_FILENAME} is not included in this build because RevealServer was not present in the OTHER_LDFLAGS environment variable."
39 | fi
40 | }
41 |
42 | main
43 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/_CodeSignature/CodeResources:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | files
6 |
7 | Headers/RevealServer.h
8 |
9 | JavE2LI6bNGfH9W90/bDxwIxVlg=
10 |
11 | Info.plist
12 |
13 | KVRE+icWWattIxwSLkaeZU55jms=
14 |
15 | Modules/module.modulemap
16 |
17 | EuDEeG1dcC1sd+hIW2SkUAImUg8=
18 |
19 | Scripts/copy_and_codesign_revealserver.sh
20 |
21 | yB2zXTggmRD0rra2Hbpxn2zfCRo=
22 |
23 |
24 | files2
25 |
26 | Headers/RevealServer.h
27 |
28 | hash
29 |
30 | JavE2LI6bNGfH9W90/bDxwIxVlg=
31 |
32 | hash2
33 |
34 | weLK/65HyV1EiL9dd4xoAqQhf0/0r/Oy6os2nXCA+Ew=
35 |
36 |
37 | Modules/module.modulemap
38 |
39 | hash
40 |
41 | EuDEeG1dcC1sd+hIW2SkUAImUg8=
42 |
43 | hash2
44 |
45 | tstqiJpIPr4iEd3MDHClLuTB/ciSC/zNlke1AjfSVuU=
46 |
47 |
48 | Scripts/copy_and_codesign_revealserver.sh
49 |
50 | hash
51 |
52 | yB2zXTggmRD0rra2Hbpxn2zfCRo=
53 |
54 | hash2
55 |
56 | SL0x5cGSOyS1RcojHFEmFX5IDfon/vO37cFsjSIX7LA=
57 |
58 |
59 |
60 | rules
61 |
62 | ^.*
63 |
64 | ^.*\.lproj/
65 |
66 | optional
67 |
68 | weight
69 | 1000
70 |
71 | ^.*\.lproj/locversion.plist$
72 |
73 | omit
74 |
75 | weight
76 | 1100
77 |
78 | ^Base\.lproj/
79 |
80 | weight
81 | 1010
82 |
83 | ^version.plist$
84 |
85 |
86 | rules2
87 |
88 | .*\.dSYM($|/)
89 |
90 | weight
91 | 11
92 |
93 | ^(.*/)?\.DS_Store$
94 |
95 | omit
96 |
97 | weight
98 | 2000
99 |
100 | ^.*
101 |
102 | ^.*\.lproj/
103 |
104 | optional
105 |
106 | weight
107 | 1000
108 |
109 | ^.*\.lproj/locversion.plist$
110 |
111 | omit
112 |
113 | weight
114 | 1100
115 |
116 | ^Base\.lproj/
117 |
118 | weight
119 | 1010
120 |
121 | ^Info\.plist$
122 |
123 | omit
124 |
125 | weight
126 | 20
127 |
128 | ^PkgInfo$
129 |
130 | omit
131 |
132 | weight
133 | 20
134 |
135 | ^embedded\.provisionprofile$
136 |
137 | weight
138 | 20
139 |
140 | ^version\.plist$
141 |
142 | weight
143 | 20
144 |
145 |
146 |
147 |
148 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
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 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.
4 |
5 | [](https://travis-ci.org/SnapKit/SnapKit)
6 | [](https://github.com/SnapKit/SnapKit)
7 | [](https://cocoapods.org/pods/SnapKit)
8 | [](https://github.com/Carthage/Carthage)
9 |
10 | #### ⚠️ **To use with Swift 3.x please ensure you are using >= 3.0.0** ⚠️
11 | #### ⚠️ **To use with Swift 4.x please ensure you are using >= 4.0.0** ⚠️
12 |
13 | ## Contents
14 |
15 | - [Requirements](#requirements)
16 | - [Migration Guides](#migration-guides)
17 | - [Communication](#communication)
18 | - [Installation](#installation)
19 | - [Usage](#usage)
20 | - [Credits](#credits)
21 | - [License](#license)
22 |
23 | ## Requirements
24 |
25 | - iOS 8.0+ / Mac OS X 10.11+ / tvOS 9.0+
26 | - Xcode 9.0+
27 | - Swift 3.0+
28 |
29 | ## Communication
30 |
31 | - If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/snapkit). (Tag 'snapkit')
32 | - If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/snapkit).
33 | - If you **found a bug**, open an issue.
34 | - If you **have a feature request**, open an issue.
35 | - If you **want to contribute**, submit a pull request.
36 |
37 |
38 | ## Installation
39 |
40 | ### CocoaPods
41 |
42 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
43 |
44 | ```bash
45 | $ gem install cocoapods
46 | ```
47 |
48 | > CocoaPods 1.1.0+ is required to build SnapKit 4.0.0+.
49 |
50 | To integrate SnapKit into your Xcode project using CocoaPods, specify it in your `Podfile`:
51 |
52 | ```ruby
53 | source 'https://github.com/CocoaPods/Specs.git'
54 | platform :ios, '10.0'
55 | use_frameworks!
56 |
57 | target '' do
58 | pod 'SnapKit', '~> 4.0.0'
59 | end
60 | ```
61 |
62 | Then, run the following command:
63 |
64 | ```bash
65 | $ pod install
66 | ```
67 |
68 | ### Carthage
69 |
70 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
71 |
72 | You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
73 |
74 | ```bash
75 | $ brew update
76 | $ brew install carthage
77 | ```
78 |
79 | To integrate SnapKit into your Xcode project using Carthage, specify it in your `Cartfile`:
80 |
81 | ```ogdl
82 | github "SnapKit/SnapKit" ~> 4.0.0
83 | ```
84 |
85 | Run `carthage update` to build the framework and drag the built `SnapKit.framework` into your Xcode project.
86 |
87 | ### Manually
88 |
89 | If you prefer not to use either of the aforementioned dependency managers, you can integrate SnapKit into your project manually.
90 |
91 | ---
92 |
93 | ## Usage
94 |
95 | ### Quick Start
96 |
97 | ```swift
98 | import SnapKit
99 |
100 | class MyViewController: UIViewController {
101 |
102 | lazy var box = UIView()
103 |
104 | override func viewDidLoad() {
105 | super.viewDidLoad()
106 |
107 | self.view.addSubview(box)
108 | box.snp.makeConstraints { (make) -> Void in
109 | make.width.height.equalTo(50)
110 | make.center.equalTo(self.view)
111 | }
112 | }
113 |
114 | }
115 | ```
116 |
117 | ### Resources
118 |
119 | - [Documentation](http://snapkit.io/docs/)
120 | - [F.A.Q.](http://snapkit.io/faq/)
121 |
122 | ## Credits
123 |
124 | - Robert Payne ([@robertjpayne](https://twitter.com/robertjpayne))
125 | - Many other contributors
126 |
127 | ## License
128 |
129 | SnapKit is released under the MIT license. See LICENSE for details.
130 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintConfig.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | public typealias ConstraintInterfaceLayoutDirection = UIUserInterfaceLayoutDirection
27 | #else
28 | import AppKit
29 | public typealias ConstraintInterfaceLayoutDirection = NSUserInterfaceLayoutDirection
30 | #endif
31 |
32 |
33 | public struct ConstraintConfig {
34 |
35 | public static var interfaceLayoutDirection: ConstraintInterfaceLayoutDirection = .leftToRight
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintConstantTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintConstantTarget {
32 | }
33 |
34 | extension CGPoint: ConstraintConstantTarget {
35 | }
36 |
37 | extension CGSize: ConstraintConstantTarget {
38 | }
39 |
40 | extension ConstraintInsets: ConstraintConstantTarget {
41 | }
42 |
43 | extension ConstraintConstantTarget {
44 |
45 | internal func constraintConstantTargetValueFor(layoutAttribute: LayoutAttribute) -> CGFloat {
46 | if let value = self as? CGFloat {
47 | return value
48 | }
49 |
50 | if let value = self as? Float {
51 | return CGFloat(value)
52 | }
53 |
54 | if let value = self as? Double {
55 | return CGFloat(value)
56 | }
57 |
58 | if let value = self as? Int {
59 | return CGFloat(value)
60 | }
61 |
62 | if let value = self as? UInt {
63 | return CGFloat(value)
64 | }
65 |
66 | if let value = self as? CGSize {
67 | if layoutAttribute == .width {
68 | return value.width
69 | } else if layoutAttribute == .height {
70 | return value.height
71 | } else {
72 | return 0.0
73 | }
74 | }
75 |
76 | if let value = self as? CGPoint {
77 | #if os(iOS) || os(tvOS)
78 | switch layoutAttribute {
79 | case .left, .right, .leading, .trailing, .centerX, .leftMargin, .rightMargin, .leadingMargin, .trailingMargin, .centerXWithinMargins:
80 | return value.x
81 | case .top, .bottom, .centerY, .topMargin, .bottomMargin, .centerYWithinMargins, .lastBaseline, .firstBaseline:
82 | return value.y
83 | case .width, .height, .notAnAttribute:
84 | return 0.0
85 | #if swift(>=5.0)
86 | @unknown default:
87 | return 0.0
88 | #endif
89 | }
90 | #else
91 | switch layoutAttribute {
92 | case .left, .right, .leading, .trailing, .centerX:
93 | return value.x
94 | case .top, .bottom, .centerY, .lastBaseline, .firstBaseline:
95 | return value.y
96 | case .width, .height, .notAnAttribute:
97 | return 0.0
98 | #if swift(>=5.0)
99 | @unknown default:
100 | return 0.0
101 | #endif
102 | }
103 | #endif
104 | }
105 |
106 | if let value = self as? ConstraintInsets {
107 | #if os(iOS) || os(tvOS)
108 | switch layoutAttribute {
109 | case .left, .leftMargin:
110 | return value.left
111 | case .top, .topMargin, .firstBaseline:
112 | return value.top
113 | case .right, .rightMargin:
114 | return -value.right
115 | case .bottom, .bottomMargin, .lastBaseline:
116 | return -value.bottom
117 | case .leading, .leadingMargin:
118 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right
119 | case .trailing, .trailingMargin:
120 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left
121 | case .centerX, .centerXWithinMargins:
122 | return (value.left - value.right) / 2
123 | case .centerY, .centerYWithinMargins:
124 | return (value.top - value.bottom) / 2
125 | case .width:
126 | return -(value.left + value.right)
127 | case .height:
128 | return -(value.top + value.bottom)
129 | case .notAnAttribute:
130 | return 0.0
131 | #if swift(>=5.0)
132 | @unknown default:
133 | return 0.0
134 | #endif
135 | }
136 | #else
137 | switch layoutAttribute {
138 | case .left:
139 | return value.left
140 | case .top, .firstBaseline:
141 | return value.top
142 | case .right:
143 | return -value.right
144 | case .bottom, .lastBaseline:
145 | return -value.bottom
146 | case .leading:
147 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right
148 | case .trailing:
149 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left
150 | case .centerX:
151 | return (value.left - value.right) / 2
152 | case .centerY:
153 | return (value.top - value.bottom) / 2
154 | case .width:
155 | return -(value.left + value.right)
156 | case .height:
157 | return -(value.top + value.bottom)
158 | case .notAnAttribute:
159 | return 0.0
160 | #if swift(>=5.0)
161 | @unknown default:
162 | return 0.0
163 | #endif
164 | }
165 | #endif
166 | }
167 |
168 | return 0.0
169 | }
170 |
171 | }
172 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintDescription.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintDescription {
32 |
33 | internal let item: LayoutConstraintItem
34 | internal var attributes: ConstraintAttributes
35 | internal var relation: ConstraintRelation? = nil
36 | internal var sourceLocation: (String, UInt)? = nil
37 | internal var label: String? = nil
38 | internal var related: ConstraintItem? = nil
39 | internal var multiplier: ConstraintMultiplierTarget = 1.0
40 | internal var constant: ConstraintConstantTarget = 0.0
41 | internal var priority: ConstraintPriorityTarget = 1000.0
42 | internal lazy var constraint: Constraint? = {
43 | guard let relation = self.relation,
44 | let related = self.related,
45 | let sourceLocation = self.sourceLocation else {
46 | return nil
47 | }
48 | let from = ConstraintItem(target: self.item, attributes: self.attributes)
49 |
50 | return Constraint(
51 | from: from,
52 | to: related,
53 | relation: relation,
54 | sourceLocation: sourceLocation,
55 | label: self.label,
56 | multiplier: self.multiplier,
57 | constant: self.constant,
58 | priority: self.priority
59 | )
60 | }()
61 |
62 | // MARK: Initialization
63 |
64 | internal init(item: LayoutConstraintItem, attributes: ConstraintAttributes) {
65 | self.item = item
66 | self.attributes = attributes
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintInsetTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintInsetTarget: ConstraintConstantTarget {
32 | }
33 |
34 | extension Int: ConstraintInsetTarget {
35 | }
36 |
37 | extension UInt: ConstraintInsetTarget {
38 | }
39 |
40 | extension Float: ConstraintInsetTarget {
41 | }
42 |
43 | extension Double: ConstraintInsetTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintInsetTarget {
47 | }
48 |
49 | extension ConstraintInsets: ConstraintInsetTarget {
50 | }
51 |
52 | extension ConstraintInsetTarget {
53 |
54 | internal var constraintInsetTargetValue: ConstraintInsets {
55 | if let amount = self as? ConstraintInsets {
56 | return amount
57 | } else if let amount = self as? Float {
58 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
59 | } else if let amount = self as? Double {
60 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
61 | } else if let amount = self as? CGFloat {
62 | return ConstraintInsets(top: amount, left: amount, bottom: amount, right: amount)
63 | } else if let amount = self as? Int {
64 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
65 | } else if let amount = self as? UInt {
66 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
67 | } else {
68 | return ConstraintInsets(top: 0, left: 0, bottom: 0, right: 0)
69 | }
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintInsets.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | public typealias ConstraintInsets = UIEdgeInsets
33 | #else
34 | public typealias ConstraintInsets = NSEdgeInsets
35 | #endif
36 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public final class ConstraintItem {
32 |
33 | internal weak var target: AnyObject?
34 | internal let attributes: ConstraintAttributes
35 |
36 | internal init(target: AnyObject?, attributes: ConstraintAttributes) {
37 | self.target = target
38 | self.attributes = attributes
39 | }
40 |
41 | internal var layoutConstraintItem: LayoutConstraintItem? {
42 | return self.target as? LayoutConstraintItem
43 | }
44 |
45 | }
46 |
47 | public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool {
48 | // pointer equality
49 | guard lhs !== rhs else {
50 | return true
51 | }
52 |
53 | // must both have valid targets and identical attributes
54 | guard let target1 = lhs.target,
55 | let target2 = rhs.target,
56 | target1 === target2 && lhs.attributes == rhs.attributes else {
57 | return false
58 | }
59 |
60 | return true
61 | }
62 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #endif
27 |
28 |
29 | @available(iOS 9.0, OSX 10.11, *)
30 | public extension ConstraintLayoutGuide {
31 |
32 | var snp: ConstraintLayoutGuideDSL {
33 | return ConstraintLayoutGuideDSL(guide: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutGuide.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | @available(iOS 9.0, *)
33 | public typealias ConstraintLayoutGuide = UILayoutGuide
34 | #else
35 | @available(OSX 10.11, *)
36 | public typealias ConstraintLayoutGuide = NSLayoutGuide
37 | #endif
38 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | @available(iOS 9.0, OSX 10.11, *)
32 | public struct ConstraintLayoutGuideDSL: ConstraintAttributesDSL {
33 |
34 | @discardableResult
35 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
36 | return ConstraintMaker.prepareConstraints(item: self.guide, closure: closure)
37 | }
38 |
39 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
40 | ConstraintMaker.makeConstraints(item: self.guide, closure: closure)
41 | }
42 |
43 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
44 | ConstraintMaker.remakeConstraints(item: self.guide, closure: closure)
45 | }
46 |
47 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
48 | ConstraintMaker.updateConstraints(item: self.guide, closure: closure)
49 | }
50 |
51 | public func removeConstraints() {
52 | ConstraintMaker.removeConstraints(item: self.guide)
53 | }
54 |
55 | public var target: AnyObject? {
56 | return self.guide
57 | }
58 |
59 | internal let guide: ConstraintLayoutGuide
60 |
61 | internal init(guide: ConstraintLayoutGuide) {
62 | self.guide = guide
63 |
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutSupport.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | @available(iOS 8.0, *)
33 | public typealias ConstraintLayoutSupport = UILayoutSupport
34 | #else
35 | public class ConstraintLayoutSupport {}
36 | #endif
37 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | @available(iOS 8.0, *)
32 | public struct ConstraintLayoutSupportDSL: ConstraintDSL {
33 |
34 | public var target: AnyObject? {
35 | return self.support
36 | }
37 |
38 | internal let support: ConstraintLayoutSupport
39 |
40 | internal init(support: ConstraintLayoutSupport) {
41 | self.support = support
42 |
43 | }
44 |
45 | public var top: ConstraintItem {
46 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top)
47 | }
48 |
49 | public var bottom: ConstraintItem {
50 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom)
51 | }
52 |
53 | public var height: ConstraintItem {
54 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height)
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMakerEditable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerEditable: ConstraintMakerPriortizable {
32 |
33 | @discardableResult
34 | public func multipliedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable {
35 | self.description.multiplier = amount
36 | return self
37 | }
38 |
39 | @discardableResult
40 | public func dividedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable {
41 | return self.multipliedBy(1.0 / amount.constraintMultiplierTargetValue)
42 | }
43 |
44 | @discardableResult
45 | public func offset(_ amount: ConstraintOffsetTarget) -> ConstraintMakerEditable {
46 | self.description.constant = amount.constraintOffsetTargetValue
47 | return self
48 | }
49 |
50 | @discardableResult
51 | public func inset(_ amount: ConstraintInsetTarget) -> ConstraintMakerEditable {
52 | self.description.constant = amount.constraintInsetTargetValue
53 | return self
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMakerExtendable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerExtendable: ConstraintMakerRelatable {
32 |
33 | public var left: ConstraintMakerExtendable {
34 | self.description.attributes += .left
35 | return self
36 | }
37 |
38 | public var top: ConstraintMakerExtendable {
39 | self.description.attributes += .top
40 | return self
41 | }
42 |
43 | public var bottom: ConstraintMakerExtendable {
44 | self.description.attributes += .bottom
45 | return self
46 | }
47 |
48 | public var right: ConstraintMakerExtendable {
49 | self.description.attributes += .right
50 | return self
51 | }
52 |
53 | public var leading: ConstraintMakerExtendable {
54 | self.description.attributes += .leading
55 | return self
56 | }
57 |
58 | public var trailing: ConstraintMakerExtendable {
59 | self.description.attributes += .trailing
60 | return self
61 | }
62 |
63 | public var width: ConstraintMakerExtendable {
64 | self.description.attributes += .width
65 | return self
66 | }
67 |
68 | public var height: ConstraintMakerExtendable {
69 | self.description.attributes += .height
70 | return self
71 | }
72 |
73 | public var centerX: ConstraintMakerExtendable {
74 | self.description.attributes += .centerX
75 | return self
76 | }
77 |
78 | public var centerY: ConstraintMakerExtendable {
79 | self.description.attributes += .centerY
80 | return self
81 | }
82 |
83 | @available(*, deprecated, message:"Use lastBaseline instead")
84 | public var baseline: ConstraintMakerExtendable {
85 | self.description.attributes += .lastBaseline
86 | return self
87 | }
88 |
89 | public var lastBaseline: ConstraintMakerExtendable {
90 | self.description.attributes += .lastBaseline
91 | return self
92 | }
93 |
94 | @available(iOS 8.0, OSX 10.11, *)
95 | public var firstBaseline: ConstraintMakerExtendable {
96 | self.description.attributes += .firstBaseline
97 | return self
98 | }
99 |
100 | @available(iOS 8.0, *)
101 | public var leftMargin: ConstraintMakerExtendable {
102 | self.description.attributes += .leftMargin
103 | return self
104 | }
105 |
106 | @available(iOS 8.0, *)
107 | public var rightMargin: ConstraintMakerExtendable {
108 | self.description.attributes += .rightMargin
109 | return self
110 | }
111 |
112 | @available(iOS 8.0, *)
113 | public var topMargin: ConstraintMakerExtendable {
114 | self.description.attributes += .topMargin
115 | return self
116 | }
117 |
118 | @available(iOS 8.0, *)
119 | public var bottomMargin: ConstraintMakerExtendable {
120 | self.description.attributes += .bottomMargin
121 | return self
122 | }
123 |
124 | @available(iOS 8.0, *)
125 | public var leadingMargin: ConstraintMakerExtendable {
126 | self.description.attributes += .leadingMargin
127 | return self
128 | }
129 |
130 | @available(iOS 8.0, *)
131 | public var trailingMargin: ConstraintMakerExtendable {
132 | self.description.attributes += .trailingMargin
133 | return self
134 | }
135 |
136 | @available(iOS 8.0, *)
137 | public var centerXWithinMargins: ConstraintMakerExtendable {
138 | self.description.attributes += .centerXWithinMargins
139 | return self
140 | }
141 |
142 | @available(iOS 8.0, *)
143 | public var centerYWithinMargins: ConstraintMakerExtendable {
144 | self.description.attributes += .centerYWithinMargins
145 | return self
146 | }
147 |
148 | public var edges: ConstraintMakerExtendable {
149 | self.description.attributes += .edges
150 | return self
151 | }
152 | public var size: ConstraintMakerExtendable {
153 | self.description.attributes += .size
154 | return self
155 | }
156 |
157 | @available(iOS 8.0, *)
158 | public var margins: ConstraintMakerExtendable {
159 | self.description.attributes += .margins
160 | return self
161 | }
162 |
163 | @available(iOS 8.0, *)
164 | public var centerWithinMargins: ConstraintMakerExtendable {
165 | self.description.attributes += .centerWithinMargins
166 | return self
167 | }
168 |
169 | }
170 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerFinalizable {
32 |
33 | internal let description: ConstraintDescription
34 |
35 | internal init(_ description: ConstraintDescription) {
36 | self.description = description
37 | }
38 |
39 | @discardableResult
40 | public func labeled(_ label: String) -> ConstraintMakerFinalizable {
41 | self.description.label = label
42 | return self
43 | }
44 |
45 | public var constraint: Constraint {
46 | return self.description.constraint!
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerPriortizable: ConstraintMakerFinalizable {
32 |
33 | @discardableResult
34 | public func priority(_ amount: ConstraintPriority) -> ConstraintMakerFinalizable {
35 | self.description.priority = amount.value
36 | return self
37 | }
38 |
39 | @discardableResult
40 | public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable {
41 | self.description.priority = amount
42 | return self
43 | }
44 |
45 | @available(*, deprecated, message:"Use priority(.required) instead.")
46 | @discardableResult
47 | public func priorityRequired() -> ConstraintMakerFinalizable {
48 | return self.priority(.required)
49 | }
50 |
51 | @available(*, deprecated, message:"Use priority(.high) instead.")
52 | @discardableResult
53 | public func priorityHigh() -> ConstraintMakerFinalizable {
54 | return self.priority(.high)
55 | }
56 |
57 | @available(*, deprecated, message:"Use priority(.medium) instead.")
58 | @discardableResult
59 | public func priorityMedium() -> ConstraintMakerFinalizable {
60 | return self.priority(.medium)
61 | }
62 |
63 | @available(*, deprecated, message:"Use priority(.low) instead.")
64 | @discardableResult
65 | public func priorityLow() -> ConstraintMakerFinalizable {
66 | return self.priority(.low)
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMakerRelatable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerRelatable {
32 |
33 | internal let description: ConstraintDescription
34 |
35 | internal init(_ description: ConstraintDescription) {
36 | self.description = description
37 | }
38 |
39 | internal func relatedTo(_ other: ConstraintRelatableTarget, relation: ConstraintRelation, file: String, line: UInt) -> ConstraintMakerEditable {
40 | let related: ConstraintItem
41 | let constant: ConstraintConstantTarget
42 |
43 | if let other = other as? ConstraintItem {
44 | guard other.attributes == ConstraintAttributes.none ||
45 | other.attributes.layoutAttributes.count <= 1 ||
46 | other.attributes.layoutAttributes == self.description.attributes.layoutAttributes ||
47 | other.attributes == .edges && self.description.attributes == .margins ||
48 | other.attributes == .margins && self.description.attributes == .edges else {
49 | fatalError("Cannot constraint to multiple non identical attributes. (\(file), \(line))");
50 | }
51 |
52 | related = other
53 | constant = 0.0
54 | } else if let other = other as? ConstraintView {
55 | related = ConstraintItem(target: other, attributes: ConstraintAttributes.none)
56 | constant = 0.0
57 | } else if let other = other as? ConstraintConstantTarget {
58 | related = ConstraintItem(target: nil, attributes: ConstraintAttributes.none)
59 | constant = other
60 | } else if #available(iOS 9.0, OSX 10.11, *), let other = other as? ConstraintLayoutGuide {
61 | related = ConstraintItem(target: other, attributes: ConstraintAttributes.none)
62 | constant = 0.0
63 | } else {
64 | fatalError("Invalid constraint. (\(file), \(line))")
65 | }
66 |
67 | let editable = ConstraintMakerEditable(self.description)
68 | editable.description.sourceLocation = (file, line)
69 | editable.description.relation = relation
70 | editable.description.related = related
71 | editable.description.constant = constant
72 | return editable
73 | }
74 |
75 | @discardableResult
76 | public func equalTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
77 | return self.relatedTo(other, relation: .equal, file: file, line: line)
78 | }
79 |
80 | @discardableResult
81 | public func equalToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
82 | guard let other = self.description.item.superview else {
83 | fatalError("Expected superview but found nil when attempting make constraint `equalToSuperview`.")
84 | }
85 | return self.relatedTo(other, relation: .equal, file: file, line: line)
86 | }
87 |
88 | @discardableResult
89 | public func lessThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
90 | return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line)
91 | }
92 |
93 | @discardableResult
94 | public func lessThanOrEqualToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
95 | guard let other = self.description.item.superview else {
96 | fatalError("Expected superview but found nil when attempting make constraint `lessThanOrEqualToSuperview`.")
97 | }
98 | return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line)
99 | }
100 |
101 | @discardableResult
102 | public func greaterThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable {
103 | return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line)
104 | }
105 |
106 | @discardableResult
107 | public func greaterThanOrEqualToSuperview(_ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable {
108 | guard let other = self.description.item.superview else {
109 | fatalError("Expected superview but found nil when attempting make constraint `greaterThanOrEqualToSuperview`.")
110 | }
111 | return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line)
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintMultiplierTarget {
32 |
33 | var constraintMultiplierTargetValue: CGFloat { get }
34 |
35 | }
36 |
37 | extension Int: ConstraintMultiplierTarget {
38 |
39 | public var constraintMultiplierTargetValue: CGFloat {
40 | return CGFloat(self)
41 | }
42 |
43 | }
44 |
45 | extension UInt: ConstraintMultiplierTarget {
46 |
47 | public var constraintMultiplierTargetValue: CGFloat {
48 | return CGFloat(self)
49 | }
50 |
51 | }
52 |
53 | extension Float: ConstraintMultiplierTarget {
54 |
55 | public var constraintMultiplierTargetValue: CGFloat {
56 | return CGFloat(self)
57 | }
58 |
59 | }
60 |
61 | extension Double: ConstraintMultiplierTarget {
62 |
63 | public var constraintMultiplierTargetValue: CGFloat {
64 | return CGFloat(self)
65 | }
66 |
67 | }
68 |
69 | extension CGFloat: ConstraintMultiplierTarget {
70 |
71 | public var constraintMultiplierTargetValue: CGFloat {
72 | return self
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintOffsetTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintOffsetTarget: ConstraintConstantTarget {
32 | }
33 |
34 | extension Int: ConstraintOffsetTarget {
35 | }
36 |
37 | extension UInt: ConstraintOffsetTarget {
38 | }
39 |
40 | extension Float: ConstraintOffsetTarget {
41 | }
42 |
43 | extension Double: ConstraintOffsetTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintOffsetTarget {
47 | }
48 |
49 | extension ConstraintOffsetTarget {
50 |
51 | internal var constraintOffsetTargetValue: CGFloat {
52 | let offset: CGFloat
53 | if let amount = self as? Float {
54 | offset = CGFloat(amount)
55 | } else if let amount = self as? Double {
56 | offset = CGFloat(amount)
57 | } else if let amount = self as? CGFloat {
58 | offset = CGFloat(amount)
59 | } else if let amount = self as? Int {
60 | offset = CGFloat(amount)
61 | } else if let amount = self as? UInt {
62 | offset = CGFloat(amount)
63 | } else {
64 | offset = 0.0
65 | }
66 | return offset
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintPriority.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 | public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable, Strideable {
31 | public typealias FloatLiteralType = Float
32 |
33 | public let value: Float
34 |
35 | public init(floatLiteral value: Float) {
36 | self.value = value
37 | }
38 |
39 | public init(_ value: Float) {
40 | self.value = value
41 | }
42 |
43 | public static var required: ConstraintPriority {
44 | return 1000.0
45 | }
46 |
47 | public static var high: ConstraintPriority {
48 | return 750.0
49 | }
50 |
51 | public static var medium: ConstraintPriority {
52 | #if os(OSX)
53 | return 501.0
54 | #else
55 | return 500.0
56 | #endif
57 |
58 | }
59 |
60 | public static var low: ConstraintPriority {
61 | return 250.0
62 | }
63 |
64 | public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool {
65 | return lhs.value == rhs.value
66 | }
67 |
68 | // MARK: Strideable
69 |
70 | public func advanced(by n: FloatLiteralType) -> ConstraintPriority {
71 | return ConstraintPriority(floatLiteral: value + n)
72 | }
73 |
74 | public func distance(to other: ConstraintPriority) -> FloatLiteralType {
75 | return other.value - value
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintPriorityTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintPriorityTarget {
32 |
33 | var constraintPriorityTargetValue: Float { get }
34 |
35 | }
36 |
37 | extension Int: ConstraintPriorityTarget {
38 |
39 | public var constraintPriorityTargetValue: Float {
40 | return Float(self)
41 | }
42 |
43 | }
44 |
45 | extension UInt: ConstraintPriorityTarget {
46 |
47 | public var constraintPriorityTargetValue: Float {
48 | return Float(self)
49 | }
50 |
51 | }
52 |
53 | extension Float: ConstraintPriorityTarget {
54 |
55 | public var constraintPriorityTargetValue: Float {
56 | return self
57 | }
58 |
59 | }
60 |
61 | extension Double: ConstraintPriorityTarget {
62 |
63 | public var constraintPriorityTargetValue: Float {
64 | return Float(self)
65 | }
66 |
67 | }
68 |
69 | extension CGFloat: ConstraintPriorityTarget {
70 |
71 | public var constraintPriorityTargetValue: Float {
72 | return Float(self)
73 | }
74 |
75 | }
76 |
77 | #if os(iOS) || os(tvOS)
78 | extension UILayoutPriority: ConstraintPriorityTarget {
79 |
80 | public var constraintPriorityTargetValue: Float {
81 | return self.rawValue
82 | }
83 |
84 | }
85 | #endif
86 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintRelatableTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintRelatableTarget {
32 | }
33 |
34 | extension Int: ConstraintRelatableTarget {
35 | }
36 |
37 | extension UInt: ConstraintRelatableTarget {
38 | }
39 |
40 | extension Float: ConstraintRelatableTarget {
41 | }
42 |
43 | extension Double: ConstraintRelatableTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintRelatableTarget {
47 | }
48 |
49 | extension CGSize: ConstraintRelatableTarget {
50 | }
51 |
52 | extension CGPoint: ConstraintRelatableTarget {
53 | }
54 |
55 | extension ConstraintInsets: ConstraintRelatableTarget {
56 | }
57 |
58 | extension ConstraintItem: ConstraintRelatableTarget {
59 | }
60 |
61 | extension ConstraintView: ConstraintRelatableTarget {
62 | }
63 |
64 | @available(iOS 9.0, OSX 10.11, *)
65 | extension ConstraintLayoutGuide: ConstraintRelatableTarget {
66 | }
67 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintRelation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | internal enum ConstraintRelation : Int {
32 | case equal = 1
33 | case lessThanOrEqual
34 | case greaterThanOrEqual
35 |
36 | internal var layoutRelation: LayoutRelation {
37 | get {
38 | switch(self) {
39 | case .equal:
40 | return .equal
41 | case .lessThanOrEqual:
42 | return .lessThanOrEqual
43 | case .greaterThanOrEqual:
44 | return .greaterThanOrEqual
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintView+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public extension ConstraintView {
32 |
33 | @available(*, deprecated, message:"Use newer snp.* syntax.")
34 | var snp_left: ConstraintItem { return self.snp.left }
35 |
36 | @available(*, deprecated, message:"Use newer snp.* syntax.")
37 | var snp_top: ConstraintItem { return self.snp.top }
38 |
39 | @available(*, deprecated, message:"Use newer snp.* syntax.")
40 | var snp_right: ConstraintItem { return self.snp.right }
41 |
42 | @available(*, deprecated, message:"Use newer snp.* syntax.")
43 | var snp_bottom: ConstraintItem { return self.snp.bottom }
44 |
45 | @available(*, deprecated, message:"Use newer snp.* syntax.")
46 | var snp_leading: ConstraintItem { return self.snp.leading }
47 |
48 | @available(*, deprecated, message:"Use newer snp.* syntax.")
49 | var snp_trailing: ConstraintItem { return self.snp.trailing }
50 |
51 | @available(*, deprecated, message:"Use newer snp.* syntax.")
52 | var snp_width: ConstraintItem { return self.snp.width }
53 |
54 | @available(*, deprecated, message:"Use newer snp.* syntax.")
55 | var snp_height: ConstraintItem { return self.snp.height }
56 |
57 | @available(*, deprecated, message:"Use newer snp.* syntax.")
58 | var snp_centerX: ConstraintItem { return self.snp.centerX }
59 |
60 | @available(*, deprecated, message:"Use newer snp.* syntax.")
61 | var snp_centerY: ConstraintItem { return self.snp.centerY }
62 |
63 | @available(*, deprecated, message:"Use newer snp.* syntax.")
64 | var snp_baseline: ConstraintItem { return self.snp.baseline }
65 |
66 | @available(*, deprecated, message:"Use newer snp.* syntax.")
67 | @available(iOS 8.0, OSX 10.11, *)
68 | var snp_lastBaseline: ConstraintItem { return self.snp.lastBaseline }
69 |
70 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
71 | @available(iOS 8.0, OSX 10.11, *)
72 | var snp_firstBaseline: ConstraintItem { return self.snp.firstBaseline }
73 |
74 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
75 | @available(iOS 8.0, *)
76 | var snp_leftMargin: ConstraintItem { return self.snp.leftMargin }
77 |
78 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
79 | @available(iOS 8.0, *)
80 | var snp_topMargin: ConstraintItem { return self.snp.topMargin }
81 |
82 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
83 | @available(iOS 8.0, *)
84 | var snp_rightMargin: ConstraintItem { return self.snp.rightMargin }
85 |
86 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
87 | @available(iOS 8.0, *)
88 | var snp_bottomMargin: ConstraintItem { return self.snp.bottomMargin }
89 |
90 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
91 | @available(iOS 8.0, *)
92 | var snp_leadingMargin: ConstraintItem { return self.snp.leadingMargin }
93 |
94 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
95 | @available(iOS 8.0, *)
96 | var snp_trailingMargin: ConstraintItem { return self.snp.trailingMargin }
97 |
98 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
99 | @available(iOS 8.0, *)
100 | var snp_centerXWithinMargins: ConstraintItem { return self.snp.centerXWithinMargins }
101 |
102 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
103 | @available(iOS 8.0, *)
104 | var snp_centerYWithinMargins: ConstraintItem { return self.snp.centerYWithinMargins }
105 |
106 | @available(*, deprecated, message:"Use newer snp.* syntax.")
107 | var snp_edges: ConstraintItem { return self.snp.edges }
108 |
109 | @available(*, deprecated, message:"Use newer snp.* syntax.")
110 | var snp_size: ConstraintItem { return self.snp.size }
111 |
112 | @available(*, deprecated, message:"Use newer snp.* syntax.")
113 | var snp_center: ConstraintItem { return self.snp.center }
114 |
115 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
116 | @available(iOS 8.0, *)
117 | var snp_margins: ConstraintItem { return self.snp.margins }
118 |
119 | @available(iOS, deprecated, message:"Use newer snp.* syntax.")
120 | @available(iOS 8.0, *)
121 | var snp_centerWithinMargins: ConstraintItem { return self.snp.centerWithinMargins }
122 |
123 | @available(*, deprecated, message:"Use newer snp.* syntax.")
124 | func snp_prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
125 | return self.snp.prepareConstraints(closure)
126 | }
127 |
128 | @available(*, deprecated, message:"Use newer snp.* syntax.")
129 | func snp_makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
130 | self.snp.makeConstraints(closure)
131 | }
132 |
133 | @available(*, deprecated, message:"Use newer snp.* syntax.")
134 | func snp_remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
135 | self.snp.remakeConstraints(closure)
136 | }
137 |
138 | @available(*, deprecated, message:"Use newer snp.* syntax.")
139 | func snp_updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
140 | self.snp.updateConstraints(closure)
141 | }
142 |
143 | @available(*, deprecated, message:"Use newer snp.* syntax.")
144 | func snp_removeConstraints() {
145 | self.snp.removeConstraints()
146 | }
147 |
148 | var snp: ConstraintViewDSL {
149 | return ConstraintViewDSL(view: self)
150 | }
151 |
152 | }
153 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | public typealias ConstraintView = UIView
33 | #else
34 | public typealias ConstraintView = NSView
35 | #endif
36 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/ConstraintViewDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public struct ConstraintViewDSL: ConstraintAttributesDSL {
32 |
33 | @discardableResult
34 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
35 | return ConstraintMaker.prepareConstraints(item: self.view, closure: closure)
36 | }
37 |
38 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
39 | ConstraintMaker.makeConstraints(item: self.view, closure: closure)
40 | }
41 |
42 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
43 | ConstraintMaker.remakeConstraints(item: self.view, closure: closure)
44 | }
45 |
46 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
47 | ConstraintMaker.updateConstraints(item: self.view, closure: closure)
48 | }
49 |
50 | public func removeConstraints() {
51 | ConstraintMaker.removeConstraints(item: self.view)
52 | }
53 |
54 | public var contentHuggingHorizontalPriority: Float {
55 | get {
56 | return self.view.contentHuggingPriority(for: .horizontal).rawValue
57 | }
58 | set {
59 | self.view.setContentHuggingPriority(LayoutPriority(rawValue: newValue), for: .horizontal)
60 | }
61 | }
62 |
63 | public var contentHuggingVerticalPriority: Float {
64 | get {
65 | return self.view.contentHuggingPriority(for: .vertical).rawValue
66 | }
67 | set {
68 | self.view.setContentHuggingPriority(LayoutPriority(rawValue: newValue), for: .vertical)
69 | }
70 | }
71 |
72 | public var contentCompressionResistanceHorizontalPriority: Float {
73 | get {
74 | return self.view.contentCompressionResistancePriority(for: .horizontal).rawValue
75 | }
76 | set {
77 | self.view.setContentCompressionResistancePriority(LayoutPriority(rawValue: newValue), for: .horizontal)
78 | }
79 | }
80 |
81 | public var contentCompressionResistanceVerticalPriority: Float {
82 | get {
83 | return self.view.contentCompressionResistancePriority(for: .vertical).rawValue
84 | }
85 | set {
86 | self.view.setContentCompressionResistancePriority(LayoutPriority(rawValue: newValue), for: .vertical)
87 | }
88 | }
89 |
90 | public var target: AnyObject? {
91 | return self.view
92 | }
93 |
94 | internal let view: ConstraintView
95 |
96 | internal init(view: ConstraintView) {
97 | self.view = view
98 |
99 | }
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/LayoutConstraint.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class LayoutConstraint : NSLayoutConstraint {
32 |
33 | public var label: String? {
34 | get {
35 | return self.identifier
36 | }
37 | set {
38 | self.identifier = newValue
39 | }
40 | }
41 |
42 | internal weak var constraint: Constraint? = nil
43 |
44 | }
45 |
46 | internal func ==(lhs: LayoutConstraint, rhs: LayoutConstraint) -> Bool {
47 | let areLayoutAnchorsEqual: Bool
48 | if #available(iOS 10.0, OSXApplicationExtension 10.12, *) {
49 | areLayoutAnchorsEqual = lhs.firstAnchor === rhs.firstAnchor &&
50 | lhs.secondAnchor === rhs.secondAnchor
51 | } else {
52 | areLayoutAnchorsEqual = lhs.firstItem === rhs.firstItem &&
53 | lhs.secondItem === rhs.secondItem &&
54 | lhs.firstAttribute == rhs.firstAttribute &&
55 | lhs.secondAttribute == rhs.secondAttribute
56 | }
57 | return areLayoutAnchorsEqual &&
58 | lhs.relation == rhs.relation &&
59 | lhs.priority == rhs.priority &&
60 | lhs.multiplier == rhs.multiplier
61 | }
62 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/LayoutConstraintItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol LayoutConstraintItem: class {
32 | }
33 |
34 | @available(iOS 9.0, OSX 10.11, *)
35 | extension ConstraintLayoutGuide : LayoutConstraintItem {
36 | }
37 |
38 | extension ConstraintView : LayoutConstraintItem {
39 | }
40 |
41 |
42 | extension LayoutConstraintItem {
43 |
44 | internal func prepare() {
45 | if let view = self as? ConstraintView {
46 | view.translatesAutoresizingMaskIntoConstraints = false
47 | }
48 | }
49 |
50 | internal var superview: ConstraintView? {
51 | if let view = self as? ConstraintView {
52 | return view.superview
53 | }
54 |
55 | if #available(iOS 9.0, OSX 10.11, *), let guide = self as? ConstraintLayoutGuide {
56 | return guide.owningView
57 | }
58 |
59 | return nil
60 | }
61 | internal var constraints: [Constraint] {
62 | return self.constraintsSet.allObjects as! [Constraint]
63 | }
64 |
65 | internal func add(constraints: [Constraint]) {
66 | let constraintsSet = self.constraintsSet
67 | for constraint in constraints {
68 | constraintsSet.add(constraint)
69 | }
70 | }
71 |
72 | internal func remove(constraints: [Constraint]) {
73 | let constraintsSet = self.constraintsSet
74 | for constraint in constraints {
75 | constraintsSet.remove(constraint)
76 | }
77 | }
78 |
79 | private var constraintsSet: NSMutableSet {
80 | let constraintsSet: NSMutableSet
81 |
82 | if let existing = objc_getAssociatedObject(self, &constraintsKey) as? NSMutableSet {
83 | constraintsSet = existing
84 | } else {
85 | constraintsSet = NSMutableSet()
86 | objc_setAssociatedObject(self, &constraintsKey, constraintsSet, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
87 | }
88 | return constraintsSet
89 |
90 | }
91 |
92 | }
93 | private var constraintsKey: UInt8 = 0
94 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/Typealiases.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | import Foundation
25 |
26 | #if os(iOS) || os(tvOS)
27 | import UIKit
28 | #if swift(>=4.2)
29 | typealias LayoutRelation = NSLayoutConstraint.Relation
30 | typealias LayoutAttribute = NSLayoutConstraint.Attribute
31 | #else
32 | typealias LayoutRelation = NSLayoutRelation
33 | typealias LayoutAttribute = NSLayoutAttribute
34 | #endif
35 | typealias LayoutPriority = UILayoutPriority
36 | #else
37 | import AppKit
38 | typealias LayoutRelation = NSLayoutConstraint.Relation
39 | typealias LayoutAttribute = NSLayoutConstraint.Attribute
40 | typealias LayoutPriority = NSLayoutConstraint.Priority
41 | #endif
42 |
43 |
--------------------------------------------------------------------------------
/Example/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #endif
27 |
28 |
29 | @available(iOS 8.0, *)
30 | public extension ConstraintLayoutSupport {
31 |
32 | var snp: ConstraintLayoutSupportDSL {
33 | return ConstraintLayoutSupportDSL(support: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/MarqueeLabel/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 | 3.2.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/MarqueeLabel/MarqueeLabel-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 | 4.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/MarqueeLabel/MarqueeLabel-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_MarqueeLabel : NSObject
3 | @end
4 | @implementation PodsDummy_MarqueeLabel
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/MarqueeLabel/MarqueeLabel-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/MarqueeLabel/MarqueeLabel-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double MarqueeLabelVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char MarqueeLabelVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/MarqueeLabel/MarqueeLabel.modulemap:
--------------------------------------------------------------------------------
1 | framework module MarqueeLabel {
2 | umbrella header "MarqueeLabel-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/MarqueeLabel/MarqueeLabel.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MarqueeLabel
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "QuartzCore" -framework "UIKit"
4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/MarqueeLabel
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/NotificationBannerSwift/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 | 1.7.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/NotificationBannerSwift/NotificationBannerSwift-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 | 3.0.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/NotificationBannerSwift/NotificationBannerSwift-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_NotificationBannerSwift : NSObject
3 | @end
4 | @implementation PodsDummy_NotificationBannerSwift
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/NotificationBannerSwift/NotificationBannerSwift-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/NotificationBannerSwift/NotificationBannerSwift-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double NotificationBannerSwiftVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char NotificationBannerSwiftVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/NotificationBannerSwift/NotificationBannerSwift.modulemap:
--------------------------------------------------------------------------------
1 | framework module NotificationBannerSwift {
2 | umbrella header "NotificationBannerSwift-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/NotificationBannerSwift/NotificationBannerSwift.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/NotificationBannerSwift
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MarqueeLabel" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/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 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example-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 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## MarqueeLabel
5 |
6 | Copyright (c) 2011-2017 Charles Powell
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
9 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation
10 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
11 | to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
16 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
18 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 | IN THE SOFTWARE.
20 |
21 | ## NotificationBannerSwift
22 |
23 | Copyright (c) 2017-2018 Daltron
24 |
25 | Permission is hereby granted, free of charge, to any person obtaining a copy
26 | of this software and associated documentation files (the "Software"), to deal
27 | in the Software without restriction, including without limitation the rights
28 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29 | copies of the Software, and to permit persons to whom the Software is
30 | furnished to do so, subject to the following conditions:
31 |
32 | The above copyright notice and this permission notice shall be included in
33 | all copies or substantial portions of the Software.
34 |
35 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
41 | THE SOFTWARE.
42 |
43 |
44 | ## SnapKit
45 |
46 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
47 |
48 | Permission is hereby granted, free of charge, to any person obtaining a copy
49 | of this software and associated documentation files (the "Software"), to deal
50 | in the Software without restriction, including without limitation the rights
51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
52 | copies of the Software, and to permit persons to whom the Software is
53 | furnished to do so, subject to the following conditions:
54 |
55 | The above copyright notice and this permission notice shall be included in
56 | all copies or substantial portions of the Software.
57 |
58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
64 | THE SOFTWARE.
65 |
66 | Generated by CocoaPods - https://cocoapods.org
67 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2011-2017 Charles Powell
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
20 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation
21 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
22 | to permit persons to whom the Software is furnished to do so, subject to the following conditions:
23 |
24 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
25 |
26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
27 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
29 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 | IN THE SOFTWARE.
31 | License
32 | MIT
33 | Title
34 | MarqueeLabel
35 | Type
36 | PSGroupSpecifier
37 |
38 |
39 | FooterText
40 | Copyright (c) 2017-2018 Daltron <daltonhint4@gmail.com>
41 |
42 | Permission is hereby granted, free of charge, to any person obtaining a copy
43 | of this software and associated documentation files (the "Software"), to deal
44 | in the Software without restriction, including without limitation the rights
45 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
46 | copies of the Software, and to permit persons to whom the Software is
47 | furnished to do so, subject to the following conditions:
48 |
49 | The above copyright notice and this permission notice shall be included in
50 | all copies or substantial portions of the Software.
51 |
52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
54 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
55 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
56 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
57 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
58 | THE SOFTWARE.
59 |
60 | License
61 | MIT
62 | Title
63 | NotificationBannerSwift
64 | Type
65 | PSGroupSpecifier
66 |
67 |
68 | FooterText
69 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
70 |
71 | Permission is hereby granted, free of charge, to any person obtaining a copy
72 | of this software and associated documentation files (the "Software"), to deal
73 | in the Software without restriction, including without limitation the rights
74 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
75 | copies of the Software, and to permit persons to whom the Software is
76 | furnished to do so, subject to the following conditions:
77 |
78 | The above copyright notice and this permission notice shall be included in
79 | all copies or substantial portions of the Software.
80 |
81 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
82 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
83 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
84 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
85 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
86 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
87 | THE SOFTWARE.
88 |
89 | License
90 | MIT
91 | Title
92 | SnapKit
93 | Type
94 | PSGroupSpecifier
95 |
96 |
97 | FooterText
98 | Generated by CocoaPods - https://cocoapods.org
99 | Title
100 |
101 | Type
102 | PSGroupSpecifier
103 |
104 |
105 | StringsTable
106 | Acknowledgements
107 | Title
108 | Acknowledgements
109 |
110 |
111 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_NotificationBanner_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_NotificationBanner_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_NotificationBanner_ExampleVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_NotificationBanner_ExampleVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MarqueeLabel" "${PODS_CONFIGURATION_BUILD_DIR}/NotificationBannerSwift" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_ROOT}/Reveal-SDK/RevealServer/iOS"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MarqueeLabel/MarqueeLabel.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/NotificationBannerSwift/NotificationBannerSwift.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
6 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "MarqueeLabel" -framework "NotificationBannerSwift" -framework "QuartzCore" -framework "RevealServer" -framework "SnapKit" -framework "UIKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_NotificationBanner_Example {
2 | umbrella header "Pods-NotificationBanner_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-NotificationBanner_Example/Pods-NotificationBanner_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MarqueeLabel" "${PODS_CONFIGURATION_BUILD_DIR}/NotificationBannerSwift" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MarqueeLabel/MarqueeLabel.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/NotificationBannerSwift/NotificationBannerSwift.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
6 | OTHER_LDFLAGS = $(inherited) -framework "MarqueeLabel" -framework "NotificationBannerSwift" -framework "QuartzCore" -framework "SnapKit" -framework "UIKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Reveal-SDK/Reveal-SDK.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Reveal-SDK
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Reveal-SDK/RevealServer/iOS"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks
5 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "QuartzCore"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}
9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Reveal-SDK
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/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 | 4.0.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit-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 | 5.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SnapKit : NSObject
3 | @end
4 | @implementation PodsDummy_SnapKit
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double SnapKitVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit.modulemap:
--------------------------------------------------------------------------------
1 | framework module SnapKit {
2 | umbrella header "SnapKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/SnapKit/SnapKit.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SnapKit
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SnapKit
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2017-2018 Daltron
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 |
--------------------------------------------------------------------------------
/NotificationBanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/NotificationBanner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/NotificationBanner.xcodeproj/xcshareddata/xcschemes/NotificationBanner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/NotificationBanner/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/.gitkeep
--------------------------------------------------------------------------------
/NotificationBanner/Assets/basic.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/basic.gif
--------------------------------------------------------------------------------
/NotificationBanner/Assets/custom.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/custom.gif
--------------------------------------------------------------------------------
/NotificationBanner/Assets/floating.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/floating.gif
--------------------------------------------------------------------------------
/NotificationBanner/Assets/growing.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/growing.gif
--------------------------------------------------------------------------------
/NotificationBanner/Assets/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/header.png
--------------------------------------------------------------------------------
/NotificationBanner/Assets/side_views.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/side_views.gif
--------------------------------------------------------------------------------
/NotificationBanner/Assets/stacked.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/stacked.gif
--------------------------------------------------------------------------------
/NotificationBanner/Assets/status_bar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Assets/status_bar.gif
--------------------------------------------------------------------------------
/NotificationBanner/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maheshbutani/NotificationBannerSwift-customizable-in-app-notification-/7ccd53e0327a192bb7ab8950b60179831429dceb/NotificationBanner/Classes/.gitkeep
--------------------------------------------------------------------------------
/NotificationBanner/Classes/BannerColors.swift:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | The MIT License (MIT)
4 | Copyright (c) 2017-2018 Dalton Hinterscher
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
7 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
14 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
15 | THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
17 | */
18 |
19 | import UIKit
20 |
21 | @objc
22 | public protocol BannerColorsProtocol {
23 | func color(for style: BannerStyle) -> UIColor
24 | }
25 |
26 | public class BannerColors: BannerColorsProtocol {
27 |
28 | public func color(for style: BannerStyle) -> UIColor {
29 | switch style {
30 | case .danger: return UIColor(red:0.90, green:0.31, blue:0.26, alpha:1.00)
31 | case .info: return UIColor(red:0.23, green:0.60, blue:0.85, alpha:1.00)
32 | case .customView: return UIColor.clear
33 | case .success: return UIColor(red:0.22, green:0.80, blue:0.46, alpha:1.00)
34 | case .warning: return UIColor(red:1.00, green:0.66, blue:0.16, alpha:1.00)
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/NotificationBanner/Classes/BannerHapticGenerator.swift:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | The MIT License (MIT)
4 | Copyright (c) 2017-2018 Dalton Hinterscher
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
7 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
14 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
15 | THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
17 | */
18 |
19 | import UIKit
20 |
21 | public enum BannerHaptic {
22 | case light
23 | case medium
24 | case heavy
25 | case none
26 |
27 | @available(iOS 10.0, *)
28 | var impactStyle: UIImpactFeedbackGenerator.FeedbackStyle? {
29 | switch self {
30 | case .light: return .light
31 | case .medium: return .medium
32 | case .heavy: return .heavy
33 | case .none: return nil
34 | }
35 | }
36 | }
37 |
38 | open class BannerHapticGenerator: NSObject {
39 |
40 | /**
41 | Generates a haptic based on the given haptic
42 | -parameter haptic: The haptic strength to generate when a banner is shown
43 | */
44 | open class func generate(_ haptic: BannerHaptic) {
45 | if #available(iOS 10.0, *) {
46 | if let style = haptic.impactStyle {
47 | let feedbackGenerator = UIImpactFeedbackGenerator(style: style)
48 | feedbackGenerator.prepare()
49 | feedbackGenerator.impactOccurred()
50 | }
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/NotificationBanner/Classes/BannerPositionFrame.swift:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | The MIT License (MIT)
4 | Copyright (c) 2017-2018 Dalton Hinterscher
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
7 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
14 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
15 | THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
17 | */
18 |
19 | import UIKit
20 |
21 | @objc
22 | public enum BannerPosition: Int {
23 | case bottom
24 | case top
25 | }
26 |
27 | class BannerPositionFrame: NSObject {
28 |
29 | private(set) var startFrame: CGRect!
30 | private(set) var endFrame: CGRect!
31 |
32 | init(bannerPosition: BannerPosition,
33 | bannerWidth: CGFloat,
34 | bannerHeight: CGFloat,
35 | maxY: CGFloat,
36 | finishYOffset: CGFloat = 0,
37 | edgeInsets: UIEdgeInsets?) {
38 | super.init()
39 | self.startFrame = startFrame(for: bannerPosition, bannerWidth: bannerWidth, bannerHeight: bannerHeight, maxY: maxY, edgeInsets: edgeInsets)
40 | self.endFrame = endFrame(for: bannerPosition, bannerWidth: bannerWidth, bannerHeight: bannerHeight, maxY: maxY, finishYOffset: finishYOffset, edgeInsets: edgeInsets)
41 | }
42 |
43 | /**
44 | Returns the start frame for the notification banner based on the given banner position
45 | - parameter bannerPosition: The position the notification banners should slide in from
46 | - parameter bannerWidth: The width of the notification banner
47 | - parameter bannerHeight: The height of the notification banner
48 | - parameter maxY: The maximum `y` position the banner can slide in from. This value is only used
49 | if the bannerPosition is .bottom
50 | - parameter edgeInsets: The sides edges insets from superview
51 | */
52 | private func startFrame(for bannerPosition: BannerPosition,
53 | bannerWidth: CGFloat,
54 | bannerHeight: CGFloat,
55 | maxY: CGFloat,
56 | edgeInsets: UIEdgeInsets?) -> CGRect {
57 |
58 | let edgeInsets = edgeInsets ?? .zero
59 |
60 | switch bannerPosition {
61 | case .bottom:
62 | return CGRect(x: edgeInsets.left,
63 | y: maxY,
64 | width: bannerWidth - edgeInsets.left - edgeInsets.right,
65 | height: bannerHeight)
66 | case .top:
67 | return CGRect(x: edgeInsets.left,
68 | y: -bannerHeight,
69 | width: bannerWidth - edgeInsets.left - edgeInsets.right,
70 | height: bannerHeight)
71 |
72 | }
73 | }
74 |
75 | /**
76 | Returns the end frame for the notification banner based on the given banner position
77 | - parameter bannerPosition: The position the notification banners should slide in from
78 | - parameter bannerWidth: The width of the notification banner
79 | - parameter bannerHeight: The height of the notification banner
80 | - parameter maxY: The maximum `y` position the banner can slide in from. This value is only used if the bannerPosition is .bottom
81 | - parameter finishYOffset: The `y` position offset the banner can slide in. Used for displaying several banenrs simaltaneously
82 | - parameter edgeInsets: The sides edges insets from superview
83 | */
84 | private func endFrame(for bannerPosition: BannerPosition,
85 | bannerWidth: CGFloat,
86 | bannerHeight: CGFloat,
87 | maxY: CGFloat,
88 | finishYOffset: CGFloat = 0,
89 | edgeInsets: UIEdgeInsets?) -> CGRect {
90 |
91 | let edgeInsets = edgeInsets ?? .zero
92 |
93 | switch bannerPosition {
94 | case .bottom:
95 | return CGRect(x: edgeInsets.left,
96 | y: maxY - bannerHeight - edgeInsets.bottom - finishYOffset,
97 | width: startFrame.width,
98 | height: startFrame.height)
99 | case .top:
100 | return CGRect(x: edgeInsets.left,
101 | y: edgeInsets.top + finishYOffset,
102 | width: startFrame.width,
103 | height: startFrame.height)
104 | }
105 | }
106 |
107 | }
108 |
--------------------------------------------------------------------------------
/NotificationBanner/Classes/BannerStyle.swift:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | The MIT License (MIT)
4 | Copyright (c) 2017-2018 Dalton Hinterscher
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
7 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
14 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
15 | THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
17 | */
18 |
19 | import Foundation
20 |
21 | @objc
22 | public enum BannerStyle: Int {
23 | case danger
24 | case info
25 | case customView
26 | case success
27 | case warning
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/NotificationBanner/Classes/NotificationBannerQueue.swift:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | The MIT License (MIT)
4 | Copyright (c) 2017-2018 Dalton Hinterscher
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
7 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
14 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
15 | THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
17 | */
18 |
19 | import UIKit
20 |
21 | @objc
22 | public enum QueuePosition: Int {
23 | case back
24 | case front
25 | }
26 |
27 | @objcMembers
28 | open class NotificationBannerQueue: NSObject {
29 |
30 | /// The default instance of the NotificationBannerQueue
31 | public static let `default` = NotificationBannerQueue()
32 |
33 | /// The notification banners currently placed on the queue
34 | private(set) var banners: [BaseNotificationBanner] = []
35 |
36 | /// The notification banners currently placed on the queue
37 | private(set) var maxBannersOnScreenSimultaneously: Int = 1
38 |
39 | /// The current number of notification banners on the queue
40 | public var numberOfBanners: Int {
41 | return banners.count
42 | }
43 |
44 | public init(maxBannersOnScreenSimultaneously: Int = 1) {
45 | self.maxBannersOnScreenSimultaneously = maxBannersOnScreenSimultaneously
46 | }
47 |
48 | /**
49 | Adds a banner to the queue
50 | -parameter banner: The notification banner to add to the queue
51 | -parameter queuePosition: The position to show the notification banner. If the position is .front, the
52 | banner will be displayed immediately
53 | */
54 | func addBanner(_ banner: BaseNotificationBanner,
55 | bannerPosition: BannerPosition,
56 | queuePosition: QueuePosition) {
57 |
58 | if queuePosition == .back {
59 | banners.append(banner)
60 |
61 | let bannersCount = banners.filter { $0.isDisplaying }.count
62 | if bannersCount < maxBannersOnScreenSimultaneously {
63 | banner.show(placeOnQueue: false, bannerPosition: banner.bannerPosition)
64 | }
65 |
66 | } else {
67 | banner.show(placeOnQueue: false, bannerPosition: bannerPosition)
68 |
69 | if let firstBanner = firstNotDisplayedBanner() {
70 | firstBanner.suspend()
71 | }
72 |
73 | banners.insert(banner, at: 0)
74 | }
75 |
76 | }
77 |
78 | /**
79 | Removes a banner from the queue
80 | -parameter banner: A notification banner to remove from the queue.
81 | */
82 | func removeBanner(_ banner: BaseNotificationBanner) {
83 |
84 | if let index = banners.firstIndex(of: banner) {
85 | banners.remove(at: index)
86 | }
87 |
88 | banners.forEach {
89 | $0.updateBannerPositionFrames()
90 | if $0.isDisplaying {
91 | $0.animateUpdatedBannerPositionFrames()
92 | }
93 | }
94 | }
95 |
96 | /**
97 | Shows the next notificaiton banner on the queue if one exists
98 | -parameter callback: The closure to execute after a banner is shown or when the queue is empty
99 | */
100 | func showNext(callback: ((_ isEmpty: Bool) -> Void)) {
101 |
102 | if let banner = firstNotDisplayedBanner() {
103 |
104 | if banner.isSuspended {
105 | banner.resume()
106 | } else {
107 | banner.show(placeOnQueue: false, bannerPosition: banner.bannerPosition)
108 | }
109 |
110 | callback(false)
111 | }
112 | else {
113 | callback(true)
114 | return
115 | }
116 | }
117 |
118 | func firstNotDisplayedBanner() -> BaseNotificationBanner? {
119 | return banners.filter { !$0.isDisplaying }.first
120 | }
121 |
122 | /**
123 | Removes all notification banners from the queue
124 | */
125 | public func removeAll() {
126 | banners.removeAll()
127 | }
128 |
129 | /**
130 | Forced dissmiss all notification banners from the queue
131 | */
132 | public func dismissAllForced() {
133 | banners.forEach { $0.dismiss(forced: true) }
134 | banners.removeAll()
135 | }
136 |
137 | }
138 |
139 |
--------------------------------------------------------------------------------
/NotificationBanner/Classes/NotificationBannerUtilities.swift:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | The MIT License (MIT)
4 | Copyright (c) 2017-2018 Dalton Hinterscher
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
7 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
14 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
15 | THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
17 | */
18 |
19 | import UIKit
20 |
21 | class NotificationBannerUtilities: NSObject {
22 |
23 | class func isNotchFeaturedIPhone() -> Bool {
24 | if #available(iOS 11, *) {
25 | if UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0 > CGFloat(0) {
26 | return true
27 | } else {
28 | return false
29 | }
30 | } else {
31 | return false
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/NotificationBanner/Classes/StatusBarNotificationBanner.swift:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | The MIT License (MIT)
4 | Copyright (c) 2017-2018 Dalton Hinterscher
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
7 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
14 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
15 | THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
17 | */
18 |
19 | import UIKit
20 |
21 | import MarqueeLabel
22 |
23 | @objcMembers
24 | open class StatusBarNotificationBanner: BaseNotificationBanner {
25 |
26 | public override var bannerHeight: CGFloat {
27 | get {
28 | if let customBannerHeight = customBannerHeight {
29 | return customBannerHeight
30 | } else if shouldAdjustForNotchFeaturedIphone() {
31 | return 50.0
32 | } else {
33 | return 20.0 + heightAdjustment
34 | }
35 | } set {
36 | customBannerHeight = newValue
37 | }
38 | }
39 |
40 | override init(style: BannerStyle, colors: BannerColorsProtocol? = nil) {
41 | super.init(style: style, colors: colors)
42 |
43 | titleLabel = MarqueeLabel()
44 | (titleLabel as! MarqueeLabel).animationDelay = 2
45 | (titleLabel as! MarqueeLabel).type = .leftRight
46 | titleLabel!.font = UIFont.systemFont(ofSize: 12.5, weight: UIFont.Weight.bold)
47 | titleLabel!.textAlignment = .center
48 | titleLabel!.textColor = .white
49 | contentView.addSubview(titleLabel!)
50 |
51 | titleLabel!.snp.makeConstraints { (make) in
52 | make.top.equalToSuperview().offset(heightAdjustment)
53 | make.left.equalToSuperview().offset(5)
54 | make.right.equalToSuperview().offset(-5)
55 | make.bottom.equalToSuperview()
56 | }
57 |
58 | updateMarqueeLabelsDurations()
59 | }
60 |
61 | public convenience init(title: String,
62 | style: BannerStyle = .info,
63 | colors: BannerColorsProtocol? = nil) {
64 | self.init(style: style, colors: colors)
65 | titleLabel!.text = title
66 | }
67 |
68 | public convenience init(attributedTitle: NSAttributedString,
69 | style: BannerStyle = .info,
70 | colors: BannerColorsProtocol? = nil) {
71 | self.init(style: style, colors: colors)
72 | titleLabel!.attributedText = attributedTitle
73 | }
74 |
75 | public init(customView: UIView) {
76 | super.init(style: .customView)
77 | self.customView = customView
78 |
79 | contentView.addSubview(customView)
80 | customView.snp.makeConstraints { make in
81 | make.edges.equalTo(contentView)
82 | }
83 |
84 | spacerView.backgroundColor = customView.backgroundColor
85 | }
86 |
87 | required public init?(coder aDecoder: NSCoder) {
88 | super.init(coder: aDecoder)
89 | }
90 |
91 | }
92 |
93 | public extension StatusBarNotificationBanner {
94 |
95 | func applyStyling(titleColor: UIColor? = nil,
96 | titleTextAlign: NSTextAlignment? = nil) {
97 |
98 | if let titleColor = titleColor {
99 | titleLabel!.textColor = titleColor
100 | }
101 |
102 | if let titleTextAlign = titleTextAlign {
103 | titleLabel!.textAlignment = titleTextAlign
104 | }
105 | }
106 |
107 | }
108 |
--------------------------------------------------------------------------------
/NotificationBanner/Classes/String+heightForConstrainedWidth.swift:
--------------------------------------------------------------------------------
1 | //
2 | // String+heightForConstrainedWidth.swift
3 | // NotificationBanner
4 | //
5 | // Created by Sascha Gordner on 03.10.18.
6 | // Copyright © 2018 Dalton Hinterscher. All rights reserved.
7 | //
8 | // https://stackoverflow.com/questions/30450434/figure-out-size-of-uilabel-based-on-string-in-swift
9 |
10 | import UIKit
11 |
12 | public extension String {
13 |
14 | /// Calculates the height a label will need in order to display the String for the given width and font.
15 | ///
16 | /// - Parameters:
17 | /// - width: Max width of the bounding rect
18 | /// - font: Font used to render the string
19 | /// - Returns: Height a string will need to be completely visible
20 | func height(forConstrainedWidth width: CGFloat, font: UIFont) -> CGFloat {
21 | let constraintRect = CGSize(width: width, height: .greatestFiniteMagnitude)
22 | let boundingBox = self.boundingRect(with: constraintRect, options: [.usesLineFragmentOrigin, .usesFontLeading], attributes: [.font: font], context: nil)
23 | return boundingBox.height
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/NotificationBanner/Classes/UIWindow+orientation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIWindow+orientation.swift
3 | // NotificationBannerSwift
4 | //
5 | // Created by gabmarfer on 15/10/2019.
6 | //
7 |
8 | import UIKit
9 |
10 | extension UIWindow {
11 |
12 | public var width: CGFloat {
13 | let orientation = UIDevice.current.orientation
14 | switch orientation {
15 | case .landscapeLeft, .landscapeRight:
16 | return max(frame.width, frame.height)
17 | case .portrait, .portraitUpsideDown:
18 | return min(frame.width, frame.height)
19 | default:
20 | return frame.width
21 | }
22 | }
23 |
24 | public var height: CGFloat {
25 | let orientation = UIDevice.current.orientation
26 | switch orientation {
27 | case .landscapeLeft, .landscapeRight:
28 | return min(frame.width, frame.height)
29 | case .portrait, .portraitUpsideDown:
30 | return max(frame.width, frame.height)
31 | default:
32 | return frame.height
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/NotificationBanner/Supporting Files/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 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/NotificationBanner/Supporting Files/NotificationBanner.h:
--------------------------------------------------------------------------------
1 | //
2 | // NotificationBanner.h
3 | // NotificationBanner
4 | //
5 | // Created by Cihat Gündüz on 02.05.17.
6 | // Copyright © 2017-2018 Dalton Hinterscher. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for NotificationBanner.
12 | FOUNDATION_EXPORT double NotificationBannerVersionNumber;
13 |
14 | //! Project version string for NotificationBanner.
15 | FOUNDATION_EXPORT const unsigned char NotificationBannerVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/NotificationBannerSwift.podspec:
--------------------------------------------------------------------------------
1 |
2 | Pod::Spec.new do |s|
3 | s.name = 'NotificationBannerSwift'
4 | s.version = '3.0.2'
5 | s.summary = 'The easiest way to display in app notification banners in iOS.'
6 |
7 | s.description = <<-DESC
8 | NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banners and drop down alerts an absolute breeze in iOS.
9 | DESC
10 |
11 | s.homepage = 'https://github.com/Daltron/NotificationBanner'
12 | s.license = { :type => 'MIT', :file => 'LICENSE' }
13 | s.author = { 'Daltron' => 'daltonhint4@gmail.com' }
14 | s.source = { :git => 'https://github.com/Daltron/NotificationBanner.git', :tag => s.version.to_s }
15 |
16 | s.ios.deployment_target = '10.0'
17 | s.swift_version = '5.0'
18 | s.source_files = 'NotificationBanner/Classes/**/*'
19 |
20 | s.dependency 'SnapKit', '~> 5.0.0'
21 | s.dependency 'MarqueeLabel', '~> 4.0.0'
22 |
23 | end
24 |
--------------------------------------------------------------------------------
/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "object": {
3 | "pins": [
4 | {
5 | "package": "MarqueeLabel",
6 | "repositoryURL": "https://github.com/cbpowell/MarqueeLabel",
7 | "state": {
8 | "branch": null,
9 | "revision": "0a95aef9ab924ec93eb6e8c7fe896abaaf1aa172",
10 | "version": "4.0.1"
11 | }
12 | },
13 | {
14 | "package": "SnapKit",
15 | "repositoryURL": "https://github.com/SnapKit/SnapKit",
16 | "state": {
17 | "branch": null,
18 | "revision": "d458564516e5676af9c70b4f4b2a9178294f1bc6",
19 | "version": "5.0.1"
20 | }
21 | }
22 | ]
23 | },
24 | "version": 1
25 | }
26 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.0
2 | import PackageDescription
3 |
4 | let package = Package(
5 | name: "NotificationBannerSwift",
6 | platforms: [
7 | .iOS(.v10)
8 | ],
9 | products: [
10 | .library(name: "NotificationBannerSwift", targets: ["NotificationBannerSwift"])
11 | ],
12 | dependencies: [
13 | .package(url: "https://github.com/SnapKit/SnapKit", from: "5.0.1"),
14 | .package(url: "https://github.com/cbpowell/MarqueeLabel", from: "4.0.1")
15 | ],
16 | targets: [
17 | .target(
18 | name: "NotificationBannerSwift",
19 | dependencies: [.byName(name: "MarqueeLabel"), .byName(name: "SnapKit")],
20 | path: "NotificationBanner/Classes"
21 | )
22 | ],
23 | swiftLanguageVersions: [.v5]
24 | )
25 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------