├── .swift-version
├── PPNumberButtonSwift
├── Assets.xcassets
│ ├── Contents.json
│ ├── decrease_normal.imageset
│ │ ├── decrease_normal@2x.png
│ │ └── Contents.json
│ ├── increase_normal.imageset
│ │ ├── increase_normal@2x.png
│ │ └── Contents.json
│ ├── decrease_highlight.imageset
│ │ ├── decrease_highlight@2x.png
│ │ └── Contents.json
│ ├── increase_highlight.imageset
│ │ ├── increase_highlight@2x.png
│ │ └── Contents.json
│ ├── timeline_relationship_icon_addattention-1.imageset
│ │ ├── timeline_relationship_icon_addattention@3x.png
│ │ └── Contents.json
│ ├── timeline_relationship_icon_addattention.imageset
│ │ ├── timeline_relationship_icon_addattention@2x.png
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── AppDelegate.swift
├── ViewController.swift
└── PPNumberButtonSwift
│ └── PPNumberButton.swift
├── PPNumberButtonSwift.xcodeproj
├── xcuserdata
│ ├── duoyi.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── PPNumberButtonSwift.xcscheme
│ └── AndyPang.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── PPNumberButtonSwift.xcscheme
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ ├── duoyi.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ └── AndyPang.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── project.pbxproj
├── PPNumberButtonSwift.podspec
├── PPNumberButtonSwiftTests
├── Info.plist
└── PPNumberButtonSwiftTests.swift
├── LICENSE
└── README.md
/.swift-version:
--------------------------------------------------------------------------------
1 | 3.0
2 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/xcuserdata/duoyi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/decrease_normal.imageset/decrease_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkpang/PPNumberButtonSwift/HEAD/PPNumberButtonSwift/Assets.xcassets/decrease_normal.imageset/decrease_normal@2x.png
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/increase_normal.imageset/increase_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkpang/PPNumberButtonSwift/HEAD/PPNumberButtonSwift/Assets.xcassets/increase_normal.imageset/increase_normal@2x.png
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/decrease_highlight.imageset/decrease_highlight@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkpang/PPNumberButtonSwift/HEAD/PPNumberButtonSwift/Assets.xcassets/decrease_highlight.imageset/decrease_highlight@2x.png
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/increase_highlight.imageset/increase_highlight@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkpang/PPNumberButtonSwift/HEAD/PPNumberButtonSwift/Assets.xcassets/increase_highlight.imageset/increase_highlight@2x.png
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/project.xcworkspace/xcuserdata/duoyi.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkpang/PPNumberButtonSwift/HEAD/PPNumberButtonSwift.xcodeproj/project.xcworkspace/xcuserdata/duoyi.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/project.xcworkspace/xcuserdata/AndyPang.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkpang/PPNumberButtonSwift/HEAD/PPNumberButtonSwift.xcodeproj/project.xcworkspace/xcuserdata/AndyPang.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/timeline_relationship_icon_addattention-1.imageset/timeline_relationship_icon_addattention@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkpang/PPNumberButtonSwift/HEAD/PPNumberButtonSwift/Assets.xcassets/timeline_relationship_icon_addattention-1.imageset/timeline_relationship_icon_addattention@3x.png
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/timeline_relationship_icon_addattention.imageset/timeline_relationship_icon_addattention@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkpang/PPNumberButtonSwift/HEAD/PPNumberButtonSwift/Assets.xcassets/timeline_relationship_icon_addattention.imageset/timeline_relationship_icon_addattention@2x.png
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/decrease_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "decrease_normal@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/increase_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "increase_normal@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/decrease_highlight.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "decrease_highlight@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/increase_highlight.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "increase_highlight@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/timeline_relationship_icon_addattention.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "timeline_relationship_icon_addattention@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/timeline_relationship_icon_addattention-1.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" : "timeline_relationship_icon_addattention@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PPNumberButtonSwift.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'PPNumberButtonSwift'
3 | s.version = '0.2.0'
4 | s.license = { :type => "MIT", :file => "LICENSE" }
5 | s.homepage = 'https://github.com/jkpang/PPNumberButtonSwift.git'
6 | s.authors = { "jkpang" => "jkpang@outlook.com" }
7 | s.summary = '类似京东淘宝商品数量的加减按钮的Swift版,可定制程度高,使用简单!'
8 |
9 | s.platform = :ios, '8.0'
10 | s.source = { git: 'https://github.com/jkpang/PPNumberButtonSwift.git', :tag => s.version.to_s}
11 | s.source_files = 'PPNumberButtonSwift/PPNumberButtonSwift/*.{swift}'
12 | s.frameworks = 'UIKit'
13 | s.requires_arc = true
14 |
15 | # Pod Dependencies
16 |
17 | end
18 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/xcuserdata/AndyPang.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | PPNumberButtonSwift.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 22954E8B1D977629008E524D
16 |
17 | primary
18 |
19 |
20 | 22954E9F1D977629008E524D
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/xcuserdata/duoyi.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | PPNumberButtonSwift.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 22954E8B1D977629008E524D
16 |
17 | primary
18 |
19 |
20 | 22954E9F1D977629008E524D
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/PPNumberButtonSwiftTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 jkpang
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/PPNumberButtonSwiftTests/PPNumberButtonSwiftTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PPNumberButtonSwiftTests.swift
3 | // PPNumberButtonSwiftTests
4 | //
5 | // Created by AndyPang on 16/9/25.
6 | // Copyright © 2016年 AndyPang. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import PPNumberButtonSwift
11 |
12 | class PPNumberButtonSwiftTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | // Use XCTAssert and related functions to verify your tests produce the correct results.
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measure {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/PPNumberButtonSwift/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // PPNumberButtonSwift
4 | //
5 | // Created by AndyPang on 16/9/25.
6 | // Copyright © 2016年 AndyPang. 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: [UIApplicationLaunchOptionsKey: 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 invalidate graphics rendering callbacks. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // PPNumberButtonSwift
4 | //
5 | // Created by AndyPang on 16/9/25.
6 | // Copyright © 2016年 AndyPang. All rights reserved.
7 | //
8 |
9 | /*
10 | *********************************************************************************
11 | *
12 | *⭐️⭐️⭐️ 新建 PP-iOS学习交流群: 323408051 欢迎加入!!! ⭐️⭐️⭐️
13 | *
14 | * 如果您在使用 PPNumberButtonSwift 的过程中出现bug或有更好的建议,还请及时以下列方式联系我,我会及
15 | * 时修复bug,解决问题.
16 | *
17 | * Weibo : jkpang-庞
18 | * Email : jkpang@outlook.com
19 | * QQ 群 : 323408051
20 | * GitHub: https://github.com/jkpang
21 | *
22 | * PS:PPNumberButtonSwift的Objective-C版本:
23 | * https://github.com/jkpang/PPNumberButton
24 | *
25 | * 如果 PPNumberButtonSwift 好用,希望您能Star支持,你的 ⭐️ 是我持续更新的动力!
26 | *********************************************************************************
27 | */
28 |
29 | import UIKit
30 |
31 | class ViewController: UIViewController {
32 |
33 | override func viewDidLoad() {
34 | super.viewDidLoad()
35 |
36 | example1()
37 | example2()
38 | example3()
39 | example4()
40 | }
41 |
42 | // MARK: - 默认状态
43 | func example1() {
44 |
45 | let numberButton = PPNumberButton.init(frame: CGRect(x: 100, y: 100, width: 110, height: 30))
46 | //开启抖动动画
47 | numberButton.shakeAnimation = true
48 | numberButton.maxValue = 10
49 | numberButton.minValue = 2
50 | //加减按钮的闭包回调
51 | numberButton.numberResult { (number) in
52 |
53 | print(number)
54 | }
55 |
56 | view.addSubview(numberButton)
57 |
58 | }
59 |
60 | // MARK: - 边框状态
61 | func example2() {
62 |
63 | let numberButton = PPNumberButton.init(frame: CGRect(x: 100, y: 160, width: 200, height: 30))
64 |
65 | //设置边框颜色
66 | numberButton.borderColor(UIColor.gray)
67 |
68 | //加减按钮的闭包回调
69 | numberButton.numberResult { (number) in
70 |
71 | print(number)
72 | }
73 |
74 | view.addSubview(numberButton)
75 | }
76 |
77 | // MARK: - 自定义加减按钮的文字
78 | func example3() {
79 |
80 | let numberButton = PPNumberButton.init(frame: CGRect(x: 100, y: 220, width: 150, height: 44))
81 | //设置加减按钮的标题
82 | numberButton.setTitle(decreaseTitle: "减", increaseTitle: "加")
83 | //设置加减按钮标题的字体大小
84 | numberButton.buttonTitleFont(UIFont.systemFont(ofSize: 15))
85 | //开启抖动动画
86 | numberButton.shakeAnimation = true
87 | //加减按钮的闭包回调
88 | numberButton.numberResult { (number) in
89 |
90 | print(number)
91 | }
92 |
93 | view.addSubview(numberButton)
94 | }
95 |
96 | // MARK: - 自定义加减按钮背景图片
97 | func example4() {
98 |
99 | let numberButton = PPNumberButton.init(frame: CGRect(x: 100, y: 300, width: 100, height: 30))
100 |
101 | //设置加减按钮的自定义图片
102 | numberButton.setImage(decreaseImage: UIImage.init(named: "decrease_highlight")!, increaseImage: UIImage.init(named: "timeline_relationship_icon_addattention-1")!)
103 |
104 | //开启抖动动画
105 | numberButton.shakeAnimation = true
106 | //加减按钮的闭包回调
107 | numberButton.numberResult { (number) in
108 |
109 | print(number)
110 | }
111 |
112 | view.addSubview(numberButton)
113 |
114 | }
115 |
116 |
117 | override func touchesBegan(_ touches: Set, with event: UIEvent?) {
118 | view.endEditing(true)
119 | }
120 |
121 |
122 | override func didReceiveMemoryWarning() {
123 | super.didReceiveMemoryWarning()
124 | // Dispose of any resources that can be recreated.
125 | }
126 |
127 |
128 | }
129 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PPNumberButtonSwift
2 |
3 |      [](http://weibo.com/5743737098/profile?rightmod=1&wvr=6&mod=personinfo&is_all=1)
4 |
5 | 仿京东淘宝购物车商品的加减按钮的Swift版本,可定制程度较高, 使用简单,和Objective-C版本功能相同!
6 |
7 | #### 如果你需要Objective-C版本,请戳: https://github.com/jkpang/PPNumberButton
8 |
9 | 
10 |
11 | ### 新建 PP-iOS学习交流群 : 323408051 有关于PP系列封装的问题和iOS技术可以在此群讨论
12 |
13 | ## Requirements 要求
14 | * iOS 8+
15 | * Xcode 8+
16 |
17 | ## Installation 安装
18 | ### 1.手动安装:
19 | 下载DEMO后,将PPNumberButtonSwift子文件夹拖入到项目中, 就可以直接使用,不用import任何东西.
20 | ### 2.CocoaPods安装:
21 | first
22 | `pod 'PPNumberButtonSwift',:git => 'https://github.com/jkpang/PPNumberButtonSwift.git' `
23 |
24 | then
25 | `pod install或pod install --no-repo-update`
26 |
27 | 如果发现pod search PPNumberButtonSwift 不是最新版本,在终端执行pod setup命令更新本地spec镜像缓存(时间可能有点长),重新搜索就OK了
28 | ## Usage 使用方法
29 |
30 | ### 1.默认样式
31 |
32 | ```swift
33 | let numberButton = PPNumberButton.init(frame: CGRect(x: 100, y: 100, width: 110, height: 30))
34 | //开启抖动动画
35 | numberButton.shakeAnimation = true
36 | //加减按钮的闭包回调
37 | numberButton.numberResult { (number) in
38 | print(number)
39 | }
40 |
41 | view.addSubview(numberButton)
42 | ```
43 | ### 2.边框样式
44 |
45 | ```swift
46 | let numberButton = PPNumberButton.init(frame: CGRect(x: 100, y: 160, width: 200, height: 30))
47 |
48 | //设置边框颜色
49 | numberButton.borderColor(UIColor.grayColor())
50 | //加减按钮的闭包回调
51 | numberButton.numberResult { (number) in
52 | print(number)
53 | }
54 |
55 | view.addSubview(numberButton)
56 | ```
57 | ### 3.自定义加减按钮的标题
58 |
59 | ```swift
60 | let numberButton = PPNumberButton.init(frame: CGRect(x: 100, y: 220, width: 150, height: 44))
61 | //设置加减按钮的标题
62 | numberButton.setTitle(decreaseTitle: "加", increaseTitle: "减")
63 | //设置加减按钮标题的字体大小
64 | numberButton.buttonTitleFont(UIFont.systemFontOfSize(15))
65 | //开启抖动动画
66 | numberButton.shakeAnimation = true
67 | //加减按钮的闭包回调
68 | numberButton.numberResult { (number) in
69 | print(number)
70 | }
71 |
72 | view.addSubview(numberButton)
73 |
74 | ```
75 | ### 4.自定义加减按钮的背景图片
76 |
77 | ```swift
78 | let numberButton = PPNumberButton.init(frame: CGRect(x: 100, y: 300, width: 100, height: 30))
79 |
80 | //设置加减按钮的自定义图片
81 | numberButton.setImage(decreaseImage: UIImage.init(named: "decrease_highlight")!, increaseImage: UIImage.init(named: "timeline_relationship_icon_addattention-1")!)
82 | //开启抖动动画
83 | numberButton.shakeAnimation = true
84 | //加减按钮的闭包回调
85 | numberButton.numberResult { (number) in
86 | print(number)
87 | }
88 |
89 | view.addSubview(numberButton)
90 |
91 |
92 | ```
93 | ##### 注: 加减号按钮的标题和背景图片只能设置其中一个,若全部设置,则以最后设置的类型为准
94 |
95 | ## 使用xib创建
96 | 在控制器界面拖入UIView控件,在右侧的设置栏中将class名修改为PPNumberButton,按回车就OK了.
97 |
98 | 
99 |
100 | ====
101 |
102 | #### 你的Star是我持续更新的动力!
103 |
104 | ## CocoaPods更新日志
105 |
106 | * 2016.11.03(tag:0.2.0)--设置maxValue(最大值)与minValue(最小值)属性接口.
107 | * 2016.09.24(tag:0.1.1)--适配Swift3
108 | * 2016.09.14(tag:0.1.0)--Pods初始化
109 |
110 | ## 联系方式:
111 | * Weibo : [@jkpang-庞](http://weibo.com/5743737098/profile?rightmod=1&wvr=6&mod=personinfo&is_all=1)
112 | * Email : jkpang@outlook.com
113 | * QQ群 : 323408051
114 |
115 | 
116 |
117 | ## 许可证
118 | PPNumberButtonSwift 使用 MIT 许可证,详情见 LICENSE 文件。
119 |
120 |
121 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/xcuserdata/duoyi.xcuserdatad/xcschemes/PPNumberButtonSwift.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
76 |
77 |
83 |
85 |
91 |
92 |
93 |
94 |
96 |
97 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/xcuserdata/AndyPang.xcuserdatad/xcschemes/PPNumberButtonSwift.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
76 |
77 |
83 |
85 |
91 |
92 |
93 |
94 |
96 |
97 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift/PPNumberButtonSwift/PPNumberButton.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PPNumberButton.swift
3 | // PPNumberButtonSwift
4 | //
5 | // Created by AndyPang on 16/9/25.
6 | // Copyright © 2016年 AndyPang. All rights reserved.
7 | //
8 |
9 | /*
10 | *********************************************************************************
11 | *
12 | *⭐️⭐️⭐️ 新建 PP-iOS学习交流群: 323408051 欢迎加入!!! ⭐️⭐️⭐️
13 | *
14 | * 如果您在使用 PPNumberButtonSwift 的过程中出现bug或有更好的建议,还请及时以下列方式联系我,我会及
15 | * 时修复bug,解决问题.
16 | *
17 | * Weibo : jkpang-庞
18 | * Email : jkpang@outlook.com
19 | * QQ 群 : 323408051
20 | * GitHub: https://github.com/jkpang
21 | *
22 | * PS:PPNumberButtonSwift的Objective-C版本:
23 | * https://github.com/jkpang/PPNumberButton
24 | *
25 | * 如果 PPNumberButtonSwift 好用,希望您能Star支持,你的 ⭐️ 是我持续更新的动力!
26 | *********************************************************************************
27 | */
28 |
29 | import UIKit
30 |
31 | /// 定义一个闭包
32 | public typealias ResultClosure = (_ number: String)->()
33 |
34 | public protocol PPNumberButtonDelegate: NSObjectProtocol {
35 | func numberButtonResult(_ numberButton: PPNumberButton, number: String)
36 | }
37 |
38 | @IBDesignable open class PPNumberButton: UIView {
39 | weak var delegate: PPNumberButtonDelegate? // 代理
40 | var NumberResultClosure: ResultClosure? // 闭包
41 | var decreaseBtn: UIButton! // 减按钮
42 | var increaseBtn: UIButton! // 加按钮
43 | var textField: UITextField! // 数量展示/输入框
44 | var timer: Timer! // 快速加减定时器
45 | public var _minValue = 1 // 最大值
46 | public var _maxValue = Int.max // 最大值
47 | public var shakeAnimation: Bool = false // 是否打开抖动动画
48 |
49 | override public init(frame: CGRect) {
50 | super.init(frame: frame)
51 |
52 | setupUI()
53 | //整个控件的默认尺寸(和某宝上面的按钮同样大小)
54 | if frame.isEmpty {self.frame = CGRect(x: 0, y: 0, width: 110, height: 30)}
55 | }
56 |
57 | required public init?(coder aDecoder: NSCoder) {
58 | super.init(coder: aDecoder)
59 |
60 | }
61 |
62 | override open func awakeFromNib() {
63 | setupUI()
64 | }
65 |
66 | //设置UI布局
67 | fileprivate func setupUI() {
68 | backgroundColor = UIColor.white
69 | layer.cornerRadius = 3.0
70 | clipsToBounds = true
71 |
72 | decreaseBtn = setupButton(title: "-")
73 | increaseBtn = setupButton(title: "+")
74 |
75 | textField = UITextField.init()
76 | textField.text = "1"
77 | textField.font = UIFont.boldSystemFont(ofSize: 15)
78 | textField.delegate = self
79 | textField.keyboardType = UIKeyboardType.numberPad
80 | textField.textAlignment = NSTextAlignment.center
81 | self.addSubview(textField)
82 | }
83 |
84 | // MARK: - 重新布局UI
85 | override open func layoutSubviews() {
86 | super.layoutSubviews()
87 |
88 | let height = frame.size.height
89 | let width = frame.size.width
90 | decreaseBtn.frame = CGRect(x: 0, y: 0, width: height, height: height)
91 | increaseBtn.frame = CGRect(x: width - height, y: 0, width: height, height: height)
92 | textField.frame = CGRect(x: height, y: 0, width: width - 2.0*height, height: height)
93 | }
94 |
95 | //设置加减按钮的公共方法
96 | fileprivate func setupButton(title:String) -> UIButton {
97 | let button = UIButton.init();
98 | button.setTitle(title, for: UIControlState())
99 | button.setTitleColor(UIColor.gray, for: UIControlState())
100 | button.addTarget(self, action:#selector(self.touchDown(_:)) , for: UIControlEvents.touchDown)
101 | button.addTarget(self, action:#selector(self.touchUp) , for:UIControlEvents.touchUpOutside)
102 | button.addTarget(self, action:#selector(self.touchUp) , for:UIControlEvents.touchUpInside)
103 | button.addTarget(self, action:#selector(self.touchUp) , for:UIControlEvents.touchCancel)
104 | self.addSubview(button)
105 | return button;
106 | }
107 |
108 | // MARK: - 加减按钮点击响应
109 | //点击按钮: 单击逐次加减,长按连续加减
110 | @objc fileprivate func touchDown(_ button: UIButton) {
111 | textField.endEditing(false)
112 | if button == decreaseBtn {
113 | timer = Timer.scheduledTimer(timeInterval: 0.15, target: self, selector: #selector(self.decrease), userInfo: nil, repeats: true)
114 | } else {
115 | timer = Timer.scheduledTimer(timeInterval: 0.15, target: self, selector: #selector(self.increase), userInfo: nil, repeats: true)
116 | }
117 | timer.fire()
118 | }
119 |
120 | //松开按钮:清除定时器
121 | @objc fileprivate func touchUp() {
122 | cleanTimer()
123 | }
124 |
125 | // MARK: - 减运算
126 | @objc fileprivate func decrease() {
127 | if (textField.text?.characters.count)! == 0 || Int(textField.text!)! <= _minValue {
128 | textField.text = "\(_minValue)"
129 | }
130 |
131 | let number = Int(textField.text!)! - 1;
132 | if number >= _minValue {
133 | textField.text = "\(number)";
134 |
135 | //闭包回调
136 | NumberResultClosure?("\(number)")
137 | //delegate的回调
138 | delegate?.numberButtonResult(self, number: "\(number)")
139 | } else {
140 | //添加抖动动画
141 | if shakeAnimation {shakeAnimationFunc()}
142 | print("数量不能小于\(_minValue)");
143 | }
144 | }
145 |
146 | // MARK: - 加运算
147 | @objc fileprivate func increase() {
148 | if (textField.text?.characters.count)! == 0 || Int(textField.text!)! <= _minValue {
149 | textField.text = "\(_minValue)"
150 | }
151 |
152 | let number = Int(textField.text!)! + 1;
153 |
154 | if number <= _maxValue {
155 | textField.text = "\(number)";
156 | //闭包回调
157 | NumberResultClosure?("\(number)")
158 | //delegate的回调
159 | delegate?.numberButtonResult(self, number: "\(number)")
160 | } else {
161 | //添加抖动动画
162 | if shakeAnimation {shakeAnimationFunc()}
163 | print("已超过最大数量\(_maxValue)");
164 | }
165 |
166 |
167 | }
168 |
169 | // MARK: - 抖动动画
170 | fileprivate func shakeAnimationFunc() {
171 | let animation = CAKeyframeAnimation.init(keyPath: "position.x")
172 | //获取当前View的position坐标
173 | let positionX = layer.position.x
174 | //设置抖动的范围
175 | animation.values = [(positionX-10),(positionX),(positionX+10)]
176 | //动画重复的次数
177 | animation.repeatCount = 3
178 | //动画时间
179 | animation.duration = 0.07
180 | //设置自动反转
181 | animation.autoreverses = true
182 | //将动画添加到layer
183 | layer.add(animation, forKey: nil)
184 | }
185 |
186 | fileprivate func cleanTimer() {
187 | if ((timer?.isValid) != nil) {
188 | timer.invalidate()
189 | timer = nil;
190 | }
191 | }
192 |
193 | deinit {
194 | cleanTimer()
195 | }
196 |
197 |
198 | }
199 |
200 | extension PPNumberButton: UITextFieldDelegate {
201 |
202 | // MARK: - UITextFieldDelegate
203 | public func textFieldDidEndEditing(_ textField: UITextField) {
204 | if (textField.text?.characters.count)! == 0 || Int(textField.text!)! < _minValue {
205 | textField.text = "\(_minValue)"
206 | }
207 | if Int(textField.text!)! > _maxValue {
208 | textField.text = "\(_maxValue)"
209 | }
210 | //闭包回调
211 | NumberResultClosure?("\(textField.text!)")
212 | //delegate的回调
213 | delegate?.numberButtonResult(self, number: "\(textField.text!)")
214 |
215 | }
216 |
217 | }
218 |
219 | // MARK: - 自定义UI接口
220 | public extension PPNumberButton {
221 |
222 | /**
223 | 输入框中的内容
224 | */
225 | var currentNumber: String? {
226 | get {
227 | return (textField.text!)
228 | }
229 | set {
230 | textField.text = newValue
231 | }
232 | }
233 | /**
234 | 设置最小值
235 | */
236 | var minValue: Int {
237 | get {
238 | return _minValue
239 | }
240 | set {
241 | _minValue = newValue
242 | textField.text = "\(newValue)"
243 | }
244 | }
245 | /**
246 | 设置最大值
247 | */
248 | var maxValue: Int {
249 | get {
250 | return _maxValue
251 | }
252 | set {
253 | _maxValue = newValue
254 | }
255 | }
256 |
257 | /**
258 | 加减按钮的响应闭包回调
259 | */
260 | func numberResult(_ finished: @escaping ResultClosure) {
261 | NumberResultClosure = finished
262 | }
263 |
264 | /**
265 | 输入框中的字体属性
266 | */
267 | func inputFieldFont(_ inputFieldFont: UIFont) {
268 | textField.font = inputFieldFont;
269 | }
270 |
271 | /**
272 | 加减按钮的字体属性
273 | */
274 | func buttonTitleFont(_ buttonTitleFont: UIFont) {
275 | increaseBtn.titleLabel!.font = buttonTitleFont;
276 | decreaseBtn.titleLabel!.font = buttonTitleFont;
277 | }
278 |
279 | /**
280 | 设置按钮的边框颜色
281 | */
282 | func borderColor(_ borderColor: UIColor) {
283 | layer.borderColor = borderColor.cgColor;
284 | decreaseBtn.layer.borderColor = borderColor.cgColor;
285 | increaseBtn.layer.borderColor = borderColor.cgColor;
286 |
287 | layer.borderWidth = 0.5;
288 | decreaseBtn.layer.borderWidth = 0.5;
289 | increaseBtn.layer.borderWidth = 0.5;
290 | }
291 |
292 | //注意:加减号按钮的标题和背景图片只能设置其中一个,若全部设置,则以最后设置的类型为准
293 |
294 | /**
295 | 设置加/减按钮的标题
296 |
297 | - parameter decreaseTitle: 减按钮标题
298 | - parameter increaseTitle: 加按钮标题
299 | */
300 | func setTitle(decreaseTitle: String, increaseTitle: String) {
301 | decreaseBtn.setBackgroundImage(nil, for: UIControlState())
302 | increaseBtn.setBackgroundImage(nil, for: UIControlState())
303 |
304 | decreaseBtn.setTitle(decreaseTitle, for: UIControlState())
305 | increaseBtn.setTitle(increaseTitle, for: UIControlState())
306 | }
307 |
308 | /**
309 | 设置加/减按钮的背景图片
310 |
311 | - parameter decreaseImage: 减按钮背景图片
312 | - parameter increaseImage: 加按钮背景图片
313 | */
314 | func setImage(decreaseImage: UIImage, increaseImage: UIImage) {
315 | decreaseBtn.setTitle(nil, for: UIControlState())
316 | increaseBtn.setTitle(nil, for: UIControlState())
317 |
318 | decreaseBtn.setBackgroundImage(decreaseImage, for: UIControlState())
319 | increaseBtn.setBackgroundImage(increaseImage, for: UIControlState())
320 | }
321 |
322 | }
323 |
--------------------------------------------------------------------------------
/PPNumberButtonSwift.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 22106B201D995CE900D16803 /* .swift-version in Resources */ = {isa = PBXBuildFile; fileRef = 22106B1F1D995CE900D16803 /* .swift-version */; };
11 | 22954E901D977629008E524D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22954E8F1D977629008E524D /* AppDelegate.swift */; };
12 | 22954E921D977629008E524D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22954E911D977629008E524D /* ViewController.swift */; };
13 | 22954E951D977629008E524D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 22954E931D977629008E524D /* Main.storyboard */; };
14 | 22954E971D977629008E524D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 22954E961D977629008E524D /* Assets.xcassets */; };
15 | 22954E9A1D977629008E524D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 22954E981D977629008E524D /* LaunchScreen.storyboard */; };
16 | 22954EA51D977629008E524D /* PPNumberButtonSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22954EA41D977629008E524D /* PPNumberButtonSwiftTests.swift */; };
17 | 22954EB11D977670008E524D /* PPNumberButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22954EB01D977670008E524D /* PPNumberButton.swift */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 22954EA11D977629008E524D /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 22954E841D977629008E524D /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = 22954E8B1D977629008E524D;
26 | remoteInfo = PPNumberButtonSwift;
27 | };
28 | /* End PBXContainerItemProxy section */
29 |
30 | /* Begin PBXFileReference section */
31 | 22106B1F1D995CE900D16803 /* .swift-version */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ".swift-version"; sourceTree = ""; };
32 | 22954E8C1D977629008E524D /* PPNumberButtonSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PPNumberButtonSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };
33 | 22954E8F1D977629008E524D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
34 | 22954E911D977629008E524D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
35 | 22954E941D977629008E524D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
36 | 22954E961D977629008E524D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
37 | 22954E991D977629008E524D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
38 | 22954E9B1D977629008E524D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
39 | 22954EA01D977629008E524D /* PPNumberButtonSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PPNumberButtonSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 22954EA41D977629008E524D /* PPNumberButtonSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PPNumberButtonSwiftTests.swift; sourceTree = ""; };
41 | 22954EA61D977629008E524D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
42 | 22954EB01D977670008E524D /* PPNumberButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PPNumberButton.swift; sourceTree = ""; };
43 | /* End PBXFileReference section */
44 |
45 | /* Begin PBXFrameworksBuildPhase section */
46 | 22954E891D977629008E524D /* Frameworks */ = {
47 | isa = PBXFrameworksBuildPhase;
48 | buildActionMask = 2147483647;
49 | files = (
50 | );
51 | runOnlyForDeploymentPostprocessing = 0;
52 | };
53 | 22954E9D1D977629008E524D /* Frameworks */ = {
54 | isa = PBXFrameworksBuildPhase;
55 | buildActionMask = 2147483647;
56 | files = (
57 | );
58 | runOnlyForDeploymentPostprocessing = 0;
59 | };
60 | /* End PBXFrameworksBuildPhase section */
61 |
62 | /* Begin PBXGroup section */
63 | 22954E831D977629008E524D = {
64 | isa = PBXGroup;
65 | children = (
66 | 22106B1F1D995CE900D16803 /* .swift-version */,
67 | 22954E8E1D977629008E524D /* PPNumberButtonSwift */,
68 | 22954EA31D977629008E524D /* PPNumberButtonSwiftTests */,
69 | 22954E8D1D977629008E524D /* Products */,
70 | );
71 | sourceTree = "";
72 | };
73 | 22954E8D1D977629008E524D /* Products */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 22954E8C1D977629008E524D /* PPNumberButtonSwift.app */,
77 | 22954EA01D977629008E524D /* PPNumberButtonSwiftTests.xctest */,
78 | );
79 | name = Products;
80 | sourceTree = "";
81 | };
82 | 22954E8E1D977629008E524D /* PPNumberButtonSwift */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 22954EAF1D97765B008E524D /* PPNumberButtonSwift */,
86 | 22954E8F1D977629008E524D /* AppDelegate.swift */,
87 | 22954E911D977629008E524D /* ViewController.swift */,
88 | 22954E931D977629008E524D /* Main.storyboard */,
89 | 22954E961D977629008E524D /* Assets.xcassets */,
90 | 22954E981D977629008E524D /* LaunchScreen.storyboard */,
91 | 22954E9B1D977629008E524D /* Info.plist */,
92 | );
93 | path = PPNumberButtonSwift;
94 | sourceTree = "";
95 | };
96 | 22954EA31D977629008E524D /* PPNumberButtonSwiftTests */ = {
97 | isa = PBXGroup;
98 | children = (
99 | 22954EA41D977629008E524D /* PPNumberButtonSwiftTests.swift */,
100 | 22954EA61D977629008E524D /* Info.plist */,
101 | );
102 | path = PPNumberButtonSwiftTests;
103 | sourceTree = "";
104 | };
105 | 22954EAF1D97765B008E524D /* PPNumberButtonSwift */ = {
106 | isa = PBXGroup;
107 | children = (
108 | 22954EB01D977670008E524D /* PPNumberButton.swift */,
109 | );
110 | path = PPNumberButtonSwift;
111 | sourceTree = "";
112 | };
113 | /* End PBXGroup section */
114 |
115 | /* Begin PBXNativeTarget section */
116 | 22954E8B1D977629008E524D /* PPNumberButtonSwift */ = {
117 | isa = PBXNativeTarget;
118 | buildConfigurationList = 22954EA91D977629008E524D /* Build configuration list for PBXNativeTarget "PPNumberButtonSwift" */;
119 | buildPhases = (
120 | 22954E881D977629008E524D /* Sources */,
121 | 22954E891D977629008E524D /* Frameworks */,
122 | 22954E8A1D977629008E524D /* Resources */,
123 | );
124 | buildRules = (
125 | );
126 | dependencies = (
127 | );
128 | name = PPNumberButtonSwift;
129 | productName = PPNumberButtonSwift;
130 | productReference = 22954E8C1D977629008E524D /* PPNumberButtonSwift.app */;
131 | productType = "com.apple.product-type.application";
132 | };
133 | 22954E9F1D977629008E524D /* PPNumberButtonSwiftTests */ = {
134 | isa = PBXNativeTarget;
135 | buildConfigurationList = 22954EAC1D977629008E524D /* Build configuration list for PBXNativeTarget "PPNumberButtonSwiftTests" */;
136 | buildPhases = (
137 | 22954E9C1D977629008E524D /* Sources */,
138 | 22954E9D1D977629008E524D /* Frameworks */,
139 | 22954E9E1D977629008E524D /* Resources */,
140 | );
141 | buildRules = (
142 | );
143 | dependencies = (
144 | 22954EA21D977629008E524D /* PBXTargetDependency */,
145 | );
146 | name = PPNumberButtonSwiftTests;
147 | productName = PPNumberButtonSwiftTests;
148 | productReference = 22954EA01D977629008E524D /* PPNumberButtonSwiftTests.xctest */;
149 | productType = "com.apple.product-type.bundle.unit-test";
150 | };
151 | /* End PBXNativeTarget section */
152 |
153 | /* Begin PBXProject section */
154 | 22954E841D977629008E524D /* Project object */ = {
155 | isa = PBXProject;
156 | attributes = {
157 | LastSwiftUpdateCheck = 0800;
158 | LastUpgradeCheck = 0800;
159 | ORGANIZATIONNAME = AndyPang;
160 | TargetAttributes = {
161 | 22954E8B1D977629008E524D = {
162 | CreatedOnToolsVersion = 8.0;
163 | ProvisioningStyle = Automatic;
164 | };
165 | 22954E9F1D977629008E524D = {
166 | CreatedOnToolsVersion = 8.0;
167 | ProvisioningStyle = Automatic;
168 | TestTargetID = 22954E8B1D977629008E524D;
169 | };
170 | };
171 | };
172 | buildConfigurationList = 22954E871D977629008E524D /* Build configuration list for PBXProject "PPNumberButtonSwift" */;
173 | compatibilityVersion = "Xcode 3.2";
174 | developmentRegion = English;
175 | hasScannedForEncodings = 0;
176 | knownRegions = (
177 | en,
178 | Base,
179 | );
180 | mainGroup = 22954E831D977629008E524D;
181 | productRefGroup = 22954E8D1D977629008E524D /* Products */;
182 | projectDirPath = "";
183 | projectRoot = "";
184 | targets = (
185 | 22954E8B1D977629008E524D /* PPNumberButtonSwift */,
186 | 22954E9F1D977629008E524D /* PPNumberButtonSwiftTests */,
187 | );
188 | };
189 | /* End PBXProject section */
190 |
191 | /* Begin PBXResourcesBuildPhase section */
192 | 22954E8A1D977629008E524D /* Resources */ = {
193 | isa = PBXResourcesBuildPhase;
194 | buildActionMask = 2147483647;
195 | files = (
196 | 22106B201D995CE900D16803 /* .swift-version in Resources */,
197 | 22954E9A1D977629008E524D /* LaunchScreen.storyboard in Resources */,
198 | 22954E971D977629008E524D /* Assets.xcassets in Resources */,
199 | 22954E951D977629008E524D /* Main.storyboard in Resources */,
200 | );
201 | runOnlyForDeploymentPostprocessing = 0;
202 | };
203 | 22954E9E1D977629008E524D /* Resources */ = {
204 | isa = PBXResourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | );
208 | runOnlyForDeploymentPostprocessing = 0;
209 | };
210 | /* End PBXResourcesBuildPhase section */
211 |
212 | /* Begin PBXSourcesBuildPhase section */
213 | 22954E881D977629008E524D /* Sources */ = {
214 | isa = PBXSourcesBuildPhase;
215 | buildActionMask = 2147483647;
216 | files = (
217 | 22954EB11D977670008E524D /* PPNumberButton.swift in Sources */,
218 | 22954E921D977629008E524D /* ViewController.swift in Sources */,
219 | 22954E901D977629008E524D /* AppDelegate.swift in Sources */,
220 | );
221 | runOnlyForDeploymentPostprocessing = 0;
222 | };
223 | 22954E9C1D977629008E524D /* Sources */ = {
224 | isa = PBXSourcesBuildPhase;
225 | buildActionMask = 2147483647;
226 | files = (
227 | 22954EA51D977629008E524D /* PPNumberButtonSwiftTests.swift in Sources */,
228 | );
229 | runOnlyForDeploymentPostprocessing = 0;
230 | };
231 | /* End PBXSourcesBuildPhase section */
232 |
233 | /* Begin PBXTargetDependency section */
234 | 22954EA21D977629008E524D /* PBXTargetDependency */ = {
235 | isa = PBXTargetDependency;
236 | target = 22954E8B1D977629008E524D /* PPNumberButtonSwift */;
237 | targetProxy = 22954EA11D977629008E524D /* PBXContainerItemProxy */;
238 | };
239 | /* End PBXTargetDependency section */
240 |
241 | /* Begin PBXVariantGroup section */
242 | 22954E931D977629008E524D /* Main.storyboard */ = {
243 | isa = PBXVariantGroup;
244 | children = (
245 | 22954E941D977629008E524D /* Base */,
246 | );
247 | name = Main.storyboard;
248 | sourceTree = "";
249 | };
250 | 22954E981D977629008E524D /* LaunchScreen.storyboard */ = {
251 | isa = PBXVariantGroup;
252 | children = (
253 | 22954E991D977629008E524D /* Base */,
254 | );
255 | name = LaunchScreen.storyboard;
256 | sourceTree = "";
257 | };
258 | /* End PBXVariantGroup section */
259 |
260 | /* Begin XCBuildConfiguration section */
261 | 22954EA71D977629008E524D /* Debug */ = {
262 | isa = XCBuildConfiguration;
263 | buildSettings = {
264 | ALWAYS_SEARCH_USER_PATHS = NO;
265 | CLANG_ANALYZER_NONNULL = YES;
266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
267 | CLANG_CXX_LIBRARY = "libc++";
268 | CLANG_ENABLE_MODULES = YES;
269 | CLANG_ENABLE_OBJC_ARC = YES;
270 | CLANG_WARN_BOOL_CONVERSION = YES;
271 | CLANG_WARN_CONSTANT_CONVERSION = YES;
272 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
273 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
274 | CLANG_WARN_EMPTY_BODY = YES;
275 | CLANG_WARN_ENUM_CONVERSION = YES;
276 | CLANG_WARN_INFINITE_RECURSION = YES;
277 | CLANG_WARN_INT_CONVERSION = YES;
278 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
279 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
280 | CLANG_WARN_UNREACHABLE_CODE = YES;
281 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
282 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
283 | COPY_PHASE_STRIP = NO;
284 | DEBUG_INFORMATION_FORMAT = dwarf;
285 | ENABLE_STRICT_OBJC_MSGSEND = YES;
286 | ENABLE_TESTABILITY = YES;
287 | GCC_C_LANGUAGE_STANDARD = gnu99;
288 | GCC_DYNAMIC_NO_PIC = NO;
289 | GCC_NO_COMMON_BLOCKS = YES;
290 | GCC_OPTIMIZATION_LEVEL = 0;
291 | GCC_PREPROCESSOR_DEFINITIONS = (
292 | "DEBUG=1",
293 | "$(inherited)",
294 | );
295 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
296 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
297 | GCC_WARN_UNDECLARED_SELECTOR = YES;
298 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
299 | GCC_WARN_UNUSED_FUNCTION = YES;
300 | GCC_WARN_UNUSED_VARIABLE = YES;
301 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
302 | MTL_ENABLE_DEBUG_INFO = YES;
303 | ONLY_ACTIVE_ARCH = YES;
304 | SDKROOT = iphoneos;
305 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
306 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
307 | TARGETED_DEVICE_FAMILY = "1,2";
308 | };
309 | name = Debug;
310 | };
311 | 22954EA81D977629008E524D /* Release */ = {
312 | isa = XCBuildConfiguration;
313 | buildSettings = {
314 | ALWAYS_SEARCH_USER_PATHS = NO;
315 | CLANG_ANALYZER_NONNULL = YES;
316 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
317 | CLANG_CXX_LIBRARY = "libc++";
318 | CLANG_ENABLE_MODULES = YES;
319 | CLANG_ENABLE_OBJC_ARC = YES;
320 | CLANG_WARN_BOOL_CONVERSION = YES;
321 | CLANG_WARN_CONSTANT_CONVERSION = YES;
322 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
323 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
324 | CLANG_WARN_EMPTY_BODY = YES;
325 | CLANG_WARN_ENUM_CONVERSION = YES;
326 | CLANG_WARN_INFINITE_RECURSION = YES;
327 | CLANG_WARN_INT_CONVERSION = YES;
328 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
329 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
330 | CLANG_WARN_UNREACHABLE_CODE = YES;
331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
332 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
333 | COPY_PHASE_STRIP = NO;
334 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
335 | ENABLE_NS_ASSERTIONS = NO;
336 | ENABLE_STRICT_OBJC_MSGSEND = YES;
337 | GCC_C_LANGUAGE_STANDARD = gnu99;
338 | GCC_NO_COMMON_BLOCKS = YES;
339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
341 | GCC_WARN_UNDECLARED_SELECTOR = YES;
342 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
343 | GCC_WARN_UNUSED_FUNCTION = YES;
344 | GCC_WARN_UNUSED_VARIABLE = YES;
345 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
346 | MTL_ENABLE_DEBUG_INFO = NO;
347 | SDKROOT = iphoneos;
348 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
349 | TARGETED_DEVICE_FAMILY = "1,2";
350 | VALIDATE_PRODUCT = YES;
351 | };
352 | name = Release;
353 | };
354 | 22954EAA1D977629008E524D /* Debug */ = {
355 | isa = XCBuildConfiguration;
356 | buildSettings = {
357 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
358 | INFOPLIST_FILE = PPNumberButtonSwift/Info.plist;
359 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
361 | PRODUCT_BUNDLE_IDENTIFIER = com.jkpang.PPNumberButtonSwift;
362 | PRODUCT_NAME = "$(TARGET_NAME)";
363 | SDKROOT = iphoneos;
364 | SWIFT_VERSION = 3.0;
365 | };
366 | name = Debug;
367 | };
368 | 22954EAB1D977629008E524D /* Release */ = {
369 | isa = XCBuildConfiguration;
370 | buildSettings = {
371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
372 | INFOPLIST_FILE = PPNumberButtonSwift/Info.plist;
373 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
374 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
375 | PRODUCT_BUNDLE_IDENTIFIER = com.jkpang.PPNumberButtonSwift;
376 | PRODUCT_NAME = "$(TARGET_NAME)";
377 | SDKROOT = iphoneos;
378 | SWIFT_VERSION = 3.0;
379 | };
380 | name = Release;
381 | };
382 | 22954EAD1D977629008E524D /* Debug */ = {
383 | isa = XCBuildConfiguration;
384 | buildSettings = {
385 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
386 | BUNDLE_LOADER = "$(TEST_HOST)";
387 | INFOPLIST_FILE = PPNumberButtonSwiftTests/Info.plist;
388 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
389 | PRODUCT_BUNDLE_IDENTIFIER = com.jkpang.PPNumberButtonSwiftTests;
390 | PRODUCT_NAME = "$(TARGET_NAME)";
391 | SWIFT_VERSION = 3.0;
392 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PPNumberButtonSwift.app/PPNumberButtonSwift";
393 | };
394 | name = Debug;
395 | };
396 | 22954EAE1D977629008E524D /* Release */ = {
397 | isa = XCBuildConfiguration;
398 | buildSettings = {
399 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
400 | BUNDLE_LOADER = "$(TEST_HOST)";
401 | INFOPLIST_FILE = PPNumberButtonSwiftTests/Info.plist;
402 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
403 | PRODUCT_BUNDLE_IDENTIFIER = com.jkpang.PPNumberButtonSwiftTests;
404 | PRODUCT_NAME = "$(TARGET_NAME)";
405 | SWIFT_VERSION = 3.0;
406 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PPNumberButtonSwift.app/PPNumberButtonSwift";
407 | };
408 | name = Release;
409 | };
410 | /* End XCBuildConfiguration section */
411 |
412 | /* Begin XCConfigurationList section */
413 | 22954E871D977629008E524D /* Build configuration list for PBXProject "PPNumberButtonSwift" */ = {
414 | isa = XCConfigurationList;
415 | buildConfigurations = (
416 | 22954EA71D977629008E524D /* Debug */,
417 | 22954EA81D977629008E524D /* Release */,
418 | );
419 | defaultConfigurationIsVisible = 0;
420 | defaultConfigurationName = Release;
421 | };
422 | 22954EA91D977629008E524D /* Build configuration list for PBXNativeTarget "PPNumberButtonSwift" */ = {
423 | isa = XCConfigurationList;
424 | buildConfigurations = (
425 | 22954EAA1D977629008E524D /* Debug */,
426 | 22954EAB1D977629008E524D /* Release */,
427 | );
428 | defaultConfigurationIsVisible = 0;
429 | defaultConfigurationName = Release;
430 | };
431 | 22954EAC1D977629008E524D /* Build configuration list for PBXNativeTarget "PPNumberButtonSwiftTests" */ = {
432 | isa = XCConfigurationList;
433 | buildConfigurations = (
434 | 22954EAD1D977629008E524D /* Debug */,
435 | 22954EAE1D977629008E524D /* Release */,
436 | );
437 | defaultConfigurationIsVisible = 0;
438 | defaultConfigurationName = Release;
439 | };
440 | /* End XCConfigurationList section */
441 | };
442 | rootObject = 22954E841D977629008E524D /* Project object */;
443 | }
444 |
--------------------------------------------------------------------------------