├── .gitignore
├── .travis.yml
├── Example
├── JXBanner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── JXBanner-Example.xcscheme
├── JXBanner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── JXBanner
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ ├── Demo
│ │ ├── JXCustomVC.swift
│ │ ├── JXCycleWayVC.swift
│ │ ├── JXDefaultVC.swift
│ │ ├── JXMiddleTargetVC
│ │ │ ├── JXMiddleTargetCell.swift
│ │ │ ├── JXMiddleTargetCell.xib
│ │ │ └── JXMiddleTargetVC.swift
│ │ ├── JXScrollViewVC
│ │ │ ├── JXScrollViewCell.swift
│ │ │ ├── JXScrollViewCell.xib
│ │ │ └── JXScrollViewVC.swift
│ │ └── JXTransformCustomVC
│ │ │ ├── JXCustomTransform.swift
│ │ │ └── JXTransformCustomVC.swift
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ ├── banner_placeholder.imageset
│ │ │ ├── Contents.json
│ │ │ └── banner_placeholder.png
│ │ └── placeholder.imageset
│ │ │ ├── Contents.json
│ │ │ └── placeholder.png
│ ├── Info.plist
│ ├── Main.storyboard
│ ├── mp4
│ │ ├── mp4_0.jpg
│ │ ├── mp4_1.jpg
│ │ ├── mp4_2.jpg
│ │ ├── mp4_3.jpg
│ │ └── mp4_4.jpg
│ └── source
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ ├── 10.jpg
│ │ ├── 11.jpg
│ │ ├── 12.jpg
│ │ ├── 13.jpg
│ │ ├── 14.jpg
│ │ ├── 15.jpg
│ │ ├── 2.jpg
│ │ ├── 3.jpg
│ │ ├── 4.jpg
│ │ ├── 5.jpg
│ │ ├── 6.jpg
│ │ ├── 7.jpg
│ │ ├── 8.jpg
│ │ └── 9.jpg
├── Podfile
├── Podfile.lock
├── Pods
│ ├── JXBanner
│ │ ├── JXBanner
│ │ │ └── Classes
│ │ │ │ ├── Banner
│ │ │ │ ├── API
│ │ │ │ │ ├── JXBannerDataSource.swift
│ │ │ │ │ ├── JXBannerDelegate.swift
│ │ │ │ │ ├── JXBannerLayoutParams.swift
│ │ │ │ │ ├── JXBannerParams.swift
│ │ │ │ │ ├── JXBannerTransformable.swift
│ │ │ │ │ └── JXBannerType.swift
│ │ │ │ ├── Banner
│ │ │ │ │ ├── JXBanner.swift
│ │ │ │ │ ├── JXBannerLayout.swift
│ │ │ │ │ └── JXBaseBanner.swift
│ │ │ │ ├── Cell
│ │ │ │ │ ├── JXBannerBaseCell.swift
│ │ │ │ │ └── JXBannerCell.swift
│ │ │ │ ├── Common
│ │ │ │ │ ├── IndexPath+JXCalculate.swift
│ │ │ │ │ ├── Timer+JXBExtension.swift
│ │ │ │ │ └── View+JXExtension.swift
│ │ │ │ └── Transform
│ │ │ │ │ ├── JXBannerTransformContext.swift
│ │ │ │ │ ├── JXBannerTransformCoverflow.swift
│ │ │ │ │ ├── JXBannerTransformLinear.swift
│ │ │ │ │ └── JXBannerTransfrom.swift
│ │ │ │ └── PageControl
│ │ │ │ ├── JXBannerPageControlBuilder.swift
│ │ │ │ └── JXBannerPageControlDefault.swift
│ │ ├── LICENSE
│ │ └── README.md
│ ├── JXPageControl
│ │ ├── JXPageControl
│ │ │ └── Classes
│ │ │ │ ├── Common
│ │ │ │ ├── JXPageControlBase.swift
│ │ │ │ ├── JXPageControlTool.swift
│ │ │ │ └── JXPageControlType.swift
│ │ │ │ ├── Jump
│ │ │ │ ├── JXPageControlBoldLine.swift
│ │ │ │ ├── JXPageControlEllipse.swift
│ │ │ │ ├── JXPageControlJump.swift
│ │ │ │ └── JXPageControlLine.swift
│ │ │ │ └── Transform
│ │ │ │ ├── JXPageControlChameleon.swift
│ │ │ │ ├── JXPageControlExchange.swift
│ │ │ │ ├── JXPageControlFill.swift
│ │ │ │ └── JXPageControlScale.swift
│ │ ├── LICENSE
│ │ └── README.md
│ ├── Local Podspecs
│ │ └── JXBanner.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ ├── 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
│ │ ├── JXBanner
│ │ ├── JXBanner-Info.plist
│ │ ├── JXBanner-dummy.m
│ │ ├── JXBanner-prefix.pch
│ │ ├── JXBanner-umbrella.h
│ │ ├── JXBanner.modulemap
│ │ └── JXBanner.xcconfig
│ │ ├── JXPageControl
│ │ ├── JXPageControl-Info.plist
│ │ ├── JXPageControl-dummy.m
│ │ ├── JXPageControl-prefix.pch
│ │ ├── JXPageControl-umbrella.h
│ │ ├── JXPageControl.modulemap
│ │ └── JXPageControl.xcconfig
│ │ ├── Pods-JXBanner_Example
│ │ ├── Pods-JXBanner_Example-Info.plist
│ │ ├── Pods-JXBanner_Example-acknowledgements.markdown
│ │ ├── Pods-JXBanner_Example-acknowledgements.plist
│ │ ├── Pods-JXBanner_Example-dummy.m
│ │ ├── Pods-JXBanner_Example-frameworks.sh
│ │ ├── Pods-JXBanner_Example-umbrella.h
│ │ ├── Pods-JXBanner_Example.debug.xcconfig
│ │ ├── Pods-JXBanner_Example.modulemap
│ │ └── Pods-JXBanner_Example.release.xcconfig
│ │ └── SnapKit
│ │ ├── SnapKit-Info.plist
│ │ ├── SnapKit-dummy.m
│ │ ├── SnapKit-prefix.pch
│ │ ├── SnapKit-umbrella.h
│ │ ├── SnapKit.modulemap
│ │ └── SnapKit.xcconfig
└── Tests
│ ├── Info.plist
│ └── Tests.swift
├── JXBanner.podspec
├── JXBanner
├── Assets
│ └── .gitkeep
└── Classes
│ ├── Banner
│ ├── API
│ │ ├── JXBannerDataSource.swift
│ │ ├── JXBannerDelegate.swift
│ │ ├── JXBannerLayoutParams.swift
│ │ ├── JXBannerParams.swift
│ │ ├── JXBannerTransformable.swift
│ │ └── JXBannerType.swift
│ ├── Banner
│ │ ├── JXBanner.swift
│ │ ├── JXBannerLayout.swift
│ │ └── JXBaseBanner.swift
│ ├── Cell
│ │ ├── JXBannerBaseCell.swift
│ │ └── JXBannerCell.swift
│ ├── Common
│ │ ├── IndexPath+JXCalculate.swift
│ │ ├── Timer+JXBExtension.swift
│ │ └── View+JXExtension.swift
│ └── Transform
│ │ ├── JXBannerTransformContext.swift
│ │ ├── JXBannerTransformCoverflow.swift
│ │ ├── JXBannerTransformLinear.swift
│ │ └── JXBannerTransfrom.swift
│ └── PageControl
│ ├── JXBannerPageControlBuilder.swift
│ └── JXBannerPageControlDefault.swift
├── LICENSE
├── README.md
├── ReleaseNote.md
├── _Pods.xcodeproj
└── gif
├── banner.gif
├── coverflow.gif
├── custom.gif
├── default.gif
├── linear.gif
├── middleTarget.gif
└── scrollView.gif
/.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 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
26 | # Carthage/Checkouts
27 |
28 | Carthage/Build
29 |
30 | # We recommend against adding the Pods directory to your .gitignore. However
31 | # you should judge for yourself, the pros and cons are mentioned at:
32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
33 | #
34 | # Note: if you ignore the Pods directory, make sure to uncomment
35 | # `pod install` in .travis.yml
36 | #
37 | # Pods/
38 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/
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 -enableCodeCoverage YES -workspace Example/JXBanner.xcworkspace -scheme JXBanner-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
14 | - pod lib lint
15 |
--------------------------------------------------------------------------------
/Example/JXBanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/JXBanner.xcodeproj/xcshareddata/xcschemes/JXBanner-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 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/Example/JXBanner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/JXBanner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/JXBanner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // JXBanner
4 | //
5 | // Created by Code_TanJX on 05/10/2019.
6 | // Copyright (c) 2019 Code_TanJX. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/Example/JXBanner/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
25 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Example/JXBanner/Demo/JXDefaultVC.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXDefaultVC.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/7/30.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 | import JXBanner
12 |
13 | class JXDefaultVC: UIViewController {
14 |
15 | var pageCount = 5
16 |
17 | @IBOutlet weak var banner: JXBanner!
18 | @IBOutlet weak var verticalBanner: JXBanner!
19 |
20 | override func viewDidLoad() {
21 | super.viewDidLoad()
22 | banner.placeholderImgView.image = UIImage(named: "banner_placeholder")
23 | banner.indentify = "banner"
24 | banner.delegate = self
25 | banner.dataSource = self
26 | verticalBanner.placeholderImgView.image = UIImage(named: "banner_placeholder")
27 | verticalBanner.delegate = self
28 | verticalBanner.dataSource = self
29 |
30 | self.automaticallyAdjustsScrollViewInsets = false
31 | }
32 |
33 | deinit {
34 | print("\(#function) ----------> \(#file.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? #file)")
35 | }
36 |
37 | override func touchesBegan(_ touches: Set, with event: UIEvent?) {
38 | banner.reloadView()
39 | }
40 | }
41 |
42 | //MARK:- JXBannerDataSource
43 | extension JXDefaultVC: JXBannerDataSource {
44 |
45 | func jxBanner(_ banner: JXBannerType)
46 | -> (JXBannerCellRegister) {
47 | return JXBannerCellRegister(type: JXBannerCell.self,
48 | reuseIdentifier: "JXDefaultVCCell")
49 | }
50 |
51 | func jxBanner(numberOfItems banner: JXBannerType)
52 | -> Int { return pageCount }
53 |
54 | func jxBanner(_ banner: JXBannerType,
55 | cellForItemAt index: Int,
56 | cell: UICollectionViewCell)
57 | -> UICollectionViewCell {
58 | let tempCell = cell as! JXBannerCell
59 | tempCell.layer.cornerRadius = 8
60 | tempCell.layer.masksToBounds = true
61 | tempCell.imageView.image = UIImage(named: "\(index).jpg")
62 | tempCell.msgLabel.text = String(index) + "---来喽来喽,他真的来喽~"
63 | return tempCell
64 | }
65 |
66 | func jxBanner(_ banner: JXBannerType,
67 | layoutParams: JXBannerLayoutParams)
68 | -> JXBannerLayoutParams {
69 |
70 |
71 | if banner.indentify == "banner" {
72 | return layoutParams
73 | .itemSize(CGSize(width: 300, height: 150))
74 | .itemSpacing(20)
75 | } else {
76 | return layoutParams
77 | .itemSize(CGSize(width: 300, height: 150))
78 | .itemSpacing(20)
79 | .scrollDirection(.vertical)
80 | }
81 | }
82 |
83 | }
84 |
85 | //MARK:- JXBannerDelegate
86 | extension JXDefaultVC: JXBannerDelegate {
87 |
88 | public func jxBanner(_ banner: JXBannerType,
89 | didSelectItemAt index: Int) {
90 | print(index)
91 | }
92 |
93 | func jxBanner(_ banner: JXBannerType, center index: Int) {
94 | print(index)
95 | }
96 |
97 |
98 |
99 | }
100 |
--------------------------------------------------------------------------------
/Example/JXBanner/Demo/JXMiddleTargetVC/JXMiddleTargetCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXMiddleTargetCell.swift
3 | // JXBanner_Example
4 | //
5 | // Created by tjx on 2020/1/20.
6 | // Copyright © 2020 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import AVKit
11 |
12 | class JXMiddleTargetCell: UICollectionViewCell {
13 |
14 | @IBOutlet weak var bgView: UIView!
15 | @IBOutlet weak var imageView: UIImageView!
16 |
17 |
18 | var player : AVPlayer!
19 | var palyerItem : AVPlayerItem!
20 | var bufferTimeLabel : UILabel!
21 | var playerLayer: AVPlayerLayer?
22 |
23 | override func awakeFromNib() {
24 | super.awakeFromNib()
25 | }
26 |
27 | func play(_ urlStr: String) {
28 |
29 | guard let url = NSURL(string: urlStr) as URL? else {
30 | return
31 | }
32 |
33 | self.palyerItem = AVPlayerItem(url: url)
34 | //创建ACplayer:负责视频播放
35 | self.player = AVPlayer.init(playerItem: self.palyerItem)
36 | self.player.rate = 1.0//播放速度 播放前设置
37 | //创建显示视频的图层
38 | playerLayer = AVPlayerLayer.init(player: self.player)
39 | playerLayer?.videoGravity = .resizeAspect
40 | playerLayer?.frame = self.bgView.bounds
41 | playerLayer?.backgroundColor = UIColor.black.cgColor
42 | self.imageView.layer.addSublayer(playerLayer!)
43 | //播放
44 | self.player.play()
45 | }
46 |
47 | func stop() {
48 | self.player.pause()
49 | playerLayer?.removeFromSuperlayer()
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/Example/JXBanner/Demo/JXMiddleTargetVC/JXMiddleTargetCell.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Example/JXBanner/Demo/JXMiddleTargetVC/JXMiddleTargetVC.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXMiddleTargetVC.swift
3 | // JXBanner_Example
4 | //
5 | // Created by tjx on 2020/1/20.
6 | // Copyright © 2020 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 | import JXBanner
12 |
13 | class JXMiddleTargetVC: UIViewController {
14 |
15 | @IBOutlet weak var banner: JXBanner!
16 | var pageCount = 5
17 | let videoItems = [
18 | "http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4",
19 | "http://vfx.mtime.cn/Video/2019/03/21/mp4/190321153853126488.mp4",
20 | "http://vfx.mtime.cn/Video/2019/03/19/mp4/190319222227698228.mp4",
21 | "http://vfx.mtime.cn/Video/2019/03/19/mp4/190319212559089721.mp4",
22 | "http://vfx.mtime.cn/Video/2019/03/18/mp4/190318214226685784.mp4",
23 | ]
24 |
25 |
26 | override func viewDidLoad() {
27 | super.viewDidLoad()
28 | banner.placeholderImgView.image = UIImage(named: "banner_placeholder")
29 | banner.delegate = self
30 | banner.dataSource = self
31 |
32 | self.automaticallyAdjustsScrollViewInsets = false
33 | }
34 |
35 | deinit {
36 | print("\(#function) ----------> \(#file.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? #file)")
37 | }
38 |
39 | override func touchesBegan(_ touches: Set, with event: UIEvent?) {
40 | banner.reloadView()
41 | }
42 | }
43 |
44 | //MARK:- JXBannerDataSource
45 | extension JXMiddleTargetVC: JXBannerDataSource {
46 |
47 | func jxBanner(_ banner: JXBannerType)
48 | -> (JXBannerCellRegister) {
49 | return JXBannerCellRegister(type: nil,
50 | reuseIdentifier: "JXMiddleTargetCell",
51 | nib: UINib(nibName: "JXMiddleTargetCell", bundle: Bundle.main))
52 | }
53 |
54 | func jxBanner(numberOfItems banner: JXBannerType)
55 | -> Int { return pageCount }
56 |
57 | func jxBanner(_ banner: JXBannerType,
58 | cellForItemAt index: Int,
59 | cell: UICollectionViewCell)
60 | -> UICollectionViewCell {
61 | let tempCell = cell as! JXMiddleTargetCell
62 | tempCell.layer.cornerRadius = 8
63 | tempCell.layer.masksToBounds = true
64 | tempCell.imageView.image = UIImage(named: "mp4_\(index).jpg")
65 | return tempCell
66 | }
67 |
68 | func jxBanner(_ banner: JXBannerType,
69 | params: JXBannerParams) -> JXBannerParams {
70 | return params
71 | .isAutoPlay(false)
72 | }
73 |
74 | func jxBanner(_ banner: JXBannerType,
75 | layoutParams: JXBannerLayoutParams)
76 | -> JXBannerLayoutParams {
77 | return layoutParams
78 | .itemSize(CGSize(width: 300, height: 150))
79 | .itemSpacing(20)
80 | .layoutType(JXBannerTransformLinear())
81 | }
82 |
83 | func jxBanner(_ banner: JXBannerType,
84 | centerIndex: Int,
85 | centerCell: UICollectionViewCell) {
86 |
87 | if let cell = centerCell as? JXMiddleTargetCell {
88 | cell.layer.borderColor = UIColor.red.cgColor
89 | cell.layer.borderWidth = 2
90 | cell.imageView.image = UIImage(named: "mp4_\(centerIndex).jpg")
91 | cell.play(videoItems[centerIndex])
92 | }
93 | }
94 |
95 | func jxBanner(_ banner: JXBannerType,
96 | lastCenterIndex: Int?,
97 | lastCenterCell: UICollectionViewCell?) {
98 |
99 | if let cell = lastCenterCell as? JXMiddleTargetCell,
100 | let index = lastCenterIndex {
101 | cell.layer.borderWidth = 0
102 | cell.imageView.image = UIImage(named: "mp4_\(index).jpg")
103 | cell.stop()
104 | }
105 | }
106 | }
107 |
108 | //MARK:- JXBannerDelegate
109 | extension JXMiddleTargetVC: JXBannerDelegate {
110 |
111 | public func jxBanner(_ banner: JXBannerType,
112 | didSelectItemAt index: Int) {
113 | print(index)
114 | }
115 |
116 | func jxBanner(_ banner: JXBannerType, center index: Int) {
117 | print(index)
118 | }
119 |
120 |
121 |
122 | }
123 |
--------------------------------------------------------------------------------
/Example/JXBanner/Demo/JXScrollViewVC/JXScrollViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXScrollViewCell.swift
3 | // JXBanner_Example
4 | //
5 | // Created by 谭家祥 on 2019/11/16.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class JXScrollViewCell: UICollectionViewCell {
12 |
13 | @IBOutlet weak var imgView: UIImageView!
14 | @IBOutlet weak var title: UILabel!
15 | @IBOutlet weak var detail: UILabel!
16 |
17 | override func awakeFromNib() {
18 | super.awakeFromNib()
19 | imgView.layer.cornerRadius = 8
20 | imgView.layer.masksToBounds = true
21 |
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/Example/JXBanner/Demo/JXScrollViewVC/JXScrollViewVC.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXScrollViewVC.swift
3 | // JXBanner_Example
4 | //
5 | // Created by 谭家祥 on 2019/11/16.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import JXBanner
11 |
12 | class JXScrollViewVC: UIViewController {
13 |
14 | @IBOutlet weak var scrollView: JXBanner!
15 |
16 | var pageCount = 15
17 |
18 | override func viewDidLoad() {
19 | super.viewDidLoad()
20 | scrollView.placeholderImgView.image = UIImage(named: "banner_placeholder")
21 | scrollView.delegate = self
22 | scrollView.dataSource = self
23 |
24 | self.automaticallyAdjustsScrollViewInsets = false
25 | }
26 |
27 | deinit {
28 | print("\(#function) ----------> \(#file.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? #file)")
29 | }
30 |
31 | }
32 |
33 |
34 |
35 | //MARK:- JXBannerDataSource
36 | extension JXScrollViewVC: JXBannerDataSource {
37 |
38 | func jxBanner(_ banner: JXBannerType)
39 | -> (JXBannerCellRegister) {
40 | return JXBannerCellRegister(type: nil,
41 | reuseIdentifier: "JXScrollViewCell",
42 | nib: UINib(nibName: "JXScrollViewCell", bundle: Bundle.main))
43 | }
44 |
45 | func jxBanner(numberOfItems banner: JXBannerType)
46 | -> Int { return pageCount }
47 |
48 | func jxBanner(_ banner: JXBannerType,
49 | cellForItemAt index: Int,
50 | cell: UICollectionViewCell)
51 | -> UICollectionViewCell {
52 | if let tempCell = cell as? JXScrollViewCell {
53 | tempCell.imgView.image = UIImage(named: "\(index).jpg")
54 | tempCell.title.text = String(index) + "---来喽来喽,他真的来喽~"
55 | tempCell.detail.text = String(index) + "---哟哟哦哟哟哟哟哟哟哟哟~"
56 | }
57 | return cell
58 | }
59 |
60 | func jxBanner(_ banner: JXBannerType,
61 | params: JXBannerParams) -> JXBannerParams {
62 | return params
63 | .isAutoPlay(false)
64 | .isShowPageControl(false)
65 | .isPagingEnabled(false)
66 | .cycleWay(.rollingBack)
67 | .contentInset(UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20))
68 | }
69 |
70 | func jxBanner(_ banner: JXBannerType,
71 | layoutParams: JXBannerLayoutParams)
72 | -> JXBannerLayoutParams {
73 | return layoutParams
74 | .itemSize(CGSize(width: 150, height: 160))
75 | .itemSpacing(10)
76 | }
77 | }
78 |
79 | //MARK:- JXBannerDelegate
80 | extension JXScrollViewVC: JXBannerDelegate {
81 |
82 | public func jxBanner(_ banner: JXBannerType,
83 | didSelectItemAt index: Int) {
84 | print(index)
85 | }
86 |
87 | }
88 |
--------------------------------------------------------------------------------
/Example/JXBanner/Demo/JXTransformCustomVC/JXCustomTransform.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXCustomTransform.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/7/30.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import JXBanner
11 |
12 | struct JXCustomTransform: JXBannerTransformable {
13 |
14 | public func transformToAttributes(collectionView: UICollectionView,
15 | params: JXBannerLayoutParams,
16 | attributes: UICollectionViewLayoutAttributes) {
17 |
18 | let collectionViewWidth = collectionView.frame.width
19 | if collectionViewWidth <= 0 { return }
20 |
21 | let centetX = collectionView.contentOffset.x + collectionViewWidth * 0.5;
22 | let delta = abs(attributes.center.x - centetX)
23 | let calculateRate = 1 - delta / collectionViewWidth
24 | let angle = min(delta / collectionViewWidth * (1 - params.rateOfChange), params.maximumAngle)
25 | let alpha = max(calculateRate, params.minimumAlpha)
26 |
27 |
28 | applyCoverflowTransformToAttributes(viewCentetX: centetX,
29 | attributes: attributes,
30 | params: params,
31 | angle: angle,
32 | alpha: alpha,
33 | calculateRate: calculateRate)
34 | }
35 |
36 | func applyCoverflowTransformToAttributes(viewCentetX: CGFloat,
37 | attributes: UICollectionViewLayoutAttributes,
38 | params: JXBannerLayoutParams,
39 | angle: CGFloat,
40 | alpha: CGFloat,
41 | calculateRate: CGFloat) -> Void {
42 | var transform3D: CATransform3D = CATransform3DIdentity
43 |
44 |
45 | let location = JXBannerTransfrom.itemLocation(viewCentetX: viewCentetX,
46 | itemCenterX: attributes.center.x)
47 |
48 | var _angle = angle
49 | var _alpha = alpha
50 | var _translateX: CGFloat = 0
51 | var _translateY: CGFloat = 0
52 | attributes.zIndex = 0
53 |
54 | switch location {
55 | case .left:
56 | _angle = angle
57 | _translateX = 0.2 * attributes.size.width * (1 - calculateRate) / 4
58 | _translateY = 0.4 * attributes.size.height * (1 - calculateRate)
59 |
60 |
61 | case .right:
62 | _angle = -angle
63 | _translateX = -0.2 * attributes.size.width * (1 - calculateRate) / 4
64 | _translateY = 0.4 * attributes.size.height * (1 - calculateRate)
65 |
66 | case .center:
67 | _angle = 0
68 | _alpha = 1
69 | _translateY = 0
70 | attributes.zIndex = 10000
71 | }
72 |
73 | transform3D = CATransform3DTranslate(transform3D, _translateX, _translateY, 0)
74 | transform3D = CATransform3DRotate(transform3D, -CGFloat.pi * _angle, 0, 0, 1)
75 | attributes.alpha = _alpha
76 | attributes.transform3D = transform3D
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/Example/JXBanner/Demo/JXTransformCustomVC/JXTransformCustomVC.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXTransformCustomVC.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/7/30.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | import SnapKit
12 | import JXBanner
13 | import JXPageControl
14 |
15 | class JXTransformCustomVC: UIViewController {
16 |
17 | var pageCount = 5
18 |
19 | lazy var banner: JXBanner = {
20 | let banner = JXBanner()
21 | banner.placeholderImgView.image = UIImage(named: "banner_placeholder")
22 | banner.delegate = self
23 | banner.dataSource = self
24 | return banner
25 | }()
26 |
27 | override func viewDidLoad() {
28 | super.viewDidLoad()
29 | view.addSubview(banner)
30 | banner.snp.makeConstraints {(maker) in
31 | maker.left.right.equalTo(view)
32 | maker.height.equalTo(200)
33 | maker.top.equalTo(view.snp_top).offset(100)
34 | }
35 |
36 | self.automaticallyAdjustsScrollViewInsets = false
37 | }
38 |
39 | deinit {
40 | print("\(#function) ----------> \(#file.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? #file)")
41 | }
42 | }
43 |
44 | //MARK:- JXBannerDataSource
45 | extension JXTransformCustomVC: JXBannerDataSource {
46 |
47 | func jxBanner(_ banner: JXBannerType)
48 | -> (JXBannerCellRegister) {
49 |
50 | return JXBannerCellRegister(type: JXBannerCell.self,
51 | reuseIdentifier: "JXTransformCustomVCCell")
52 | }
53 |
54 | func jxBanner(numberOfItems banner: JXBannerType)
55 | -> Int { return pageCount }
56 |
57 | func jxBanner(_ banner: JXBannerType,
58 | cellForItemAt index: Int,
59 | cell: UICollectionViewCell)
60 | -> UICollectionViewCell {
61 | let tempCell = cell as! JXBannerCell
62 | tempCell.layer.cornerRadius = 8
63 | tempCell.layer.masksToBounds = true
64 | tempCell.imageView.image = UIImage(named: "\(index).jpg")
65 | tempCell.msgLabel.text = String(index) + "---来喽来喽,他真的来喽~"
66 | return tempCell
67 | }
68 |
69 | func jxBanner(_ banner: JXBannerType,
70 | params: JXBannerParams)
71 | -> JXBannerParams {
72 |
73 | return params
74 | .timeInterval(3)
75 | .cycleWay(.forward)
76 | }
77 |
78 | func jxBanner(_ banner: JXBannerType,
79 | layoutParams: JXBannerLayoutParams)
80 | -> JXBannerLayoutParams {
81 |
82 | return layoutParams
83 | .layoutType(JXCustomTransform())
84 | .itemSize(CGSize(width: 300, height: 190))
85 | .maximumAngle(0.1)
86 | .itemSpacing(10)
87 | }
88 |
89 | func jxBanner(pageControl banner: JXBannerType,
90 | numberOfPages: Int,
91 | coverView: UIView,
92 | builder: JXBannerPageControlBuilder) -> JXBannerPageControlBuilder {
93 |
94 | let pageControl = JXPageControlFill()
95 | pageControl.contentMode = .bottom
96 | pageControl.activeColor = UIColor.red
97 | pageControl.columnSpacing = 8
98 | builder.pageControl = pageControl
99 | builder.layout = {
100 | pageControl.snp.makeConstraints { (maker) in
101 | maker.left.right.equalTo(coverView)
102 | maker.top.equalTo(coverView.snp_bottom).offset(10)
103 | maker.height.equalTo(10)
104 | }
105 | }
106 | return builder
107 |
108 | }
109 |
110 | }
111 |
112 | //MARK:- JXBannerDelegate
113 | extension JXTransformCustomVC: JXBannerDelegate {
114 |
115 | public func jxBanner(_ banner: JXBannerType,
116 | didSelectItemAt index: Int) {
117 | print(index)
118 | }
119 | }
120 |
121 |
122 |
--------------------------------------------------------------------------------
/Example/JXBanner/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 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Example/JXBanner/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/JXBanner/Images.xcassets/banner_placeholder.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "banner_placeholder.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/JXBanner/Images.xcassets/banner_placeholder.imageset/banner_placeholder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/Images.xcassets/banner_placeholder.imageset/banner_placeholder.png
--------------------------------------------------------------------------------
/Example/JXBanner/Images.xcassets/placeholder.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "placeholder.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | },
21 | "properties" : {
22 | "template-rendering-intent" : "original"
23 | }
24 | }
--------------------------------------------------------------------------------
/Example/JXBanner/Images.xcassets/placeholder.imageset/placeholder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/Images.xcassets/placeholder.imageset/placeholder.png
--------------------------------------------------------------------------------
/Example/JXBanner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | banner
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 |
32 | UILaunchStoryboardName
33 | LaunchScreen
34 | UIMainStoryboardFile
35 | Main
36 | UIRequiredDeviceCapabilities
37 |
38 | armv7
39 |
40 | UISupportedInterfaceOrientations
41 |
42 | UIInterfaceOrientationPortrait
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Example/JXBanner/mp4/mp4_0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/mp4/mp4_0.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/mp4/mp4_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/mp4/mp4_1.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/mp4/mp4_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/mp4/mp4_2.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/mp4/mp4_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/mp4/mp4_3.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/mp4/mp4_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/mp4/mp4_4.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/0.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/1.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/10.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/11.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/12.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/13.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/14.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/15.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/2.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/3.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/4.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/5.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/6.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/7.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/8.jpg
--------------------------------------------------------------------------------
/Example/JXBanner/source/9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/Example/JXBanner/source/9.jpg
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 |
3 | target 'JXBanner_Example' do
4 | pod 'JXBanner', :path => '../'
5 | # pod 'JXBanner'
6 | pod 'SnapKit'
7 |
8 | end
9 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - JXBanner (0.1.0):
3 | - JXBanner/Banner (= 0.1.0)
4 | - JXBanner/PageControl (= 0.1.0)
5 | - JXBanner/Banner (0.1.0):
6 | - JXBanner/Banner/API (= 0.1.0)
7 | - JXBanner/Banner/Banner (= 0.1.0)
8 | - JXBanner/Banner/Cell (= 0.1.0)
9 | - JXBanner/Banner/Common (= 0.1.0)
10 | - JXBanner/Banner/Transform (= 0.1.0)
11 | - JXBanner/Banner/API (0.1.0):
12 | - JXBanner/Banner/Cell
13 | - JXBanner/PageControl
14 | - JXBanner/Banner/Banner (0.1.0):
15 | - JXBanner/Banner/API
16 | - JXBanner/Banner/Common
17 | - JXBanner/Banner/Transform
18 | - JXBanner/Banner/Cell (0.1.0)
19 | - JXBanner/Banner/Common (0.1.0)
20 | - JXBanner/Banner/Transform (0.1.0):
21 | - JXBanner/Banner/API
22 | - JXBanner/PageControl (0.1.0):
23 | - JXPageControl
24 | - JXPageControl (0.1.3):
25 | - JXPageControl/Common (= 0.1.3)
26 | - JXPageControl/Jump (= 0.1.3)
27 | - JXPageControl/Transform (= 0.1.3)
28 | - JXPageControl/Common (0.1.3)
29 | - JXPageControl/Jump (0.1.3):
30 | - JXPageControl/Common
31 | - JXPageControl/Transform (0.1.3):
32 | - JXPageControl/Common
33 | - SnapKit (4.2.0)
34 |
35 | DEPENDENCIES:
36 | - JXBanner (from `../`)
37 | - SnapKit
38 |
39 | SPEC REPOS:
40 | https://github.com/cocoapods/specs.git:
41 | - JXPageControl
42 | - SnapKit
43 |
44 | EXTERNAL SOURCES:
45 | JXBanner:
46 | :path: "../"
47 |
48 | SPEC CHECKSUMS:
49 | JXBanner: d32dbf30f1d4fb014aad26f65e69b0ea32e32efe
50 | JXPageControl: eea52838699a4949063e600b25eb9e8b6e20ae3f
51 | SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
52 |
53 | PODFILE CHECKSUM: 55a2f798d49bb61948e4d464dc12db95c3ea531b
54 |
55 | COCOAPODS: 1.6.1
56 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/API/JXBannerDataSource.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerDataSource.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/6/1.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public protocol JXBannerDataSource: class {
12 |
13 | /**
14 | Use reuseIdentifier to register bannerCell for reuse.
15 |
16 | - parameter banner: An instance of JXBannerType.
17 | - returns: the JXBannerCellRegister instance
18 | */
19 |
20 | func jxBanner(_ banner: JXBannerType)
21 | -> (JXBannerCellRegister)
22 |
23 | /**
24 | How many pages does banner View have?
25 |
26 | - parameter banner: An instance of JXBannerType.
27 | - returns: Number Of Items
28 | */
29 |
30 | func jxBanner(numberOfItems banner: JXBannerType)
31 | -> Int
32 |
33 | /**
34 | This callback changes the banner item
35 | by setting the JXBannerCell
36 |
37 | - parameters:
38 | - banner: An instance of JXBannerType.
39 | - index: index that the cell will display
40 | - cell: XBannerBaseCell or a subclass of JXBannerBaseCell
41 |
42 | - returns: XBannerBaseCell or a subclass of JXBannerBaseCell
43 | */
44 | func jxBanner(_ banner: JXBannerType,
45 | cellForItemAt index: Int,
46 | cell: JXBannerBaseCell)
47 | -> JXBannerBaseCell
48 |
49 | /**
50 | This callback changes the banner
51 | by setting Params
52 |
53 | - parameters:
54 | - banner: An instance of JXBannerType.
55 | - params: JXBannerParams is a collection of properties that banner can set
56 |
57 | - returns: JXBannerParams
58 | */
59 | func jxBanner(_ banner: JXBannerType,
60 | params: JXBannerParams)
61 | -> JXBannerParams
62 |
63 | /**
64 | This callback changes the banner layout
65 | by setting "JXBannerLayoutParams"
66 |
67 | - parameters:
68 | - banner: An instance of JXBannerType.
69 | - params: JXBannerLayoutParams is a collection of properties that banner layout can set
70 |
71 | - returns: JXBannerLayoutParams
72 | */
73 | func jxBanner(_ banner: JXBannerType,
74 | layoutParams: JXBannerLayoutParams)
75 | -> JXBannerLayoutParams
76 |
77 | /**
78 | This callback function changes the banner default pageControl
79 | by creating "JXBannerPageControlBuilder"
80 |
81 | - parameters:
82 | - banner: An instance of JXBannerType.
83 | - numberOfPages: page count
84 | - coverView: The uppermost UIView covered
85 | - builder: "JXBannerPageControlBuilder"
86 |
87 | - returns: JXBannerPageControlBuilder
88 | */
89 | func jxBanner(pageControl banner: JXBannerType,
90 | numberOfPages: Int,
91 | coverView: UIView,
92 | builder: JXBannerPageControlBuilder) -> JXBannerPageControlBuilder
93 | }
94 |
95 | /// The default implementation
96 | public extension JXBannerDataSource {
97 |
98 | /// Default JXBannerParams
99 | func jxBanner(_ banner: JXBannerType,
100 | params: JXBannerParams)
101 | -> JXBannerParams {
102 | return params
103 | }
104 |
105 | /// Default JXBannerLayoutParams
106 | func jxBanner(_ banner: JXBannerType,
107 | layoutParams: JXBannerLayoutParams)
108 | -> JXBannerLayoutParams {
109 | return layoutParams
110 | }
111 |
112 | /// Default pageControl
113 | func jxBanner(pageControl banner: JXBannerType,
114 | numberOfPages: Int,
115 | coverView: UIView,
116 | builder: JXBannerPageControlBuilder) -> JXBannerPageControlBuilder {
117 | let pageControl = JXBannerPageControlDefault()
118 | pageControl.frame = CGRect(x: 0,
119 | y: coverView.bounds.height - 24,
120 | width: coverView.bounds.width,
121 | height: 24)
122 | pageControl.autoresizingMask = [
123 | .flexibleWidth,
124 | .flexibleTopMargin
125 | ]
126 | builder.pageControl = pageControl
127 |
128 | return builder
129 | }
130 |
131 | }
132 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/API/JXBannerDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerDelegate.swift
3 | // Alamofire
4 | //
5 | // Created by Code_JX on 2019/6/1.
6 | //
7 |
8 | import UIKit
9 |
10 | public protocol JXBannerDelegate: class {
11 |
12 | /**
13 | Called when the cell is clicked
14 |
15 | - parameters:
16 | - banner: An instance of JXBannerType.
17 | - index: The index of the cell is clicked
18 | */
19 |
20 | func jxBanner(_ banner: JXBannerType,
21 | didSelectItemAt index: Int)
22 |
23 | /**
24 | Returns the index of the item in the middle of the bannerview
25 |
26 | - parameters:
27 | - banner: An instance of JXBannerType.
28 | - index: the index of the item in the middle of the bannerview
29 | */
30 |
31 | func jxBanner(_ banner: JXBannerType,
32 | center index: Int)
33 |
34 | /**
35 | This is a view to add mask subview
36 |
37 | - parameters:
38 | - banner: An instance of JXBannerType.
39 | - coverView: This is a view to add mask subview
40 | */
41 |
42 | func jxBanner(_ banner: JXBannerType,
43 | coverView: UIView)
44 | }
45 |
46 | /// The default implementation
47 | public extension JXBannerDelegate {
48 |
49 | func jxBanner(_ banner: JXBannerType,
50 | didSelectItemAt index: Int) {
51 | print(" -- jxBanner select item -- \(index) -- ")
52 | }
53 |
54 | func jxBanner(_ banner: JXBannerType,
55 | center index: Int) {}
56 |
57 | func jxBanner(_ banner: JXBannerType,
58 | coverView: UIView) {}
59 | }
60 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/API/JXBannerLayoutParams.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerLayoutParams.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/18.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public class JXBannerLayoutParams {
12 |
13 | // base
14 | public var itemSize: CGSize?
15 | public var itemSpacing: CGFloat = 0.0
16 | public var layoutType: JXBannerTransformable?
17 |
18 | // JXBannerTransformable
19 | public var minimumScale: CGFloat = 0.8
20 | public var minimumAlpha: CGFloat = 1.0
21 | public var maximumAngle: CGFloat = 0.2
22 | public var rateOfChange: CGFloat = 0.4
23 | public var rateHorisonMargin: CGFloat = 0.2
24 |
25 | }
26 |
27 | // MARK: - Set function
28 | public extension JXBannerLayoutParams {
29 |
30 | func itemSize(_ itemSize: CGSize) -> JXBannerLayoutParams {
31 | self.itemSize = itemSize
32 | return self
33 | }
34 |
35 | func itemSpacing(_ itemSpacing: CGFloat) -> JXBannerLayoutParams {
36 | self.itemSpacing = itemSpacing
37 | return self
38 | }
39 |
40 | func layoutType(_ layoutType: JXBannerTransformable?) -> JXBannerLayoutParams {
41 | self.layoutType = layoutType
42 | return self
43 | }
44 |
45 | func minimumScale(_ minimumScale: CGFloat) -> JXBannerLayoutParams {
46 | self.minimumScale = minimumScale
47 | return self
48 | }
49 |
50 | func minimumAlpha(_ minimumAlpha: CGFloat) -> JXBannerLayoutParams {
51 | self.minimumAlpha = minimumAlpha
52 | return self
53 | }
54 |
55 | func maximumAngle(_ maximumAngle: CGFloat) -> JXBannerLayoutParams {
56 | self.maximumAngle = maximumAngle
57 | return self
58 | }
59 |
60 | func rateOfChange(_ rateOfChange: CGFloat) -> JXBannerLayoutParams {
61 | self.rateOfChange = rateOfChange
62 | return self
63 | }
64 |
65 | func rateHorisonMargin(_ rateHorisonMargin: CGFloat) -> JXBannerLayoutParams {
66 | self.rateHorisonMargin = rateHorisonMargin
67 | return self
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/API/JXBannerParams.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerParams.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/30.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | // MARK: - Property list
12 | public class JXBannerParams {
13 |
14 | public var isAutoPlay: Bool = true
15 |
16 | public var isBounces: Bool = true
17 |
18 | public var isShowPageControl: Bool = true
19 |
20 | public var timeInterval: TimeInterval = 5.0
21 |
22 | public var cycleWay: CycleWay = .forward
23 |
24 | public var edgeTransitionType: JXBannerTransitionType? = .fade
25 |
26 | public var edgeTransitionSubtype: CATransitionSubtype = .fromRight
27 |
28 | internal var currentRollingDirection: RollingDirection = .right
29 | }
30 |
31 | // MARK: - Public enum
32 | public extension JXBannerParams {
33 |
34 | enum JXBannerTransitionType : String {
35 | case fade
36 | case push
37 | case reveal
38 | case moveIn
39 | case cube
40 | case suckEffect
41 | case oglFlip
42 | case rippleEffect
43 | case pageCurl
44 | case pageUnCurl
45 | case cameraIrisHollowOpen
46 | case cameraIrisHollowClose
47 | case curlDown
48 | case curlUp
49 | case flipFromLeft
50 | case flipFromRight
51 | }
52 |
53 | enum CycleWay {
54 | case forward
55 | case skipEnd
56 | case rollingBack
57 | }
58 |
59 | enum RollingDirection {
60 | case right
61 | case left
62 | }
63 | }
64 |
65 | // MARK: - Set function
66 | public extension JXBannerParams {
67 |
68 | func isAutoPlay(_ isAutoPlay: Bool) -> JXBannerParams {
69 | self.isAutoPlay = isAutoPlay
70 | return self
71 | }
72 |
73 | func isBounces(_ isBounces: Bool) -> JXBannerParams {
74 | self.isBounces = isBounces
75 | return self
76 | }
77 |
78 | func isShowPageControl(_ isShowPageControl: Bool) -> JXBannerParams {
79 | self.isShowPageControl = isShowPageControl
80 | return self
81 | }
82 |
83 | func timeInterval(_ timeInterval: TimeInterval) -> JXBannerParams {
84 | self.timeInterval = timeInterval
85 | return self
86 | }
87 |
88 | func cycleWay(_ cycleWay: CycleWay) -> JXBannerParams {
89 | self.cycleWay = cycleWay
90 | return self
91 | }
92 |
93 | func edgeTransitionType(_ edgeTransitionType: JXBannerTransitionType?) -> JXBannerParams {
94 | self.edgeTransitionType = edgeTransitionType
95 | return self
96 | }
97 |
98 | func edgeTransitionSubtype(_ edgeTransitionSubtype: CATransitionSubtype) -> JXBannerParams {
99 | self.edgeTransitionSubtype = edgeTransitionSubtype
100 | return self
101 | }
102 |
103 | internal func currentRollingDirection(_ currentRollingDirection: RollingDirection) -> JXBannerParams {
104 | self.currentRollingDirection = currentRollingDirection
105 | return self
106 | }
107 |
108 | }
109 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/API/JXBannerTransformable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransformable.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/14.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public protocol JXBannerTransformable {
12 |
13 | /**
14 | This callback will provide all the UICollectionViewLayoutAttributes,
15 | you can change his "transform" change the presentation
16 |
17 | */
18 |
19 | func transformToAttributes(collectionView: UICollectionView,
20 | params: JXBannerLayoutParams,
21 | attributes: UICollectionViewLayoutAttributes)
22 | }
23 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/API/JXBannerType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBaseBanner.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/11.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public protocol JXBannerType: UIView {
12 |
13 | /// Data source protocol for JXBannerType
14 | var dataSource: JXBannerDataSource? { get set }
15 |
16 | /// Delegate protocol for JXBannerType
17 | var delegate: JXBannerDelegate? { get set }
18 |
19 | /// Distinguish the banner
20 | var indentify: String? { get set }
21 |
22 | /// The refresh UI
23 | func reloadView()
24 |
25 | }
26 |
27 | /// A structure that registers cells so that
28 | /// we can distinguish and retrieve reused cells from the cache pool
29 | public struct JXBannerCellRegister {
30 |
31 | var type: JXBannerBaseCell.Type
32 | var reuseIdentifier: String
33 |
34 | public init(type: JXBannerBaseCell.Type, reuseIdentifier: String) {
35 | self.type = type
36 | self.reuseIdentifier = reuseIdentifier
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Banner/JXBannerLayout.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerLayout.swift
3 | // NewBanner
4 | //
5 | // Created by Code_JX on 2019/5/12.
6 | // Copyright © 2019 China. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class JXBannerLayout: UICollectionViewFlowLayout {
12 |
13 | override init() {
14 | super.init()
15 | }
16 |
17 | required init?(coder aDecoder: NSCoder) {
18 | super.init(coder: aDecoder)
19 | }
20 |
21 | var params: JXBannerLayoutParams? {
22 | didSet {
23 | if let params = params {
24 | itemSize = params.itemSize ?? collectionView?.bounds.size ?? CGSize(width: 2, height: 2)
25 | minimumLineSpacing = params.itemSpacing
26 | minimumInteritemSpacing = params.itemSpacing
27 | }
28 | }
29 | }
30 |
31 | override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) ->
32 | Bool {
33 | if let _ = params?.layoutType { return true }
34 | return super.shouldInvalidateLayout(forBoundsChange: newBounds)
35 | }
36 |
37 | override func prepare() {
38 | super.prepare()
39 | scrollDirection = .horizontal
40 |
41 | // Set the margins
42 | let inset: CGFloat = (collectionView!.frame.width - itemSize.width) * 0.5
43 | sectionInset = UIEdgeInsets(top: 0,
44 | left: inset,
45 | bottom: 0,
46 | right: inset)
47 | }
48 |
49 | override func layoutAttributesForElements(in rect: CGRect) ->
50 | [UICollectionViewLayoutAttributes]? {
51 |
52 | if let layoutType = params?.layoutType {
53 |
54 | let attributesArray: [UICollectionViewLayoutAttributes] =
55 | NSArray(array: super.layoutAttributesForElements(in: rect) ?? [],
56 | copyItems: true) as! [UICollectionViewLayoutAttributes]
57 | let visibleRect = CGRect(origin: collectionView!.contentOffset,
58 | size: collectionView!.bounds.size)
59 |
60 | for attributes in attributesArray {
61 | if !visibleRect.intersects(attributes.frame) { continue }
62 | applyTransformToAttributes(attributes: attributes,
63 | layoutType: layoutType)
64 | }
65 | return attributesArray
66 |
67 | }
68 | return super.layoutAttributesForElements(in: rect)
69 | }
70 |
71 | //MARK:- Transform
72 | func applyTransformToAttributes(attributes: UICollectionViewLayoutAttributes,
73 | layoutType: JXBannerTransformable) -> Void {
74 | let transformContext: JXBannerTransformContext = JXBannerTransformContext(transform: layoutType)
75 | transformContext.transformToAttributes(collectionView: collectionView!,
76 | params: params!,
77 | attributes: attributes)
78 | }
79 |
80 | }
81 |
82 |
83 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Cell/JXBannerBaseCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerBaseCell.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/18.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | open class JXBannerBaseCell: UICollectionViewCell {
12 |
13 | public override init(frame: CGRect) {
14 | super.init(frame: frame)
15 | jx_addSubviews()
16 | }
17 |
18 | required public init?(coder aDecoder: NSCoder) {
19 | super.init(coder: aDecoder)
20 | jx_addSubviews()
21 | }
22 |
23 | open func jx_addSubviews() {
24 | contentView.addSubview(imageView)
25 | }
26 |
27 | // MARK:- Lazy loading Cell subView
28 | public lazy var imageView: UIImageView = {
29 | let imageView = UIImageView()
30 | imageView.frame = self.contentView.bounds
31 | imageView.autoresizingMask = [
32 | .flexibleWidth,
33 | .flexibleHeight
34 | ]
35 | return imageView
36 | }()
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Cell/JXBannerCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerCell.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/18.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | open class JXBannerCell: JXBannerBaseCell {
12 |
13 | private let msgBGViewH: CGFloat = 24
14 | private let msgMargin: CGFloat = 10
15 |
16 | open override func jx_addSubviews() {
17 | super.jx_addSubviews()
18 | contentView.addSubview(msgBgView)
19 | msgBgView.addSubview(msgLabel)
20 | }
21 |
22 | public lazy var msgLabel: UILabel = {
23 | let label = UILabel()
24 | label.frame = CGRect(x: msgMargin,
25 | y: 0,
26 | width: msgBgView.bounds.width - 2*msgMargin,
27 | height: msgBgView.bounds.height)
28 | label.textColor = UIColor.white
29 | label.textAlignment = .center
30 | label.font = UIFont.systemFont(ofSize: 12)
31 | label.autoresizingMask = [
32 | .flexibleWidth,
33 | .flexibleHeight
34 | ]
35 | return label
36 | }()
37 |
38 | public lazy var msgBgView: UIView = {
39 | let view = UIView()
40 | view.frame = CGRect(x: 0,
41 | y: self.contentView.bounds.height - msgBGViewH,
42 | width: self.contentView.bounds.width,
43 | height: msgBGViewH)
44 | view.backgroundColor = UIColor.black.withAlphaComponent(0.4)
45 | view.autoresizingMask = [
46 | .flexibleWidth,
47 | .flexibleTopMargin
48 | ]
49 | return view
50 | }()
51 | }
52 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Common/IndexPath+JXCalculate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IndexPath+JXCalculate.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/6/1.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension IndexPath {
12 | /// Reload the "+" operator
13 | static func + (left: IndexPath,
14 | right: Int)
15 | -> IndexPath {
16 | return IndexPath.init(row: left.row + right,
17 | section: left.section)
18 | }
19 |
20 | /// Reload the "-" operator
21 | static func - (left: IndexPath,
22 | right: Int)
23 | -> IndexPath {
24 | return IndexPath.init(row: left.row - right,
25 | section: left.section)
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Common/Timer+JXBExtension.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Timer+JXBExtension.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/8/1.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class Block {
12 | let f : T
13 | init(_ f: T) {
14 | self.f = f
15 | }
16 | }
17 |
18 | extension Timer {
19 |
20 | class func jx_scheduledTimer(
21 | withTimeInterval interval: TimeInterval,
22 | repeats: Bool,
23 | block: @escaping (Timer) -> Swift.Void) -> Timer {
24 |
25 | if #available(iOS 10.0, *) {
26 |
27 | return Timer.scheduledTimer(withTimeInterval: interval,
28 | repeats: repeats,
29 | block: block)
30 | }
31 |
32 | return Timer.scheduledTimer(timeInterval: interval,
33 | target: self,
34 | selector: #selector(jx_timerAction),
35 | userInfo: Block(block),
36 | repeats: repeats)
37 | }
38 |
39 |
40 |
41 | @objc class func jx_timerAction(_ sender: Timer) {
42 | if let block = sender.userInfo as? Block<(Timer) -> Swift.Void> {
43 | block.f(sender)
44 | }
45 |
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Common/View+JXExtension.swift:
--------------------------------------------------------------------------------
1 | //
2 | // View+JXExtension.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/8/3.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIView {
12 |
13 | // Determine if it's on screen
14 | func isShowingOnWindow() -> Bool {
15 |
16 | guard self.window != nil,
17 | isHidden != true,
18 | alpha > 0.01,
19 | superview != nil
20 | else {
21 | return false
22 | }
23 |
24 | // convert self to window's Rect
25 | var rect: CGRect = superview!.convert(frame, to: nil)
26 |
27 | // if size is CGrectZero
28 | if rect.isEmpty || rect.isNull || rect.size.equalTo(CGSize.zero) {
29 | return false
30 | }
31 |
32 | // set offset
33 | if let scorllView = self as? UIScrollView {
34 | rect.origin.x += scorllView.contentOffset.x
35 | rect.origin.y += scorllView.contentOffset.y
36 | }
37 |
38 | // get the Rect that intersects self and window
39 | let screenRect: CGRect = UIScreen.main.bounds
40 | let intersectionRect: CGRect = rect.intersection(screenRect)
41 | if intersectionRect.isEmpty || intersectionRect.isNull {
42 | return false
43 | }
44 |
45 | return true
46 |
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Transform/JXBannerTransformContext.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransformContext.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/14.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | struct JXBannerTransformContext: JXBannerTransformable {
12 |
13 | var transform: JXBannerTransformable?
14 |
15 | init() {}
16 |
17 | init(transform: JXBannerTransformable) {
18 | self.transform = transform
19 | }
20 |
21 | func transformToAttributes(collectionView: UICollectionView,
22 | params: JXBannerLayoutParams,
23 | attributes: UICollectionViewLayoutAttributes) {
24 | transform?.transformToAttributes(collectionView: collectionView,
25 | params: params,
26 | attributes: attributes)
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Transform/JXBannerTransformCoverflow.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransformCoverflow.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/14.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public struct JXBannerTransformCoverflow: JXBannerTransformable {
12 |
13 | public init() {}
14 |
15 | public func transformToAttributes(collectionView: UICollectionView,
16 | params: JXBannerLayoutParams,
17 | attributes: UICollectionViewLayoutAttributes) {
18 |
19 | let collectionViewWidth = collectionView.frame.width
20 | if collectionViewWidth <= 0 { return }
21 |
22 | let centetX = collectionView.contentOffset.x + collectionViewWidth * 0.5;
23 | let delta = abs(attributes.center.x - centetX)
24 | let angle = min(delta / collectionViewWidth * (1 - params.rateOfChange), params.maximumAngle)
25 | let alpha = max(1 - delta / collectionViewWidth, params.minimumAlpha)
26 |
27 | applyCoverflowTransformToAttributes(viewCentetX: centetX,
28 | attributes: attributes,
29 | params: params,
30 | angle: angle,
31 | alpha: alpha)
32 | }
33 |
34 | func applyCoverflowTransformToAttributes(viewCentetX: CGFloat,
35 | attributes: UICollectionViewLayoutAttributes,
36 | params: JXBannerLayoutParams,
37 | angle: CGFloat,
38 | alpha: CGFloat) -> Void {
39 | var transform3D: CATransform3D = CATransform3DIdentity
40 | transform3D.m34 = -0.002
41 | var _angle: CGFloat = angle
42 | var _alpha: CGFloat = alpha
43 | let location = JXBannerTransfrom.itemLocation(viewCentetX: viewCentetX,
44 | itemCenterX: attributes.center.x)
45 |
46 | var translate: CGFloat = 0.0
47 | switch location {
48 | case .left:
49 | _angle = angle
50 | translate = (1.0 - cos(_angle * (1 + params.rateHorisonMargin) * CGFloat.pi)) * attributes.size.width
51 | case .right:
52 | _angle = -angle
53 | translate = -(1.0 - cos(_angle * (1 + params.rateHorisonMargin) * CGFloat.pi)) * attributes.size.width
54 | case .center:
55 | _angle = 0
56 | _alpha = 1
57 | }
58 | attributes.alpha = _alpha
59 | transform3D = CATransform3DRotate(transform3D,
60 | CGFloat.pi * _angle,
61 | 0, 1, 0)
62 | attributes.transform3D = CATransform3DTranslate(transform3D,
63 | translate, 0, 0)
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Transform/JXBannerTransformLinear.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransformLinear.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/14.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public struct JXBannerTransformLinear: JXBannerTransformable {
12 |
13 | public init() {}
14 |
15 | public func transformToAttributes(collectionView: UICollectionView,
16 | params: JXBannerLayoutParams,
17 | attributes: UICollectionViewLayoutAttributes) {
18 |
19 | let collectionViewWidth = collectionView.frame.width
20 | if collectionViewWidth <= 0 { return }
21 | let centetX = collectionView.contentOffset.x + collectionViewWidth * 0.5
22 | let delta = abs(attributes.center.x - centetX)
23 | let scale = max(1 - delta / collectionViewWidth * params.rateOfChange, params.minimumScale)
24 | let alpha = max(1 - delta / collectionViewWidth, params.minimumAlpha)
25 |
26 | var transform: CGAffineTransform = CGAffineTransform(scaleX: scale, y: scale)
27 | var _alpha = alpha
28 |
29 | // Adjust spacing When Scroling
30 | let location = JXBannerTransfrom.itemLocation(viewCentetX: centetX,
31 | itemCenterX: attributes.center.x)
32 | let rate = 1.05 + params.rateHorisonMargin
33 | var translate: CGFloat = 0
34 | switch location {
35 | case .left:
36 | translate = rate * attributes.size.width * (1 - scale) / 2
37 | case .right:
38 | translate = -rate * attributes.size.width * (1 - scale) / 2
39 | case .center:
40 | _alpha = 1.0
41 | }
42 | transform = transform.translatedBy(x: translate, y: 0)
43 |
44 | // Set transform
45 | attributes.transform = transform;
46 | attributes.alpha = _alpha;
47 | }
48 | }
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/Banner/Transform/JXBannerTransfrom.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransfrom.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/6/6.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public struct JXBannerTransfrom {
12 |
13 | public enum JXTransformLocation {
14 | case left
15 | case center
16 | case right
17 | }
18 |
19 | public static func itemLocation(viewCentetX: CGFloat,
20 | itemCenterX: CGFloat) -> JXTransformLocation {
21 | var location: JXTransformLocation = .right
22 | if abs(itemCenterX - viewCentetX) < 0.5 {
23 | location = .center
24 | }else if (itemCenterX - viewCentetX) < 0 {
25 | location = .left
26 | }
27 | return location
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/PageControl/JXBannerPageControlBuilder.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerPageControlBuilder.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/7/29.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import JXPageControl
11 |
12 | public class JXBannerPageControlBuilder {
13 |
14 | // The JXPageControlType is the default indicator
15 | public var pageControl: (UIView & JXPageControlType)?
16 |
17 | /// Layout of the callback
18 | public var layout: (() -> ())?
19 | }
20 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/JXBanner/Classes/PageControl/JXBannerPageControlDefault.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerPageControlDefault.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/7/29.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import JXPageControl
11 |
12 | class JXBannerPageControlDefault: JXPageControlJump {
13 |
14 | override func setBase() {
15 | super.setBase()
16 |
17 | activeSize = CGSize(width: 15, height: 6)
18 | inactiveSize = CGSize(width: 6, height: 6)
19 | columnSpacing = 0
20 | contentMode = .right
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Example/Pods/JXBanner/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2019 Code_TanJX
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/JXPageControl/JXPageControl/Classes/Common/JXPageControlTool.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXPageControlTool.swift
3 | // JXPageControl_Example
4 | //
5 | // Created by Coder_TanJX on 2019/7/3.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIColor {
12 |
13 | private static func rgbArray(color: UIColor) -> [CGFloat] {
14 |
15 | var r: CGFloat = 0.0
16 | var g: CGFloat = 0.0
17 | var b: CGFloat = 0.0
18 | var a: CGFloat = 0.0
19 |
20 | if self.responds(to: #selector(getRed(_:green:blue:alpha:))) {
21 | color.getRed(&r, green: &g, blue: &b, alpha: &a)
22 | }else {
23 |
24 | if let components = color.cgColor.components {
25 | if components.count == 2 {
26 | r = components[0]
27 | g = components[0]
28 | b = components[0]
29 | a = components[1]
30 | }else if components.count == 4 {
31 | r = components[0]
32 | g = components[1]
33 | b = components[2]
34 | a = components[3]
35 | }else {
36 | print("获取颜色RGB失败")
37 | }
38 | }
39 | }
40 |
41 | return [r, g ,b , a]
42 | }
43 |
44 | private static func difference(originColor: UIColor,
45 | targetColor: UIColor) -> [CGFloat] {
46 | let originArr = self.rgbArray(color: originColor)
47 | let targetArr = self.rgbArray(color: targetColor)
48 | return [targetArr[0] - originArr[0],
49 | targetArr[1] - originArr[1],
50 | targetArr[2] - originArr[2],
51 | targetArr[3] - originArr[3]]
52 | }
53 |
54 | /**
55 | * Pass in two colors and proportions
56 | *
57 | * @param originColor Original color
58 | * @param targetColor Target color
59 | * @param proportion Between 0 and 1
60 | *
61 | * @return UIColor
62 | */
63 | static func transform(originColor: UIColor,
64 | targetColor: UIColor,
65 | proportion: CGFloat) -> UIColor {
66 | let originArr = self.rgbArray(color: originColor)
67 | let differenceArr = self.difference(originColor: originColor,
68 | targetColor: targetColor)
69 | return UIColor(red: originArr[0] + proportion * differenceArr[0] ,
70 | green: originArr[1] + proportion * differenceArr[1],
71 | blue: originArr[2] + proportion * differenceArr[2],
72 | alpha: originArr[3] + proportion * differenceArr[3])
73 | }
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/Example/Pods/JXPageControl/JXPageControl/Classes/Common/JXPageControlType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXPageControlType.swift
3 | // JXPageControl
4 | //
5 | // Created by Coder_TanJX on 2019/6/7.
6 | //
7 |
8 | import UIKit
9 |
10 | let kMinItemWidth: CGFloat = 2.0
11 | let kMinItemHeight: CGFloat = 2.0
12 |
13 | public class JXPageControlAlignment: NSObject {
14 |
15 | public enum JXHorizonAlignment : Int {
16 | case left
17 | case center
18 | case right
19 | }
20 |
21 | public enum JXVerticalAlignment : Int {
22 | case top
23 | case center
24 | case bottom
25 | }
26 |
27 | var horizon: JXHorizonAlignment
28 | var vertical: JXVerticalAlignment
29 |
30 | public init(_ horizon: JXHorizonAlignment,
31 | _ vertical: JXVerticalAlignment) {
32 | self.horizon = horizon
33 | self.vertical = vertical
34 | }
35 | }
36 |
37 | public protocol JXPageControlType {
38 |
39 | /// Default is 0
40 | var numberOfPages: Int { get set }
41 |
42 | /// Default is 0. value pinned to 0..numberOfPages-1
43 | var currentPage: Int { get set }
44 |
45 | /// Default is 0.0. value pinned to 0.0..numberOfPages-1
46 | var progress: CGFloat { get set}
47 |
48 | /// Hide the the indicator if there is only one page. default is NO
49 | var hidesForSinglePage: Bool { get set }
50 |
51 | /// Inactive item tint color
52 | var inactiveColor: UIColor { get set }
53 |
54 | /// Active indicator ting color
55 | var activeColor: UIColor { get set }
56 |
57 | /// Inactive indicator size
58 | var inactiveSize: CGSize { get set }
59 |
60 | /// Active indicator size
61 | var activeSize: CGSize { get set }
62 |
63 | /// Sets the size of all indicators
64 | var indicatorSize: CGSize { get set }
65 |
66 | /// Column spacing
67 | var columnSpacing: CGFloat { get set }
68 |
69 | /// Content location
70 | var contentAlignment: JXPageControlAlignment { get set }
71 |
72 | /// The content location of the system UIView
73 | var contentMode: UIViewContentMode { get set }
74 |
75 | /// Inactive hollow figure
76 | var isInactiveHollow: Bool { get set }
77 |
78 | /// Active hollow figure
79 | var isActiveHollow: Bool { get set }
80 |
81 | /// Refresh the data and UI again
82 | func reload()
83 | }
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/Example/Pods/JXPageControl/JXPageControl/Classes/Jump/JXPageControlBoldLine.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXPageControlBoldLine.swift
3 | // JXPageControl_Example
4 | //
5 | // Created by Coder_TanJX on 2019/6/9.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @IBDesignable open class JXPageControlBoldLine: JXPageControlJump {
12 |
13 | override open func setBase() {
14 | super.setBase()
15 | indicatorSize = CGSize(width: 15, height: 6)
16 | isAnimation = false
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Example/Pods/JXPageControl/JXPageControl/Classes/Jump/JXPageControlEllipse.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXPageControlEllipse.swift
3 | // JXPageControl_Example
4 | //
5 | // Created by Coder_TanJX on 2019/6/9.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 |
12 | //private let kMinContentSize = CGSize(width: 2, height: 2)
13 |
14 | @IBDesignable open class JXPageControlEllipse: JXPageControlJump {
15 |
16 | override open func setBase() {
17 | super.setBase()
18 | inactiveSize = CGSize(width: 6, height: 6)
19 | activeSize = CGSize(width: 15, height: 6)
20 | columnSpacing = 0
21 | isAnimation = false
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Example/Pods/JXPageControl/JXPageControl/Classes/Jump/JXPageControlLine.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXPageControlLine.swift
3 | // JXPageControl_Example
4 | //
5 | // Created by Coder_TanJX on 2019/6/8.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @IBDesignable open class JXPageControlLine: JXPageControlJump {
12 |
13 | override open func setBase() {
14 | super.setBase()
15 | indicatorSize = CGSize(width: 15, height: 2)
16 | isAnimation = false
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Example/Pods/JXPageControl/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2019 bboyXFX
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/Local Podspecs/JXBanner.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "JXBanner",
3 | "version": "0.1.0",
4 | "summary": "A multifunctional framework for banner unlimited rollover diagrams",
5 | "description": "The framework relies on JXPageConytrol and contains many custom interfaces, such as transition animation, view structure, and Settings",
6 | "homepage": "https://github.com/Coder-TanJX",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "Code_TanJX": "code_tanjx@163.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/Coder-TanJX/JXBanner.git",
16 | "tag": "0.1.0"
17 | },
18 | "platforms": {
19 | "ios": "8.0"
20 | },
21 | "swift_version": "5.0",
22 | "subspecs": [
23 | {
24 | "name": "PageControl",
25 | "source_files": "JXBanner/Classes/PageControl/**/*",
26 | "dependencies": {
27 | "JXPageControl": [
28 |
29 | ]
30 | }
31 | },
32 | {
33 | "name": "Banner",
34 | "subspecs": [
35 | {
36 | "name": "Cell",
37 | "source_files": "JXBanner/Classes/Banner/Cell/**/*"
38 | },
39 | {
40 | "name": "Common",
41 | "source_files": "JXBanner/Classes/Banner/Common/**/*"
42 | },
43 | {
44 | "name": "API",
45 | "source_files": "JXBanner/Classes/Banner/API/**/*",
46 | "dependencies": {
47 | "JXBanner/PageControl": [
48 |
49 | ],
50 | "JXBanner/Banner/Cell": [
51 |
52 | ]
53 | }
54 | },
55 | {
56 | "name": "Transform",
57 | "source_files": "JXBanner/Classes/Banner/Transform/**/*",
58 | "dependencies": {
59 | "JXBanner/Banner/API": [
60 |
61 | ]
62 | }
63 | },
64 | {
65 | "name": "Banner",
66 | "source_files": "JXBanner/Classes/Banner/Banner/**/*",
67 | "dependencies": {
68 | "JXBanner/Banner/API": [
69 |
70 | ],
71 | "JXBanner/Banner/Common": [
72 |
73 | ],
74 | "JXBanner/Banner/Transform": [
75 |
76 | ]
77 | }
78 | }
79 | ]
80 | }
81 | ]
82 | }
83 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - JXBanner (0.1.0):
3 | - JXBanner/Banner (= 0.1.0)
4 | - JXBanner/PageControl (= 0.1.0)
5 | - JXBanner/Banner (0.1.0):
6 | - JXBanner/Banner/API (= 0.1.0)
7 | - JXBanner/Banner/Banner (= 0.1.0)
8 | - JXBanner/Banner/Cell (= 0.1.0)
9 | - JXBanner/Banner/Common (= 0.1.0)
10 | - JXBanner/Banner/Transform (= 0.1.0)
11 | - JXBanner/Banner/API (0.1.0):
12 | - JXBanner/Banner/Cell
13 | - JXBanner/PageControl
14 | - JXBanner/Banner/Banner (0.1.0):
15 | - JXBanner/Banner/API
16 | - JXBanner/Banner/Common
17 | - JXBanner/Banner/Transform
18 | - JXBanner/Banner/Cell (0.1.0)
19 | - JXBanner/Banner/Common (0.1.0)
20 | - JXBanner/Banner/Transform (0.1.0):
21 | - JXBanner/Banner/API
22 | - JXBanner/PageControl (0.1.0):
23 | - JXPageControl
24 | - JXPageControl (0.1.3):
25 | - JXPageControl/Common (= 0.1.3)
26 | - JXPageControl/Jump (= 0.1.3)
27 | - JXPageControl/Transform (= 0.1.3)
28 | - JXPageControl/Common (0.1.3)
29 | - JXPageControl/Jump (0.1.3):
30 | - JXPageControl/Common
31 | - JXPageControl/Transform (0.1.3):
32 | - JXPageControl/Common
33 | - SnapKit (4.2.0)
34 |
35 | DEPENDENCIES:
36 | - JXBanner (from `../`)
37 | - SnapKit
38 |
39 | SPEC REPOS:
40 | https://github.com/cocoapods/specs.git:
41 | - JXPageControl
42 | - SnapKit
43 |
44 | EXTERNAL SOURCES:
45 | JXBanner:
46 | :path: "../"
47 |
48 | SPEC CHECKSUMS:
49 | JXBanner: d32dbf30f1d4fb014aad26f65e69b0ea32e32efe
50 | JXPageControl: eea52838699a4949063e600b25eb9e8b6e20ae3f
51 | SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
52 |
53 | PODFILE CHECKSUM: 55a2f798d49bb61948e4d464dc12db95c3ea531b
54 |
55 | COCOAPODS: 1.6.1
56 |
--------------------------------------------------------------------------------
/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/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 | public 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/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:3.0, message:"Use priority(.required) instead.")
46 | @discardableResult
47 | public func priorityRequired() -> ConstraintMakerFinalizable {
48 | return self.priority(.required)
49 | }
50 |
51 | @available(*, deprecated:3.0, message:"Use priority(.high) instead.")
52 | @discardableResult
53 | public func priorityHigh() -> ConstraintMakerFinalizable {
54 | return self.priority(.high)
55 | }
56 |
57 | @available(*, deprecated:3.0, message:"Use priority(.medium) instead.")
58 | @discardableResult
59 | public func priorityMedium() -> ConstraintMakerFinalizable {
60 | return self.priority(.medium)
61 | }
62 |
63 | @available(*, deprecated:3.0, message:"Use priority(.low) instead.")
64 | @discardableResult
65 | public func priorityLow() -> ConstraintMakerFinalizable {
66 | return self.priority(.low)
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/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.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 | guard lhs.firstItem === rhs.firstItem &&
48 | lhs.secondItem === rhs.secondItem &&
49 | lhs.firstAttribute == rhs.firstAttribute &&
50 | lhs.secondAttribute == rhs.secondAttribute &&
51 | lhs.relation == rhs.relation &&
52 | lhs.priority == rhs.priority &&
53 | lhs.multiplier == rhs.multiplier else {
54 | return false
55 | }
56 | return true
57 | }
58 |
--------------------------------------------------------------------------------
/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 | public var snp: ConstraintLayoutSupportDSL {
33 | return ConstraintLayoutSupportDSL(support: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXBanner/JXBanner-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXBanner/JXBanner-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_JXBanner : NSObject
3 | @end
4 | @implementation PodsDummy_JXBanner
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXBanner/JXBanner-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/JXBanner/JXBanner-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 JXBannerVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char JXBannerVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXBanner/JXBanner.modulemap:
--------------------------------------------------------------------------------
1 | framework module JXBanner {
2 | umbrella header "JXBanner-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXBanner/JXBanner.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JXBanner
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JXPageControl"
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 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXPageControl/JXPageControl-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.1.3
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXPageControl/JXPageControl-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_JXPageControl : NSObject
3 | @end
4 | @implementation PodsDummy_JXPageControl
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXPageControl/JXPageControl-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/JXPageControl/JXPageControl-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 JXPageControlVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char JXPageControlVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXPageControl/JXPageControl.modulemap:
--------------------------------------------------------------------------------
1 | framework module JXPageControl {
2 | umbrella header "JXPageControl-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/JXPageControl/JXPageControl.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JXPageControl
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}/JXPageControl
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-JXBanner_Example/Pods-JXBanner_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-JXBanner_Example/Pods-JXBanner_Example-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## JXBanner
5 |
6 | Copyright (c) 2019 Code_TanJX
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 |
27 | ## JXPageControl
28 |
29 | Copyright (c) 2019 bboyXFX
30 |
31 | Permission is hereby granted, free of charge, to any person obtaining a copy
32 | of this software and associated documentation files (the "Software"), to deal
33 | in the Software without restriction, including without limitation the rights
34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35 | copies of the Software, and to permit persons to whom the Software is
36 | furnished to do so, subject to the following conditions:
37 |
38 | The above copyright notice and this permission notice shall be included in
39 | all copies or substantial portions of the Software.
40 |
41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
47 | THE SOFTWARE.
48 |
49 |
50 | ## SnapKit
51 |
52 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
53 |
54 | Permission is hereby granted, free of charge, to any person obtaining a copy
55 | of this software and associated documentation files (the "Software"), to deal
56 | in the Software without restriction, including without limitation the rights
57 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
58 | copies of the Software, and to permit persons to whom the Software is
59 | furnished to do so, subject to the following conditions:
60 |
61 | The above copyright notice and this permission notice shall be included in
62 | all copies or substantial portions of the Software.
63 |
64 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
69 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
70 | THE SOFTWARE.
71 |
72 | Generated by CocoaPods - https://cocoapods.org
73 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-JXBanner_Example/Pods-JXBanner_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) 2019 Code_TanJX <code_tanjx@163.com>
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is
24 | furnished to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in
27 | all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 | License
38 | MIT
39 | Title
40 | JXBanner
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | Copyright (c) 2019 bboyXFX <jaixiang.tan@net263.com>
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 | License
67 | MIT
68 | Title
69 | JXPageControl
70 | Type
71 | PSGroupSpecifier
72 |
73 |
74 | FooterText
75 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
76 |
77 | Permission is hereby granted, free of charge, to any person obtaining a copy
78 | of this software and associated documentation files (the "Software"), to deal
79 | in the Software without restriction, including without limitation the rights
80 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
81 | copies of the Software, and to permit persons to whom the Software is
82 | furnished to do so, subject to the following conditions:
83 |
84 | The above copyright notice and this permission notice shall be included in
85 | all copies or substantial portions of the Software.
86 |
87 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
90 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
92 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
93 | THE SOFTWARE.
94 |
95 | License
96 | MIT
97 | Title
98 | SnapKit
99 | Type
100 | PSGroupSpecifier
101 |
102 |
103 | FooterText
104 | Generated by CocoaPods - https://cocoapods.org
105 | Title
106 |
107 | Type
108 | PSGroupSpecifier
109 |
110 |
111 | StringsTable
112 | Acknowledgements
113 | Title
114 | Acknowledgements
115 |
116 |
117 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-JXBanner_Example/Pods-JXBanner_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_JXBanner_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_JXBanner_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-JXBanner_Example/Pods-JXBanner_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_JXBanner_ExampleVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_JXBanner_ExampleVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-JXBanner_Example/Pods-JXBanner_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JXBanner" "${PODS_CONFIGURATION_BUILD_DIR}/JXPageControl" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JXBanner/JXBanner.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/JXPageControl/JXPageControl.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 "JXBanner" -framework "JXPageControl" -framework "SnapKit"
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 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-JXBanner_Example/Pods-JXBanner_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_JXBanner_Example {
2 | umbrella header "Pods-JXBanner_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-JXBanner_Example/Pods-JXBanner_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JXBanner" "${PODS_CONFIGURATION_BUILD_DIR}/JXPageControl" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JXBanner/JXBanner.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/JXPageControl/JXPageControl.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 "JXBanner" -framework "JXPageControl" -framework "SnapKit"
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 |
--------------------------------------------------------------------------------
/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 | 4.2.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 |
--------------------------------------------------------------------------------
/Example/Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/Tests/Tests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 |
3 |
4 | class Tests: XCTestCase {
5 |
6 | override func setUp() {
7 | super.setUp()
8 | // Put setup code here. This method is called before the invocation of each test method in the class.
9 | }
10 |
11 | override func tearDown() {
12 | // Put teardown code here. This method is called after the invocation of each test method in the class.
13 | super.tearDown()
14 | }
15 |
16 | func testExample() {
17 | // This is an example of a functional test case.
18 | XCTAssert(true, "Pass")
19 | }
20 |
21 | func testPerformanceExample() {
22 | // This is an example of a performance test case.
23 | self.measure() {
24 | // Put the code you want to measure the time of here.
25 | }
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/JXBanner.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint JXBanner.podspec' to ensure this is a
3 | # valid spec before submitting.
4 | #
5 | # Any lines starting with a # are optional, but their use is encouraged
6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
7 | #
8 |
9 | Pod::Spec.new do |s|
10 | s.name = 'JXBanner'
11 | s.version = '0.3.6'
12 | s.summary = 'A multifunctional framework for banner unlimited rollover diagrams'
13 |
14 | # This description is used to generate tags and improve search results.
15 | # * Think: What does it do? Why did you write it? What is the focus?
16 | # * Try to keep it short, snappy and to the point.
17 | # * Write the description between the DESC delimiters below.
18 | # * Finally, don't worry about the indent, CocoaPods strips it!
19 |
20 | s.description = 'The framework relies on JXPageConytrol and contains many custom interfaces, such as transition animation, view structure, and Settings'
21 |
22 | s.homepage = 'https://github.com/Coder-TanJX'
23 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
24 | s.license = { :type => 'MIT', :file => 'LICENSE' }
25 | s.author = { 'Code_TanJX' => 'code_tanjx@163.com' }
26 | s.source = { :git => 'https://github.com/Coder-TanJX/JXBanner.git', :tag => s.version.to_s }
27 | # s.social_media_url = 'https://twitter.com/'
28 |
29 |
30 | s.ios.deployment_target = '8.0'
31 |
32 |
33 | if s.respond_to? 'swift_version'
34 | s.swift_version = "5.0"
35 | end
36 |
37 | if s.respond_to? 'swift_versions'
38 | s.swift_versions = ['4.2', '5.0']
39 | end
40 |
41 | s.subspec 'PageControl' do |ss|
42 | ss.source_files = 'JXBanner/Classes/PageControl/**/*'
43 | ss.dependency 'JXPageControl'
44 | end
45 |
46 | s.subspec 'Banner' do |ss|
47 |
48 | ss.subspec 'Cell' do |sss|
49 | sss.source_files = 'JXBanner/Classes/Banner/Cell/**/*'
50 | end
51 |
52 | ss.subspec 'Common' do |sss|
53 | sss.source_files = 'JXBanner/Classes/Banner/Common/**/*'
54 | end
55 |
56 | ss.subspec 'API' do |sss|
57 | sss.source_files = 'JXBanner/Classes/Banner/API/**/*'
58 | sss.dependency 'JXBanner/PageControl'
59 | sss.dependency 'JXBanner/Banner/Cell'
60 | end
61 |
62 | ss.subspec 'Transform' do |sss|
63 | sss.source_files = 'JXBanner/Classes/Banner/Transform/**/*'
64 | sss.dependency 'JXBanner/Banner/API'
65 | end
66 |
67 | ss.subspec 'Banner' do |sss|
68 | sss.source_files = 'JXBanner/Classes/Banner/Banner/**/*'
69 | sss.dependency 'JXBanner/Banner/API'
70 | sss.dependency 'JXBanner/Banner/Common'
71 | sss.dependency 'JXBanner/Banner/Transform'
72 | end
73 |
74 | end
75 |
76 | end
77 |
--------------------------------------------------------------------------------
/JXBanner/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/JXBanner/Assets/.gitkeep
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/API/JXBannerDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerDelegate.swift
3 | // Alamofire
4 | //
5 | // Created by Code_JX on 2019/6/1.
6 | //
7 |
8 | import UIKit
9 |
10 | public protocol JXBannerDelegate: class {
11 |
12 | /**
13 | Called when the cell is clicked
14 |
15 | - parameters:
16 | - banner: An instance of JXBannerType.
17 | - index: The index of the cell is clicked
18 | */
19 |
20 | func jxBanner(_ banner: JXBannerType,
21 | didSelectItemAt index: Int)
22 |
23 | /**
24 | Returns the index of the item in the middle of the bannerview
25 |
26 | - parameters:
27 | - banner: An instance of JXBannerType.
28 | - index: the index of the item in the middle of the bannerview
29 | */
30 |
31 | func jxBanner(_ banner: JXBannerType,
32 | center index: Int)
33 |
34 | /**
35 | This is a view to add mask subview
36 |
37 | - parameters:
38 | - banner: An instance of JXBannerType.
39 | - coverView: This is a view to add mask subview
40 | */
41 |
42 | func jxBanner(_ banner: JXBannerType,
43 | coverView: UIView)
44 | }
45 |
46 | /// The default implementation
47 | public extension JXBannerDelegate {
48 |
49 | func jxBanner(_ banner: JXBannerType,
50 | didSelectItemAt index: Int) {
51 | print(" -- jxBanner select item -- \(index) -- ")
52 | }
53 |
54 | func jxBanner(_ banner: JXBannerType,
55 | center index: Int) {}
56 |
57 | func jxBanner(_ banner: JXBannerType,
58 | coverView: UIView) {}
59 | }
60 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/API/JXBannerLayoutParams.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerLayoutParams.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/18.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public class JXBannerLayoutParams {
12 |
13 | // base
14 | public var itemSize: CGSize?
15 | public var itemSpacing: CGFloat = 0.0
16 | public var layoutType: JXBannerTransformable?
17 | public var scrollDirection: UICollectionView.ScrollDirection = .horizontal
18 |
19 | // JXBannerTransformable
20 | public var minimumScale: CGFloat = 0.8
21 | public var minimumAlpha: CGFloat = 1.0
22 | public var maximumAngle: CGFloat = 0.2
23 | public var rateOfChange: CGFloat = 0.4
24 | public var rateHorisonMargin: CGFloat = 0.2
25 |
26 | }
27 |
28 | // MARK: - Set function
29 | public extension JXBannerLayoutParams {
30 |
31 | func itemSize(_ itemSize: CGSize) -> JXBannerLayoutParams {
32 | self.itemSize = itemSize
33 | return self
34 | }
35 |
36 | func itemSpacing(_ itemSpacing: CGFloat) -> JXBannerLayoutParams {
37 | self.itemSpacing = itemSpacing
38 | return self
39 | }
40 |
41 | func layoutType(_ layoutType: JXBannerTransformable?) -> JXBannerLayoutParams {
42 | self.layoutType = layoutType
43 | return self
44 | }
45 |
46 | func scrollDirection(_ scrollDirection: UICollectionView.ScrollDirection) -> JXBannerLayoutParams {
47 | self.scrollDirection = scrollDirection
48 | return self
49 | }
50 |
51 | func minimumScale(_ minimumScale: CGFloat) -> JXBannerLayoutParams {
52 | self.minimumScale = minimumScale
53 | return self
54 | }
55 |
56 | func minimumAlpha(_ minimumAlpha: CGFloat) -> JXBannerLayoutParams {
57 | self.minimumAlpha = minimumAlpha
58 | return self
59 | }
60 |
61 | func maximumAngle(_ maximumAngle: CGFloat) -> JXBannerLayoutParams {
62 | self.maximumAngle = maximumAngle
63 | return self
64 | }
65 |
66 | func rateOfChange(_ rateOfChange: CGFloat) -> JXBannerLayoutParams {
67 | self.rateOfChange = rateOfChange
68 | return self
69 | }
70 |
71 | func rateHorisonMargin(_ rateHorisonMargin: CGFloat) -> JXBannerLayoutParams {
72 | self.rateHorisonMargin = rateHorisonMargin
73 | return self
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/API/JXBannerParams.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerParams.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/30.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | // MARK: - Property list
12 | public class JXBannerParams {
13 |
14 | public var isAutoPlay: Bool = true
15 |
16 | public var isBounces: Bool = true
17 |
18 | public var isShowPageControl: Bool = true
19 |
20 | public var isPagingEnabled: Bool = true
21 |
22 | public var contentInset = UIEdgeInsets.zero
23 |
24 | public var timeInterval: TimeInterval = 5.0
25 |
26 | public var cycleWay: CycleWay = .forward
27 |
28 | public var edgeTransitionType: JXBannerTransitionType? = .fade
29 |
30 | public var edgeTransitionSubtype: CATransitionSubtype = .fromRight
31 |
32 | internal var currentRollingDirection: RollingDirection = .right
33 | }
34 |
35 | // MARK: - Public enum
36 | public extension JXBannerParams {
37 |
38 | enum JXBannerTransitionType : String {
39 | case fade
40 | case push
41 | case reveal
42 | case moveIn
43 | case cube
44 | case suckEffect
45 | case oglFlip
46 | case rippleEffect
47 | case pageCurl
48 | case pageUnCurl
49 | case cameraIrisHollowOpen
50 | case cameraIrisHollowClose
51 | case curlDown
52 | case curlUp
53 | case flipFromLeft
54 | case flipFromRight
55 | }
56 |
57 | enum CycleWay {
58 | case forward
59 | case skipEnd
60 | case rollingBack
61 | }
62 |
63 | enum RollingDirection {
64 | case right
65 | case left
66 | }
67 | }
68 |
69 | // MARK: - Set function
70 | public extension JXBannerParams {
71 |
72 | func isAutoPlay(_ isAutoPlay: Bool) -> JXBannerParams {
73 | self.isAutoPlay = isAutoPlay
74 | return self
75 | }
76 |
77 | func isBounces(_ isBounces: Bool) -> JXBannerParams {
78 | self.isBounces = isBounces
79 | return self
80 | }
81 |
82 | func isPagingEnabled(_ isPagingEnabled: Bool) -> JXBannerParams {
83 | self.isPagingEnabled = isPagingEnabled
84 | return self
85 | }
86 |
87 | func contentInset(_ contentInset: UIEdgeInsets) -> JXBannerParams {
88 | self.contentInset = contentInset
89 | return self
90 | }
91 |
92 | func isShowPageControl(_ isShowPageControl: Bool) -> JXBannerParams {
93 | self.isShowPageControl = isShowPageControl
94 | return self
95 | }
96 |
97 | func timeInterval(_ timeInterval: TimeInterval) -> JXBannerParams {
98 | self.timeInterval = timeInterval
99 | return self
100 | }
101 |
102 | func cycleWay(_ cycleWay: CycleWay) -> JXBannerParams {
103 | self.cycleWay = cycleWay
104 | return self
105 | }
106 |
107 | func edgeTransitionType(_ edgeTransitionType: JXBannerTransitionType?) -> JXBannerParams {
108 | self.edgeTransitionType = edgeTransitionType
109 | return self
110 | }
111 |
112 | func edgeTransitionSubtype(_ edgeTransitionSubtype: CATransitionSubtype) -> JXBannerParams {
113 | self.edgeTransitionSubtype = edgeTransitionSubtype
114 | return self
115 | }
116 |
117 | internal func currentRollingDirection(_ currentRollingDirection: RollingDirection) -> JXBannerParams {
118 | self.currentRollingDirection = currentRollingDirection
119 | return self
120 | }
121 |
122 | }
123 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/API/JXBannerTransformable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransformable.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/14.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public protocol JXBannerTransformable {
12 |
13 | /**
14 | This callback will provide all the UICollectionViewLayoutAttributes,
15 | you can change his "transform" change the presentation
16 |
17 | */
18 |
19 | func transformToAttributes(collectionView: UICollectionView,
20 | params: JXBannerLayoutParams,
21 | attributes: UICollectionViewLayoutAttributes)
22 | }
23 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/API/JXBannerType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBaseBanner.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/11.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public protocol JXBannerType: UIView {
12 |
13 | /// Data source protocol for JXBannerType
14 | var dataSource: JXBannerDataSource? { get set }
15 |
16 | /// Delegate protocol for JXBannerType
17 | var delegate: JXBannerDelegate? { get set }
18 |
19 | /// Distinguish the banner
20 | var indentify: String? { get set }
21 |
22 | /// The refresh UI
23 | func reloadView()
24 |
25 | }
26 |
27 | /// A structure that registers cells so that
28 | /// we can distinguish and retrieve reused cells from the cache pool
29 |
30 | public struct JXBannerCellRegister {
31 |
32 | var type: UICollectionViewCell.Type?
33 | var reuseIdentifier: String
34 | var nib: UINib?
35 |
36 | /**
37 | Register cells so that we can distinguish and retrieve reused cell cache pools from the cache pool
38 |
39 | - parameters:
40 | - type: When you are not using the nib cell file, you must set the 'type' to the cell class!!
41 | - reuseIdentifier: If you use multiple jxbanners in your app, please set different values to facilitate the differentiation
42 | - nib: The nib parameter assignment must be done when using the nib cell file !!!
43 |
44 | - returns: Number Of Items
45 | */
46 | public init(type: UICollectionViewCell.Type?,
47 | reuseIdentifier: String,
48 | nib: UINib? = nil) {
49 | self.type = type
50 | self.reuseIdentifier = reuseIdentifier
51 | self.nib = nib
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Banner/JXBannerLayout.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerLayout.swift
3 | // NewBanner
4 | //
5 | // Created by Code_JX on 2019/5/12.
6 | // Copyright © 2019 China. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class JXBannerLayout: UICollectionViewFlowLayout {
12 |
13 | override init() {
14 | super.init()
15 | }
16 |
17 | required init?(coder aDecoder: NSCoder) {
18 | super.init(coder: aDecoder)
19 | }
20 |
21 | var params: JXBannerLayoutParams? {
22 | didSet {
23 | if let params = params {
24 | shouldInvalidateLayout = true
25 | scrollDirection = params.scrollDirection
26 | itemSize = params.itemSize ?? collectionView?.bounds.size
27 | ?? CGSize(width: 2, height: 2)
28 | minimumLineSpacing = params.itemSpacing
29 | minimumInteritemSpacing = params.itemSpacing
30 | } else {
31 | scrollDirection = .horizontal
32 | }
33 | }
34 | }
35 |
36 | /// Fixed cell offset bug: when XIB loaded JXBanner with Pagecount equal to 1
37 | var shouldInvalidateLayout = true
38 |
39 | var isPagingEnabled: Bool = true
40 |
41 | override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) ->
42 | Bool {
43 |
44 | if shouldInvalidateLayout || params?.layoutType != nil {
45 | shouldInvalidateLayout = false
46 | return true
47 | }
48 |
49 | return super.shouldInvalidateLayout(forBoundsChange: newBounds)
50 | }
51 |
52 | override func prepare() {
53 | super.prepare()
54 |
55 | // Set the margins
56 | if isPagingEnabled {
57 | let inset: CGFloat = (collectionView!.frame.width - itemSize.width) * 0.5
58 | sectionInset = UIEdgeInsets(top: 0,
59 | left: inset,
60 | bottom: 0,
61 | right: inset)
62 | }
63 |
64 | }
65 |
66 | override func layoutAttributesForElements(in rect: CGRect) ->
67 | [UICollectionViewLayoutAttributes]? {
68 |
69 | if let layoutType = params?.layoutType {
70 |
71 | let attributesArray: [UICollectionViewLayoutAttributes] =
72 | NSArray(array: super.layoutAttributesForElements(in: rect) ?? [],
73 | copyItems: true) as! [UICollectionViewLayoutAttributes]
74 | let visibleRect = CGRect(origin: collectionView!.contentOffset,
75 | size: collectionView!.bounds.size)
76 |
77 | for attributes in attributesArray {
78 | if !visibleRect.intersects(attributes.frame) { continue }
79 | applyTransformToAttributes(attributes: attributes,
80 | layoutType: layoutType)
81 | }
82 | return attributesArray
83 |
84 | }
85 | return super.layoutAttributesForElements(in: rect)
86 | }
87 |
88 | //MARK:- Transform
89 | func applyTransformToAttributes(attributes: UICollectionViewLayoutAttributes,
90 | layoutType: JXBannerTransformable) -> Void {
91 | let transformContext: JXBannerTransformContext = JXBannerTransformContext(transform: layoutType)
92 | transformContext.transformToAttributes(collectionView: collectionView!,
93 | params: params!,
94 | attributes: attributes)
95 | }
96 |
97 | }
98 |
99 |
100 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Cell/JXBannerBaseCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerBaseCell.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/18.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | open class JXBannerBaseCell: UICollectionViewCell {
12 |
13 | public override init(frame: CGRect) {
14 | super.init(frame: frame)
15 | jx_addSubviews()
16 | }
17 |
18 | required public init?(coder aDecoder: NSCoder) {
19 | super.init(coder: aDecoder)
20 | jx_addSubviews()
21 | }
22 |
23 | open func jx_addSubviews() {
24 | contentView.addSubview(imageView)
25 | }
26 |
27 | // MARK:- Lazy loading Cell subView
28 | public lazy var imageView: UIImageView = {
29 | let imageView = UIImageView()
30 | imageView.frame = self.contentView.bounds
31 | imageView.autoresizingMask = [
32 | .flexibleWidth,
33 | .flexibleHeight
34 | ]
35 | return imageView
36 | }()
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Cell/JXBannerCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerCell.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/18.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | open class JXBannerCell: JXBannerBaseCell {
12 |
13 | private let msgBGViewH: CGFloat = 24
14 | private let msgMargin: CGFloat = 10
15 |
16 | open override func jx_addSubviews() {
17 | super.jx_addSubviews()
18 | contentView.addSubview(msgBgView)
19 | msgBgView.addSubview(msgLabel)
20 | }
21 |
22 | public lazy var msgLabel: UILabel = {
23 | let label = UILabel()
24 | label.frame = CGRect(x: msgMargin,
25 | y: 0,
26 | width: msgBgView.bounds.width - 2*msgMargin,
27 | height: msgBgView.bounds.height)
28 | label.textColor = UIColor.white
29 | label.textAlignment = .center
30 | label.font = UIFont.systemFont(ofSize: 12)
31 | label.autoresizingMask = [
32 | .flexibleWidth,
33 | .flexibleHeight
34 | ]
35 | return label
36 | }()
37 |
38 | public lazy var msgBgView: UIView = {
39 | let view = UIView()
40 | view.frame = CGRect(x: 0,
41 | y: self.contentView.bounds.height - msgBGViewH,
42 | width: self.contentView.bounds.width,
43 | height: msgBGViewH)
44 | view.backgroundColor = UIColor.black.withAlphaComponent(0.4)
45 | view.autoresizingMask = [
46 | .flexibleWidth,
47 | .flexibleTopMargin
48 | ]
49 | return view
50 | }()
51 | }
52 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Common/IndexPath+JXCalculate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IndexPath+JXCalculate.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/6/1.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension IndexPath {
12 | /// Reload the "+" operator
13 | static func + (left: IndexPath,
14 | right: Int)
15 | -> IndexPath {
16 | return IndexPath.init(row: left.row + right,
17 | section: left.section)
18 | }
19 |
20 | /// Reload the "-" operator
21 | static func - (left: IndexPath,
22 | right: Int)
23 | -> IndexPath {
24 | return IndexPath.init(row: left.row - right,
25 | section: left.section)
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Common/Timer+JXBExtension.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Timer+JXBExtension.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/8/1.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class Block {
12 | let f : T
13 | init(_ f: T) {
14 | self.f = f
15 | }
16 | }
17 |
18 | extension Timer {
19 |
20 | class func jx_scheduledTimer(
21 | withTimeInterval interval: TimeInterval,
22 | repeats: Bool,
23 | block: @escaping (Timer) -> Swift.Void) -> Timer {
24 |
25 | if #available(iOS 10.0, *) {
26 |
27 | return Timer.scheduledTimer(withTimeInterval: interval,
28 | repeats: repeats,
29 | block: block)
30 | }
31 |
32 | return Timer.scheduledTimer(timeInterval: interval,
33 | target: self,
34 | selector: #selector(jx_timerAction),
35 | userInfo: Block(block),
36 | repeats: repeats)
37 | }
38 |
39 |
40 |
41 | @objc class func jx_timerAction(_ sender: Timer) {
42 | if let block = sender.userInfo as? Block<(Timer) -> Swift.Void> {
43 | block.f(sender)
44 | }
45 |
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Common/View+JXExtension.swift:
--------------------------------------------------------------------------------
1 | //
2 | // View+JXExtension.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/8/3.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIView {
12 |
13 | // Determine if it's on screen
14 | func isShowingOnWindow() -> Bool {
15 |
16 | guard self.window != nil,
17 | isHidden != true,
18 | alpha > 0.01,
19 | superview != nil
20 | else {
21 | return false
22 | }
23 |
24 | // convert self to window's Rect
25 | var rect: CGRect = superview!.convert(frame, to: nil)
26 |
27 | // if size is CGrectZero
28 | if rect.isEmpty || rect.isNull || rect.size.equalTo(CGSize.zero) {
29 | return false
30 | }
31 |
32 | // set offset
33 | if let scorllView = self as? UIScrollView {
34 | rect.origin.x += scorllView.contentOffset.x
35 | rect.origin.y += scorllView.contentOffset.y
36 | }
37 |
38 | // get the Rect that intersects self and window
39 | let screenRect: CGRect = UIScreen.main.bounds
40 | let intersectionRect: CGRect = rect.intersection(screenRect)
41 | if intersectionRect.isEmpty || intersectionRect.isNull {
42 | return false
43 | }
44 |
45 | return true
46 |
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Transform/JXBannerTransformContext.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransformContext.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/14.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | struct JXBannerTransformContext: JXBannerTransformable {
12 |
13 | var transform: JXBannerTransformable?
14 |
15 | init() {}
16 |
17 | init(transform: JXBannerTransformable) {
18 | self.transform = transform
19 | }
20 |
21 | func transformToAttributes(collectionView: UICollectionView,
22 | params: JXBannerLayoutParams,
23 | attributes: UICollectionViewLayoutAttributes) {
24 | transform?.transformToAttributes(collectionView: collectionView,
25 | params: params,
26 | attributes: attributes)
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Transform/JXBannerTransformCoverflow.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransformCoverflow.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/14.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public struct JXBannerTransformCoverflow: JXBannerTransformable {
12 |
13 | public init() {}
14 |
15 | public func transformToAttributes(collectionView: UICollectionView,
16 | params: JXBannerLayoutParams,
17 | attributes: UICollectionViewLayoutAttributes) {
18 |
19 | let collectionViewWidth = collectionView.frame.width
20 | if collectionViewWidth <= 0 { return }
21 |
22 | let centetX = collectionView.contentOffset.x + collectionViewWidth * 0.5;
23 | let delta = abs(attributes.center.x - centetX)
24 | let angle = min(delta / collectionViewWidth * (1 - params.rateOfChange), params.maximumAngle)
25 | let alpha = max(1 - delta / collectionViewWidth, params.minimumAlpha)
26 |
27 | applyCoverflowTransformToAttributes(viewCentetX: centetX,
28 | attributes: attributes,
29 | params: params,
30 | angle: angle,
31 | alpha: alpha)
32 | }
33 |
34 | func applyCoverflowTransformToAttributes(viewCentetX: CGFloat,
35 | attributes: UICollectionViewLayoutAttributes,
36 | params: JXBannerLayoutParams,
37 | angle: CGFloat,
38 | alpha: CGFloat) -> Void {
39 | var transform3D: CATransform3D = CATransform3DIdentity
40 | transform3D.m34 = -0.002
41 | var _angle: CGFloat = angle
42 | var _alpha: CGFloat = alpha
43 | let location = JXBannerTransfrom.itemLocation(viewCentetX: viewCentetX,
44 | itemCenterX: attributes.center.x)
45 |
46 | var translate: CGFloat = 0.0
47 | switch location {
48 | case .left:
49 | _angle = angle
50 | translate = (1.0 - cos(_angle * (1 + params.rateHorisonMargin) * CGFloat.pi)) * attributes.size.width
51 | case .right:
52 | _angle = -angle
53 | translate = -(1.0 - cos(_angle * (1 + params.rateHorisonMargin) * CGFloat.pi)) * attributes.size.width
54 | case .center:
55 | _angle = 0
56 | _alpha = 1
57 | }
58 | attributes.alpha = _alpha
59 | transform3D = CATransform3DRotate(transform3D,
60 | CGFloat.pi * _angle,
61 | 0, 1, 0)
62 | attributes.transform3D = CATransform3DTranslate(transform3D,
63 | translate, 0, 0)
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Transform/JXBannerTransformLinear.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransformLinear.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Code_JX on 2019/5/14.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public struct JXBannerTransformLinear: JXBannerTransformable {
12 |
13 | public init() {}
14 |
15 | public func transformToAttributes(collectionView: UICollectionView,
16 | params: JXBannerLayoutParams,
17 | attributes: UICollectionViewLayoutAttributes) {
18 |
19 | let collectionViewWidth = collectionView.frame.width
20 | if collectionViewWidth <= 0 { return }
21 | let centetX = collectionView.contentOffset.x + collectionViewWidth * 0.5
22 | let delta = abs(attributes.center.x - centetX)
23 | let scale = max(1 - delta / collectionViewWidth * params.rateOfChange, params.minimumScale)
24 | let alpha = max(1 - delta / collectionViewWidth, params.minimumAlpha)
25 |
26 | var transform: CGAffineTransform = CGAffineTransform(scaleX: scale, y: scale)
27 | var _alpha = alpha
28 |
29 | // Adjust spacing When Scroling
30 | let location = JXBannerTransfrom.itemLocation(viewCentetX: centetX,
31 | itemCenterX: attributes.center.x)
32 | let rate = 1.05 + params.rateHorisonMargin
33 | var translate: CGFloat = 0
34 | switch location {
35 | case .left:
36 | translate = rate * attributes.size.width * (1 - scale) / 2
37 | case .right:
38 | translate = -rate * attributes.size.width * (1 - scale) / 2
39 | case .center:
40 | _alpha = 1.0
41 | }
42 | transform = transform.translatedBy(x: translate, y: 0)
43 |
44 | // Set transform
45 | attributes.transform = transform;
46 | attributes.alpha = _alpha;
47 | }
48 | }
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/JXBanner/Classes/Banner/Transform/JXBannerTransfrom.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerTransfrom.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/6/6.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public struct JXBannerTransfrom {
12 |
13 | public enum JXTransformLocation {
14 | case left
15 | case center
16 | case right
17 | }
18 |
19 | public static func itemLocation(viewCentetX: CGFloat,
20 | itemCenterX: CGFloat) -> JXTransformLocation {
21 | var location: JXTransformLocation = .right
22 | if abs(itemCenterX - viewCentetX) < 0.5 {
23 | location = .center
24 | }else if (itemCenterX - viewCentetX) < 0 {
25 | location = .left
26 | }
27 | return location
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/JXBanner/Classes/PageControl/JXBannerPageControlBuilder.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerPageControlBuilder.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/7/29.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import JXPageControl
11 |
12 | public class JXBannerPageControlBuilder {
13 |
14 | // The JXPageControlType is the default indicator
15 | public var pageControl: (UIView & JXPageControlType)?
16 |
17 | /// Layout of the callback
18 | public var layout: (() -> ())?
19 | }
20 |
--------------------------------------------------------------------------------
/JXBanner/Classes/PageControl/JXBannerPageControlDefault.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JXBannerPageControlDefault.swift
3 | // JXBanner_Example
4 | //
5 | // Created by Coder_TanJX on 2019/7/29.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import JXPageControl
11 |
12 | class JXBannerPageControlDefault: JXPageControlJump {
13 |
14 | override func setBase() {
15 | super.setBase()
16 |
17 | activeSize = CGSize(width: 15, height: 6)
18 | inactiveSize = CGSize(width: 6, height: 6)
19 | columnSpacing = 0
20 | contentMode = .right
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2019 Code_TanJX
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 |
--------------------------------------------------------------------------------
/ReleaseNote.md:
--------------------------------------------------------------------------------
1 | # JXBanner release notes
2 |
3 | ## 0.3.4
4 | * **日期**:2020-07-01
5 | * **tag**: 0.3.4
6 | * **commit**: `f294d0ae68d7c`
7 | * **主要更新**:
8 | * 修复:在系统版本低的设备上会触发闪退的情况。(断点分析为collectionView未刷新完成,调用scrollToItem导致。)
9 |
10 | ## 0.3.5
11 | * **日期**:2020-07-29
12 | * **tag**: 0.3.5
13 | * **commit**: `2fbe2b7d1a5bdc4c6`
14 | * **主要更新**:
15 | * 修复:使用performBatchUpdates获取刷新结束方式出现崩溃。
16 |
17 | ## 0.3.6
18 | * **日期**:2020-09-22
19 | * **tag**: 0.3.6
20 | * **commit**: `ccf9ec900f3a6dcf21bcfe`
21 | * **主要更新**:
22 | * 新增:滚动方向支持垂直方向。
23 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------
/gif/banner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/gif/banner.gif
--------------------------------------------------------------------------------
/gif/coverflow.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/gif/coverflow.gif
--------------------------------------------------------------------------------
/gif/custom.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/gif/custom.gif
--------------------------------------------------------------------------------
/gif/default.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/gif/default.gif
--------------------------------------------------------------------------------
/gif/linear.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/gif/linear.gif
--------------------------------------------------------------------------------
/gif/middleTarget.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/gif/middleTarget.gif
--------------------------------------------------------------------------------
/gif/scrollView.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Coder-TanJX/JXBanner/7d24beebd65c8c3547824e0eb7367c5517bd54e1/gif/scrollView.gif
--------------------------------------------------------------------------------