, with event: UIEvent?) {
41 | super.touchesEnded(touches, with: event)
42 | viewModel.touchPoint = nil
43 | }
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xccheckout
23 | *.xcscmblueprint
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 | *.dSYM.zip
29 | *.dSYM
30 |
31 | ## Playgrounds
32 | timeline.xctimeline
33 | playground.xcworkspace
34 |
35 | # Swift Package Manager
36 | #
37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
38 | # Packages/
39 | # Package.pins
40 | # Package.resolved
41 | .build/
42 |
43 | # CocoaPods
44 | #
45 | # We recommend against adding the Pods directory to your .gitignore. However
46 | # you should judge for yourself, the pros and cons are mentioned at:
47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
48 | #
49 | Pods/
50 |
51 | # Carthage
52 | #
53 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
54 | # Carthage/Checkouts
55 |
56 | Carthage/Build
57 |
58 | # fastlane
59 | #
60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
61 | # screenshots whenever they are needed.
62 | # For more information about the recommended setup visit:
63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
64 |
65 | fastlane/report.xml
66 | fastlane/Preview.html
67 | fastlane/screenshots/**/*.png
68 | fastlane/test_output
69 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample/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 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample/en.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 |
--------------------------------------------------------------------------------
/Puffer/CGAngle.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CGAngle.swift
3 | // Puffer
4 | //
5 | // Created by Echo on 5/22/19.
6 | // Copyright © 2019 Echo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// Use this class to make angle calculation to be simpler
12 | public class CGAngle: NSObject, Comparable {
13 | public static func < (lhs: CGAngle, rhs: CGAngle) -> Bool {
14 | return lhs.radians < rhs.radians
15 | }
16 |
17 | public var radians: CGFloat = 0.0
18 |
19 | @inlinable public var degrees: CGFloat {
20 | get {
21 | return radians / CGFloat.pi * 180.0
22 | }
23 | set {
24 | radians = newValue / 180.0 * CGFloat.pi
25 | }
26 | }
27 |
28 | @inlinable public init(radians: CGFloat) {
29 | self.radians = radians
30 | }
31 |
32 | @inlinable public init(degrees: CGFloat) {
33 | radians = degrees / 180.0 * CGFloat.pi
34 | }
35 |
36 | override public var description: String {
37 | return String(format: "%0.2f°", degrees)
38 | }
39 |
40 | static public func +(lhs: CGAngle, rhs: CGAngle) -> CGAngle {
41 | return CGAngle(radians: lhs.radians + rhs.radians)
42 | }
43 |
44 | static public func *(lhs: CGAngle, rhs: CGAngle) -> CGAngle {
45 | return CGAngle(radians: lhs.radians * rhs.radians)
46 | }
47 |
48 | static public func -(lhs: CGAngle, rhs: CGAngle) -> CGAngle {
49 | return CGAngle(radians: lhs.radians - rhs.radians)
50 | }
51 |
52 | static public prefix func -(rhs: CGAngle) -> CGAngle {
53 | return CGAngle(radians: -rhs.radians)
54 | }
55 |
56 | static public func /(lhs: CGAngle, rhs: CGAngle) -> CGAngle {
57 | guard rhs.radians != 0 else {
58 | if lhs.radians == 0 { return CGAngle(radians: 0)}
59 | if lhs.radians > 0 { return CGAngle(radians: CGFloat.infinity)}
60 | return CGAngle(radians: -CGFloat.infinity)
61 | }
62 | return CGAngle(radians: lhs.radians / rhs.radians)
63 | }
64 |
65 | }
66 |
67 |
68 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // PufferExample
4 | //
5 | // Created by Echo on 11/12/18.
6 | // Copyright © 2018 Echo. 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 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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | # Puffer
12 | A swift rotation dial.
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | You can use this tool to mimic a rotation dial just like what Photo.app does
21 |
22 |
24 |
25 | ## Features
26 |
27 | * Show the whole dial with indicator
28 | * Show only part of the dial.
29 | * Rotation range can be limited.
30 | * Default rotation center if the center of the dial. You can set your own rotation center.
31 | * Customized colors.
32 |
33 | ## Requirements
34 | * iOS 11.0+
35 | * Xcode 10.0+
36 |
37 | ## Install
38 |
39 | ### CocoaPods
40 |
41 | ```ruby
42 | pod 'Puffer', '~> 1.0.3'
43 | ```
44 | You may also need the code below in your pod file if compile errors happen because of different swift version.
45 |
46 | ```ruby
47 | post_install do |installer|
48 | installer.pods_project.targets.each do |target|
49 | if ['Mantis'].include? target.name
50 | target.build_configurations.each do |config|
51 | config.build_settings['SWIFT_VERSION'] = '5.0'
52 | end
53 | end
54 | end
55 | end
56 | ```
57 | ## Usage
58 |
59 | * Create a default Rotation Dial
60 | ```swift
61 | Puffer.createDial()
62 | ```
63 |
64 | * Create a customized Rotation Dial
65 | ```swift
66 | var config = Puffer.Config()
67 |
68 | // Do some settings to config
69 | ...
70 |
71 | Puffer.createDial(config: config)
72 | ```
73 |
74 |
75 |
--------------------------------------------------------------------------------
/Puffer/Puffer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Puffer.swift
3 | // Puffer
4 | //
5 | // Created by Echo on 11/12/18.
6 | // Copyright © 2018 Echo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public func createDial(config: Config = Config()) -> RotationDial {
12 | return RotationDial(frame: CGRect.zero, config: config)
13 | }
14 |
15 | public struct Config {
16 | public init() {}
17 |
18 | public var margin: Double = 10
19 | public var interactable = false
20 | public var rotationLimitType: RotationLimitType = .noLimit
21 | public var angleShowLimitType: AnglehowLimitType = .noLimit
22 | public var rotationCenterType: RotationCenterType = .useDefault
23 | public var numberShowSpan = 2
24 | public var orientation: Orientation = .normal
25 |
26 | public var backgroundColor: UIColor = .black
27 | public var bigScaleColor: UIColor = .lightGray
28 | public var smallScaleColor: UIColor = .lightGray
29 | public var indicatorColor: UIColor = .lightGray
30 | public var numberColor: UIColor = .lightGray
31 | public var centerAxisColor: UIColor = .lightGray
32 |
33 | public var theme: Theme = .dark {
34 | didSet {
35 | switch theme {
36 | case .dark:
37 | backgroundColor = .black
38 | bigScaleColor = .lightGray
39 | smallScaleColor = .lightGray
40 | indicatorColor = .lightGray
41 | numberColor = .lightGray
42 | centerAxisColor = .lightGray
43 | case .light:
44 | backgroundColor = .white
45 | bigScaleColor = .darkGray
46 | smallScaleColor = .darkGray
47 | indicatorColor = .darkGray
48 | numberColor = .darkGray
49 | centerAxisColor = .darkGray
50 | }
51 | }
52 | }
53 | }
54 |
55 | public extension Config {
56 | enum RotationCenterType {
57 | case useDefault
58 | case custom(CGPoint)
59 | }
60 |
61 | enum RotationLimitType {
62 | case noLimit
63 | case limit(angle: CGAngle)
64 | }
65 |
66 | enum AnglehowLimitType {
67 | case noLimit
68 | case limit(angle: CGAngle)
69 | }
70 |
71 | enum Orientation {
72 | case normal
73 | case right
74 | case left
75 | case upsideDown
76 | }
77 |
78 | enum Theme {
79 | case dark
80 | case light
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Puffer/RotationCalculator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RotationCalculator.swift
3 | // RotationCalculator
4 | //
5 | // Created by Michael Teeuw on 20-06-14.
6 | // https://github.com/MichMich/XMCircleGestureRecognizer
7 | // Modified by Yingtao Guo on 10/21/18 (Adapted to the newest swift)
8 | // Copyright (c) 2014 Michael Teeuw. All rights reserved.
9 | //
10 | import UIKit
11 |
12 | class RotationCalculator {
13 |
14 | // midpoint for gesture recognizer
15 | var midPoint = CGPoint.zero
16 |
17 | // relative rotation for current gesture (in radians)
18 | var rotation: CGFloat? {
19 | guard let currentPoint = self.currentPoint,
20 | let previousPoint = self.previousPoint else {
21 | return nil
22 | }
23 |
24 | var rotation = angleBetween(pointA: currentPoint, andPointB: previousPoint)
25 |
26 | if (rotation > CGFloat.pi) {
27 | rotation -= CGFloat.pi * 2
28 | } else if (rotation < -CGFloat.pi) {
29 | rotation += CGFloat.pi * 2
30 | }
31 |
32 | return rotation
33 | }
34 |
35 | // absolute angle for current gesture (in radians)
36 | var angle: CGFloat? {
37 | if let nowPoint = self.currentPoint {
38 | return self.angleForPoint(point: nowPoint)
39 | }
40 |
41 | return nil
42 | }
43 |
44 | // distance from midpoint
45 | var distance: CGFloat? {
46 | if let nowPoint = self.currentPoint {
47 | return self.distanceBetween(pointA: self.midPoint, andPointB: nowPoint)
48 | }
49 |
50 | return nil
51 | }
52 |
53 | private var currentPoint: CGPoint?
54 | private var previousPoint: CGPoint?
55 |
56 | init(midPoint: CGPoint) {
57 | self.midPoint = midPoint
58 | }
59 |
60 | private func distanceBetween(pointA: CGPoint, andPointB pointB: CGPoint) -> CGFloat {
61 | let dx = Float(pointA.x - pointB.x)
62 | let dy = Float(pointA.y - pointB.y)
63 | return CGFloat(sqrtf(dx*dx + dy*dy))
64 | }
65 |
66 | private func angleForPoint(point: CGPoint) -> CGFloat {
67 | var angle = CGFloat(-atan2f(Float(point.x - midPoint.x), Float(point.y - midPoint.y))) + CGFloat.pi / 2
68 |
69 | if (angle < 0) {
70 | angle += CGFloat.pi * 2
71 | }
72 |
73 | return angle
74 | }
75 |
76 | private func angleBetween(pointA: CGPoint, andPointB pointB: CGPoint) -> CGFloat {
77 | return angleForPoint(point: pointA) - angleForPoint(point: pointB)
78 | }
79 |
80 | func getRotationRadians(byOldPoint p1: CGPoint, andNewPoint p2: CGPoint) -> CGFloat {
81 | self.previousPoint = p1
82 | self.currentPoint = p2
83 | return rotation ?? 0
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "ItunesArtwork@2x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
--------------------------------------------------------------------------------
/PufferExample/PufferExample/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // PufferExample
4 | //
5 | // Created by Echo on 11/12/18.
6 | // Copyright © 2018 Echo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Puffer
11 |
12 | class ViewController: UIViewController {
13 |
14 | @IBOutlet weak var dial: RotationDial!
15 | @IBOutlet weak var roateAngleValue: UILabel!
16 | @IBOutlet weak var customRotationView: UIView!
17 |
18 | var orientation: Config.Orientation = .normal
19 |
20 | override func viewDidLoad() {
21 | super.viewDidLoad()
22 |
23 | customRotationView.isHidden = true
24 | dial.setup()
25 |
26 | dial.didRotate = {[weak self] angle in
27 | guard let self = self else { return }
28 |
29 | self.roateAngleValue.text = String(format:"%0.02f°", angle.degrees)
30 |
31 | if self.customRotationView.isHidden == false {
32 | self.customRotationView.transform = CGAffineTransform(rotationAngle: self.dial.getRotationAngle().radians)
33 | }
34 | }
35 | }
36 |
37 | private func resetStatus() {
38 | customRotationView.isHidden = true
39 | roateAngleValue.text = "0°"
40 | }
41 |
42 | @IBAction func color(_ sender: Any) {
43 | resetStatus()
44 |
45 | var config = Config()
46 | config.numberShowSpan = 2
47 | config.centerAxisColor = .yellow
48 | config.bigScaleColor = .blue
49 | config.smallScaleColor = .red
50 | config.indicatorColor = .brown
51 | config.numberColor = .purple
52 | config.backgroundColor = .lightGray
53 |
54 | dial.setup(with: config)
55 | }
56 |
57 | @IBAction func reset(_ sender: Any) {
58 | resetStatus()
59 | dial.setup()
60 | }
61 |
62 | @IBAction func rotateLimit(_ sender: Any) {
63 | resetStatus()
64 |
65 | var config = Config()
66 | config.rotationLimitType = .limit(angle: CGAngle(degrees: 45))
67 |
68 | dial.setup(with: config)
69 | }
70 |
71 | @IBAction func showLimit(_ sender: Any) {
72 | resetStatus()
73 |
74 | var config = Config()
75 | config.angleShowLimitType = .limit(angle: CGAngle(degrees: 60))
76 |
77 | dial.setup(with: config)
78 | }
79 |
80 | @IBAction func changeOrientation(_ sender: Any) {
81 | resetStatus()
82 |
83 | var config = Config()
84 | config.angleShowLimitType = .limit(angle: CGAngle(degrees: 60))
85 |
86 | if orientation == .normal {
87 | config.orientation = .left
88 | } else if orientation == .left {
89 | config.orientation = .upsideDown
90 | } else if orientation == .upsideDown {
91 | config.orientation = .right
92 | } else if orientation == .right {
93 | config.orientation = .normal
94 | }
95 |
96 | orientation = config.orientation
97 | dial.setup(with: config)
98 | }
99 |
100 |
101 | @IBAction func testCenter(_ sender: Any) {
102 | resetStatus()
103 | customRotationView.transform = .identity
104 | customRotationView.isHidden = false
105 |
106 | dial.setRotationCenter(by: customRotationView.center, of: self.view)
107 |
108 | dial.setup()
109 | }
110 | }
111 |
112 |
--------------------------------------------------------------------------------
/Puffer.xcodeproj/xcshareddata/xcschemes/Puffer.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 |
65 |
71 |
72 |
73 |
74 |
75 |
76 |
82 |
83 |
89 |
90 |
91 |
92 |
94 |
95 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample.xcodeproj/xcshareddata/xcschemes/PufferExample.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 |
--------------------------------------------------------------------------------
/Puffer/CoreGraphicsExtensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CoreGraphicsExtensions.swift
3 | // SwiftClock
4 | //
5 | // Created by Joseph Daniels on 01/09/16.
6 | // Copyright © 2016 Joseph Daniels. All rights reserved.
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
10 | // deal in the Software without restriction, including without limitation the
11 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 | // sell 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
19 | // OR 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 LIABILITY,
22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
23 | // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | import Foundation
26 | import UIKit
27 |
28 | extension FloatingPoint{
29 | var isBad:Bool{ return isNaN || isInfinite }
30 | var checked:Self{
31 | guard !isBad && !isInfinite else {
32 | fatalError("bad number!")
33 | }
34 | return self
35 | }
36 |
37 | }
38 |
39 | typealias Angle = CGFloat
40 | func df() -> CGFloat {
41 | return CGFloat(drand48()).checked
42 | }
43 |
44 | func clockDescretization(_ val: CGFloat) -> CGFloat{
45 | let min:Double = 0
46 | let max:Double = 2 * Double.pi
47 | let steps:Double = 144
48 | let stepSize = (max - min) / steps
49 | let nsf = floor(Double(val) / stepSize)
50 | let rest = Double(val) - stepSize * nsf
51 | return CGFloat(rest > stepSize / 2 ? stepSize * (nsf + 1) : stepSize * nsf).checked
52 |
53 | }
54 |
55 | extension CALayer {
56 | func doDebug(){
57 | self.borderColor = UIColor(hue: df() , saturation: df(), brightness: 1, alpha: 1).cgColor
58 | self.borderWidth = 2;
59 | self.sublayers?.forEach({$0.doDebug()})
60 | }
61 | }
62 |
63 | extension CGSize{
64 | var hasNaN:Bool{return width.isBad || height.isBad }
65 | var checked:CGSize{
66 | guard !hasNaN else {
67 | fatalError("bad number!")
68 | }
69 | return self
70 | }
71 | }
72 |
73 | extension CGRect{
74 | var center:CGPoint { return CGPoint(x:midX, y: midY).checked}
75 | var hasNaN:Bool{return size.hasNaN || origin.hasNaN}
76 | var checked:CGRect{
77 | guard !hasNaN else {
78 | fatalError("bad number!")
79 | }
80 | return self
81 | }
82 | }
83 |
84 | extension CGPoint{
85 | var vector:CGVector { return CGVector(dx: x, dy: y).checked}
86 | var checked:CGPoint{
87 | guard !hasNaN else {
88 | fatalError("bad number!")
89 | }
90 | return self
91 | }
92 | var hasNaN:Bool{return x.isBad || y.isBad }
93 | }
94 |
95 | extension CGVector{
96 | var hasNaN:Bool{return dx.isBad || dy.isBad}
97 | var checked:CGVector{
98 | guard !hasNaN else {
99 | fatalError("bad number!")
100 | }
101 | return self
102 | }
103 |
104 | static var root:CGVector{ return CGVector(dx:1, dy:0).checked}
105 | var magnitude:CGFloat { return sqrt(pow(dx, 2) + pow(dy,2)).checked}
106 | var normalized: CGVector { return CGVector(dx:dx / magnitude, dy: dy / magnitude).checked }
107 | var point:CGPoint { return CGPoint(x: dx, y: dy).checked}
108 | func rotate(_ angle:Angle) -> CGVector { return CGVector(dx: dx * cos(angle) - dy * sin(angle), dy: dx * sin(angle) + dy * cos(angle) ).checked}
109 |
110 | func dot(_ vec2:CGVector) -> CGFloat { return (dx * vec2.dx + dy * vec2.dy).checked}
111 | func add(_ vec2:CGVector) -> CGVector { return CGVector(dx:dx + vec2.dx , dy: dy + vec2.dy).checked}
112 | func cross(_ vec2:CGVector) -> CGFloat { return (dx * vec2.dy - dy * vec2.dx).checked}
113 | func scale(_ c:CGFloat) -> CGVector { return CGVector(dx:dx * c , dy: dy * c).checked}
114 |
115 | init( from:CGPoint, to:CGPoint){
116 | guard !from.hasNaN && !to.hasNaN else {
117 | fatalError("Nan point!")
118 | }
119 | self.init()
120 | dx = to.x - from.x
121 | dy = to.y - from.y
122 | _ = self.checked
123 | }
124 |
125 | init(angle:Angle){
126 | let compAngle = angle < 0 ? (angle + 2 * CGFloat.pi) : angle
127 | self.init()
128 | dx = cos(compAngle.checked)
129 | dy = sin(compAngle.checked)
130 | _ = self.checked
131 | }
132 |
133 | var theta:Angle{
134 | return atan2(dy, dx)}
135 |
136 | static func theta(_ vec1:CGVector, vec2:CGVector) -> Angle{
137 | var i = vec1.normalized.dot(vec2.normalized)
138 | if (i > 1) {
139 | i = 1;
140 | }
141 | if (i < -1){
142 | i = -1;
143 | }
144 | return acos(i).checked
145 | }
146 |
147 | static func signedTheta(_ vec1:CGVector, vec2:CGVector) -> Angle{
148 |
149 | return (vec1.normalized.cross(vec2.normalized) > 0 ? -1 : 1) * theta(vec1.normalized, vec2: vec2.normalized).checked
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/Puffer/RotationDialPlate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RotationDailPlate.swift
3 | // Puffer
4 | //
5 | // Created by Echo on 10/24/18.
6 | // Copyright © 2018 Echo. All rights reserved.
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
10 | // deal in the Software without restriction, including without limitation the
11 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 | // sell 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
19 | // OR 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 LIABILITY,
22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
23 | // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | import UIKit
26 |
27 | fileprivate let bigDegreeScaleNumber = 36
28 | fileprivate let smallDegreeScaleNumber = bigDegreeScaleNumber * 5
29 | fileprivate let margin: CGFloat = 0
30 | fileprivate let spaceBetweenScaleAndNumber: CGFloat = 10
31 |
32 | class RotationDialPlate: UIView {
33 |
34 | let smallDotLayer:CAReplicatorLayer = {
35 | var r = CAReplicatorLayer()
36 | r.instanceCount = smallDegreeScaleNumber
37 | r.instanceTransform =
38 | CATransform3DMakeRotation(
39 | 2 * CGFloat.pi / CGFloat(r.instanceCount),
40 | 0,0,1)
41 |
42 | return r
43 | }()
44 |
45 | let bigDotLayer:CAReplicatorLayer = {
46 | var r = CAReplicatorLayer()
47 | r.instanceCount = bigDegreeScaleNumber
48 | r.instanceTransform =
49 | CATransform3DMakeRotation(
50 | 2 * CGFloat.pi / CGFloat(r.instanceCount),
51 | 0,0,1)
52 |
53 | return r
54 | }()
55 |
56 | var config = Config()
57 |
58 | init(frame: CGRect, config: Config = Config()) {
59 | super.init(frame: frame)
60 | self.config = config
61 | setup()
62 | }
63 |
64 | required init?(coder aDecoder: NSCoder) {
65 | super.init(coder: aDecoder)
66 | }
67 |
68 | private func getSmallScaleMark() -> CALayer {
69 | let mark = CAShapeLayer()
70 | mark.frame = CGRect(x: 0, y: 0, width: 2, height: 2)
71 | mark.path = UIBezierPath(ovalIn: mark.bounds).cgPath
72 | mark.fillColor = config.smallScaleColor.cgColor
73 |
74 | return mark
75 | }
76 |
77 | private func getBigScaleMark() -> CALayer {
78 | let mark = CAShapeLayer()
79 | mark.frame = CGRect(x: 0, y: 0, width: 4, height: 4)
80 | mark.path = UIBezierPath(ovalIn: mark.bounds).cgPath
81 | mark.fillColor = config.bigScaleColor.cgColor
82 |
83 | return mark
84 | }
85 |
86 | private func setupAngleNumber() {
87 | let numberFont = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.caption2)
88 |
89 | let cgFont = CTFontCreateWithName(numberFont.fontName as CFString, numberFont.pointSize/2, nil)
90 |
91 | let numberPlateLayer = CALayer()
92 | numberPlateLayer.sublayers?.forEach { $0.removeFromSuperlayer() }
93 |
94 | numberPlateLayer.frame = self.bounds
95 | self.layer.addSublayer(numberPlateLayer)
96 |
97 | let origin = CGPoint(x: numberPlateLayer.frame.midX, y: numberPlateLayer.frame.midY)
98 | let startPos = CGPoint(x: numberPlateLayer.bounds.midX, y: numberPlateLayer.bounds.maxY - margin - spaceBetweenScaleAndNumber)
99 | let step = (2 * CGFloat.pi) / CGFloat(bigDegreeScaleNumber)
100 | for i in (0 ..< bigDegreeScaleNumber){
101 |
102 | guard i % config.numberShowSpan == 0 else {
103 | continue
104 | }
105 |
106 | let numberLayer = CATextLayer()
107 | numberLayer.bounds.size = CGSize(width: 30, height: 15)
108 | numberLayer.fontSize = numberFont.pointSize
109 | numberLayer.alignmentMode = CATextLayerAlignmentMode.center
110 | numberLayer.contentsScale = UIScreen.main.scale
111 | numberLayer.font = cgFont
112 | let angle = (i > bigDegreeScaleNumber / 2 ? i - bigDegreeScaleNumber : i) * 10
113 | numberLayer.string = "\(angle)"
114 | numberLayer.foregroundColor = config.numberColor.cgColor
115 |
116 | let stepChange = CGFloat(i) * step
117 | numberLayer.position = CGVector(from:origin, to:startPos).rotate(-stepChange).add(origin.vector).point.checked
118 |
119 | numberLayer.transform = CATransform3DMakeRotation(-stepChange, 0, 0, 1)
120 | numberPlateLayer.addSublayer(numberLayer)
121 | }
122 | }
123 |
124 | private func setupSmallScaleMarks() {
125 | smallDotLayer.frame = self.bounds
126 | smallDotLayer.sublayers?.forEach { $0.removeFromSuperlayer() }
127 |
128 | let smallScaleMark = getSmallScaleMark()
129 | smallScaleMark.position = CGPoint(x: smallDotLayer.bounds.midX, y: margin)
130 | smallDotLayer.addSublayer(smallScaleMark)
131 |
132 | self.layer.addSublayer(smallDotLayer)
133 | }
134 |
135 | private func setupBigScaleMarks() {
136 | bigDotLayer.frame = self.bounds
137 | bigDotLayer.sublayers?.forEach { $0.removeFromSuperlayer() }
138 |
139 | let bigScaleMark = getBigScaleMark()
140 | bigScaleMark.position = CGPoint(x: bigDotLayer.bounds.midX, y: margin)
141 | bigDotLayer.addSublayer(bigScaleMark)
142 | self.layer.addSublayer(bigDotLayer)
143 | }
144 |
145 | private func setCenterPart() {
146 | let layer = CAShapeLayer()
147 | let r: CGFloat = 4
148 | layer.frame = CGRect(x: (self.layer.bounds.width - r) / 2 , y: (self.layer.bounds.height - r) / 2, width: r, height: r)
149 | layer.path = UIBezierPath(ovalIn: layer.bounds).cgPath
150 | layer.fillColor = config.centerAxisColor.cgColor
151 |
152 | self.layer.addSublayer(layer)
153 | }
154 |
155 | private func setup() {
156 | setupSmallScaleMarks()
157 | setupBigScaleMarks()
158 | setupAngleNumber()
159 | setCenterPart()
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/Puffer/RotationDial.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AngleDashboard.swift
3 | // Puffer
4 | //
5 | // Created by Echo on 10/21/18.
6 | // Copyright © 2018 Echo. All rights reserved.
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
10 | // deal in the Software without restriction, including without limitation the
11 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 | // sell 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
19 | // OR 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 LIABILITY,
22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
23 | // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | import UIKit
26 |
27 | @IBDesignable
28 | public class RotationDial: UIView {
29 | @IBInspectable public var pointerHeight: CGFloat = 8
30 | @IBInspectable public var spanBetweenDialPlateAndPointer: CGFloat = 6
31 | @IBInspectable public var pointerWidth: CGFloat = 8 * sqrt(2)
32 |
33 | public var didRotate: (_ angle: CGAngle) -> Void = { _ in }
34 | public var config = Config()
35 |
36 | private var angleLimit = CGAngle(radians: CGFloat.pi)
37 | private var showRadiansLimit: CGFloat = CGFloat.pi
38 | private var dialPlate: RotationDialPlate?
39 | private var dialPlateHolder: UIView?
40 | private var pointer: CAShapeLayer = CAShapeLayer()
41 | private var rotationKVO: NSKeyValueObservation?
42 |
43 | var viewModel = RotationDialViewModel()
44 |
45 | /**
46 | This one is needed to solve storyboard render problem
47 | https://stackoverflow.com/a/42678873/288724
48 | */
49 | public override init(frame: CGRect) {
50 | super.init(frame: frame)
51 | setup()
52 | }
53 |
54 | public init(frame: CGRect, config: Config) {
55 | super.init(frame: frame)
56 | setup(with: config)
57 | }
58 |
59 | required init?(coder aDecoder: NSCoder) {
60 | super.init(coder: aDecoder)
61 | }
62 | }
63 |
64 | // MARK: - private funtions
65 | extension RotationDial {
66 | private func setupUI() {
67 | clipsToBounds = true
68 | backgroundColor = config.backgroundColor
69 |
70 | dialPlateHolder?.removeFromSuperview()
71 | dialPlateHolder = getDialPlateHolder(by: config.orientation)
72 | addSubview(dialPlateHolder!)
73 | createDialPlate(in: dialPlateHolder!)
74 | setupPointer(in: dialPlateHolder!)
75 | setDialPlateHolder(by: config.orientation)
76 | }
77 |
78 | private func setupViewModel() {
79 | rotationKVO = viewModel.observe(\.rotationAngle,
80 | options: [.old, .new]
81 | ) { [weak self] _, changed in
82 | guard let angle = changed.newValue else { return }
83 | self?.handleRotation(by: angle)
84 | }
85 |
86 | let rotationCenter = getRotationCenter()
87 | viewModel.makeRotationCalculator(by: rotationCenter)
88 | }
89 |
90 | private func handleRotation(by angle: CGAngle) {
91 | if case .limit = config.rotationLimitType {
92 | if getRotationAngle().degrees + angle.degrees > angleLimit.degrees {
93 | rotateDialPlate(to: angleLimit)
94 | didRotate(angleLimit)
95 | return
96 | }
97 |
98 | if getRotationAngle().degrees + angle.degrees < -angleLimit.degrees {
99 | rotateDialPlate(to: -angleLimit)
100 | didRotate(-angleLimit)
101 | return
102 | }
103 |
104 | }
105 |
106 | if rotateDialPlate(by: angle) {
107 | didRotate(getRotationAngle())
108 | }
109 | }
110 |
111 | private func getDialPlateHolder(by orientation: Config.Orientation) -> UIView {
112 | let view = UIView(frame: bounds)
113 |
114 | switch orientation {
115 | case .normal, .upsideDown:
116 | ()
117 | case .left, .right:
118 | view.frame.size = CGSize(width: view.bounds.height, height: view.bounds.width)
119 | }
120 |
121 | return view
122 | }
123 |
124 | private func setDialPlateHolder(by orientation: Config.Orientation) {
125 | switch orientation {
126 | case .normal:
127 | ()
128 | case .left:
129 | dialPlateHolder?.transform = CGAffineTransform(rotationAngle: -CGFloat.pi / 2)
130 | dialPlateHolder?.frame.origin = CGPoint(x: 0, y: 0)
131 | case .right:
132 | dialPlateHolder?.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2)
133 | dialPlateHolder?.frame.origin = CGPoint(x: 0, y: 0)
134 | case .upsideDown:
135 | dialPlateHolder?.transform = CGAffineTransform(rotationAngle: CGFloat.pi)
136 | dialPlateHolder?.frame.origin = CGPoint(x: 0, y: 0)
137 | }
138 | }
139 |
140 | private func createDialPlate(in container: UIView) {
141 | var margin: CGFloat = CGFloat(config.margin)
142 | if case .limit(let angle) = config.angleShowLimitType {
143 | margin = 0
144 | showRadiansLimit = angle.radians
145 | } else {
146 | showRadiansLimit = CGFloat.pi
147 | }
148 |
149 | var dialPlateShowHeight = container.frame.height - margin - pointerHeight - spanBetweenDialPlateAndPointer
150 | var r = dialPlateShowHeight / (1 - cos(showRadiansLimit))
151 |
152 | if r * 2 * sin(showRadiansLimit) > container.frame.width {
153 | r = (container.frame.width / 2) / sin(showRadiansLimit)
154 | dialPlateShowHeight = r - r * cos(showRadiansLimit)
155 | }
156 |
157 | let dialPlateLength = 2 * r
158 | let dialPlateFrame = CGRect(x: (container.frame.width - dialPlateLength) / 2, y: margin - (dialPlateLength - dialPlateShowHeight), width: dialPlateLength, height: dialPlateLength)
159 |
160 | dialPlate?.removeFromSuperview()
161 | dialPlate = RotationDialPlate(frame: dialPlateFrame, config: config)
162 | container.addSubview(dialPlate!)
163 | }
164 |
165 | private func setupPointer(in container: UIView){
166 | guard let dialPlate = dialPlate else { return }
167 |
168 | let path = CGMutablePath()
169 | let pointerEdgeLength: CGFloat = pointerWidth
170 |
171 | let pointTop = CGPoint(x: container.bounds.width/2, y: dialPlate.frame.maxY + spanBetweenDialPlateAndPointer)
172 | let pointLeft = CGPoint(x: container.bounds.width/2 - pointerEdgeLength / 2, y: pointTop.y + pointerHeight)
173 | let pointRight = CGPoint(x: container.bounds.width/2 + pointerEdgeLength / 2, y: pointLeft.y)
174 |
175 | path.move(to: pointTop)
176 | path.addLine(to: pointLeft)
177 | path.addLine(to: pointRight)
178 | path.addLine(to: pointTop)
179 | pointer.fillColor = config.indicatorColor.cgColor
180 | pointer.path = path
181 | container.layer.addSublayer(pointer)
182 | }
183 |
184 | private func getRotationCenter() -> CGPoint {
185 | guard let dialPlate = dialPlate else { return .zero }
186 |
187 | if case .custom(let center) = config.rotationCenterType {
188 | return center
189 | } else {
190 | let p = CGPoint(x: dialPlate.bounds.midX , y: dialPlate.bounds.midY)
191 | return dialPlate.convert(p, to: self)
192 | }
193 | }
194 | }
195 |
196 | // MARK: - public API
197 | extension RotationDial {
198 | /// Setup the dial with your own config
199 | ///
200 | /// - Parameter config: dail config. If not provided, default config will be used
201 | public func setup(with config: Config = Config()) {
202 | self.config = config
203 |
204 | if case .limit(let angle) = config.rotationLimitType {
205 | angleLimit = angle
206 | }
207 |
208 | setupUI()
209 | setupViewModel()
210 | }
211 |
212 | @discardableResult
213 | func rotateDialPlate(by angle: CGAngle) -> Bool {
214 | guard let dialPlate = dialPlate else { return false }
215 |
216 | let radians = angle.radians
217 | if case .limit = config.rotationLimitType {
218 | if (getRotationAngle() * angle).radians > 0 && abs(getRotationAngle().radians + radians) >= angleLimit.radians {
219 |
220 | if radians > 0 {
221 | rotateDialPlate(to: angleLimit)
222 | } else {
223 | rotateDialPlate(to: -angleLimit)
224 | }
225 |
226 | return false
227 | }
228 | }
229 |
230 | dialPlate.transform = dialPlate.transform.rotated(by: radians)
231 | return true
232 | }
233 |
234 | public func rotateDialPlate(to angle: CGAngle, animated: Bool = false) {
235 | let radians = angle.radians
236 |
237 | if case .limit = config.rotationLimitType {
238 | guard abs(radians) <= angleLimit.radians else {
239 | return
240 | }
241 | }
242 |
243 | func rotate() {
244 | dialPlate?.transform = CGAffineTransform(rotationAngle: radians)
245 | }
246 |
247 | if animated {
248 | UIView.animate(withDuration: 0.5) {
249 | rotate()
250 | }
251 | } else {
252 | rotate()
253 | }
254 | }
255 |
256 | public func resetAngle(animated: Bool) {
257 | rotateDialPlate(to: CGAngle(radians: 0), animated: animated)
258 | }
259 |
260 | public func getRotationAngle() -> CGAngle {
261 | guard let dialPlate = dialPlate else { return CGAngle(degrees: 0) }
262 |
263 | let radians = CGFloat(atan2f(Float(dialPlate.transform.b), Float(dialPlate.transform.a)))
264 | return CGAngle(radians: radians)
265 | }
266 |
267 | public func setRotationCenter(by point: CGPoint, of view: UIView) {
268 | let p = view.convert(point, to: self)
269 | config.rotationCenterType = .custom(p)
270 | }
271 | }
272 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample/en.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
--------------------------------------------------------------------------------
/Puffer.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 5F3BE1A6219A48CA005C4BD8 /* Puffer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F3BE19C219A48CA005C4BD8 /* Puffer.framework */; };
11 | 5F3BE1AB219A48CA005C4BD8 /* PufferTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1AA219A48CA005C4BD8 /* PufferTests.swift */; };
12 | 5F3BE1AD219A48CA005C4BD8 /* Puffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F3BE19F219A48CA005C4BD8 /* Puffer.h */; settings = {ATTRIBUTES = (Public, ); }; };
13 | 5F3BE1B8219A493E005C4BD8 /* RotationDial.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1B6219A493E005C4BD8 /* RotationDial.swift */; };
14 | 5F3BE1BB219A4996005C4BD8 /* CoreGraphicsExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1BA219A4996005C4BD8 /* CoreGraphicsExtensions.swift */; };
15 | 5F3BE1BD219A49A8005C4BD8 /* Puffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1BC219A49A8005C4BD8 /* Puffer.swift */; };
16 | 5F3BE1EE219A70DD005C4BD8 /* RotationCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1ED219A70DD005C4BD8 /* RotationCalculator.swift */; };
17 | 5F3BE1FB219CBD63005C4BD8 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 5F3BE1FA219CBD63005C4BD8 /* README.md */; };
18 | 5F3BE1FD219CBFF1005C4BD8 /* Puffer.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 5F3BE1FC219CBFF1005C4BD8 /* Puffer.podspec */; };
19 | 5F3BE1FF219CCFC5005C4BD8 /* RotationDialPlate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1FE219CCFC5005C4BD8 /* RotationDialPlate.swift */; };
20 | 5FC56328229641C80094652C /* CGAngle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC56327229641C80094652C /* CGAngle.swift */; };
21 | 5FC5632A229642F60094652C /* RotationDialViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC56329229642F60094652C /* RotationDialViewModel.swift */; };
22 | 5FC5635D229881A60094652C /* RotationDial+Touches.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC5635C229881A60094652C /* RotationDial+Touches.swift */; };
23 | /* End PBXBuildFile section */
24 |
25 | /* Begin PBXContainerItemProxy section */
26 | 5F3BE1A7219A48CA005C4BD8 /* PBXContainerItemProxy */ = {
27 | isa = PBXContainerItemProxy;
28 | containerPortal = 5F3BE193219A48CA005C4BD8 /* Project object */;
29 | proxyType = 1;
30 | remoteGlobalIDString = 5F3BE19B219A48CA005C4BD8;
31 | remoteInfo = Puffer;
32 | };
33 | /* End PBXContainerItemProxy section */
34 |
35 | /* Begin PBXFileReference section */
36 | 5F3BE19C219A48CA005C4BD8 /* Puffer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Puffer.framework; sourceTree = BUILT_PRODUCTS_DIR; };
37 | 5F3BE19F219A48CA005C4BD8 /* Puffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Puffer.h; sourceTree = ""; };
38 | 5F3BE1A0219A48CA005C4BD8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
39 | 5F3BE1A5219A48CA005C4BD8 /* PufferTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PufferTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 5F3BE1AA219A48CA005C4BD8 /* PufferTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PufferTests.swift; sourceTree = ""; };
41 | 5F3BE1AC219A48CA005C4BD8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
42 | 5F3BE1B6219A493E005C4BD8 /* RotationDial.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RotationDial.swift; sourceTree = ""; };
43 | 5F3BE1BA219A4996005C4BD8 /* CoreGraphicsExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreGraphicsExtensions.swift; sourceTree = ""; };
44 | 5F3BE1BC219A49A8005C4BD8 /* Puffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Puffer.swift; sourceTree = ""; };
45 | 5F3BE1ED219A70DD005C4BD8 /* RotationCalculator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RotationCalculator.swift; sourceTree = ""; };
46 | 5F3BE1FA219CBD63005C4BD8 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
47 | 5F3BE1FC219CBFF1005C4BD8 /* Puffer.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Puffer.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
48 | 5F3BE1FE219CCFC5005C4BD8 /* RotationDialPlate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RotationDialPlate.swift; sourceTree = ""; };
49 | 5FC56327229641C80094652C /* CGAngle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGAngle.swift; sourceTree = ""; };
50 | 5FC56329229642F60094652C /* RotationDialViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotationDialViewModel.swift; sourceTree = ""; };
51 | 5FC5635C229881A60094652C /* RotationDial+Touches.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RotationDial+Touches.swift"; sourceTree = ""; };
52 | /* End PBXFileReference section */
53 |
54 | /* Begin PBXFrameworksBuildPhase section */
55 | 5F3BE199219A48CA005C4BD8 /* Frameworks */ = {
56 | isa = PBXFrameworksBuildPhase;
57 | buildActionMask = 2147483647;
58 | files = (
59 | );
60 | runOnlyForDeploymentPostprocessing = 0;
61 | };
62 | 5F3BE1A2219A48CA005C4BD8 /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | 5F3BE1A6219A48CA005C4BD8 /* Puffer.framework in Frameworks */,
67 | );
68 | runOnlyForDeploymentPostprocessing = 0;
69 | };
70 | /* End PBXFrameworksBuildPhase section */
71 |
72 | /* Begin PBXGroup section */
73 | 5F3BE192219A48CA005C4BD8 = {
74 | isa = PBXGroup;
75 | children = (
76 | 5F3BE1FC219CBFF1005C4BD8 /* Puffer.podspec */,
77 | 5F3BE1FA219CBD63005C4BD8 /* README.md */,
78 | 5F3BE19E219A48CA005C4BD8 /* Puffer */,
79 | 5F3BE1A9219A48CA005C4BD8 /* PufferTests */,
80 | 5F3BE19D219A48CA005C4BD8 /* Products */,
81 | );
82 | sourceTree = "";
83 | };
84 | 5F3BE19D219A48CA005C4BD8 /* Products */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 5F3BE19C219A48CA005C4BD8 /* Puffer.framework */,
88 | 5F3BE1A5219A48CA005C4BD8 /* PufferTests.xctest */,
89 | );
90 | name = Products;
91 | sourceTree = "";
92 | };
93 | 5F3BE19E219A48CA005C4BD8 /* Puffer */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 5FC5635C229881A60094652C /* RotationDial+Touches.swift */,
97 | 5F3BE1BA219A4996005C4BD8 /* CoreGraphicsExtensions.swift */,
98 | 5F3BE1B6219A493E005C4BD8 /* RotationDial.swift */,
99 | 5FC56329229642F60094652C /* RotationDialViewModel.swift */,
100 | 5F3BE1FE219CCFC5005C4BD8 /* RotationDialPlate.swift */,
101 | 5F3BE1ED219A70DD005C4BD8 /* RotationCalculator.swift */,
102 | 5F3BE1BC219A49A8005C4BD8 /* Puffer.swift */,
103 | 5F3BE19F219A48CA005C4BD8 /* Puffer.h */,
104 | 5F3BE1A0219A48CA005C4BD8 /* Info.plist */,
105 | 5FC56327229641C80094652C /* CGAngle.swift */,
106 | );
107 | path = Puffer;
108 | sourceTree = "";
109 | };
110 | 5F3BE1A9219A48CA005C4BD8 /* PufferTests */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 5F3BE1AA219A48CA005C4BD8 /* PufferTests.swift */,
114 | 5F3BE1AC219A48CA005C4BD8 /* Info.plist */,
115 | );
116 | path = PufferTests;
117 | sourceTree = "";
118 | };
119 | /* End PBXGroup section */
120 |
121 | /* Begin PBXHeadersBuildPhase section */
122 | 5F3BE197219A48CA005C4BD8 /* Headers */ = {
123 | isa = PBXHeadersBuildPhase;
124 | buildActionMask = 2147483647;
125 | files = (
126 | 5F3BE1AD219A48CA005C4BD8 /* Puffer.h in Headers */,
127 | );
128 | runOnlyForDeploymentPostprocessing = 0;
129 | };
130 | /* End PBXHeadersBuildPhase section */
131 |
132 | /* Begin PBXNativeTarget section */
133 | 5F3BE19B219A48CA005C4BD8 /* Puffer */ = {
134 | isa = PBXNativeTarget;
135 | buildConfigurationList = 5F3BE1B0219A48CA005C4BD8 /* Build configuration list for PBXNativeTarget "Puffer" */;
136 | buildPhases = (
137 | 5F3BE197219A48CA005C4BD8 /* Headers */,
138 | 5F3BE198219A48CA005C4BD8 /* Sources */,
139 | 5F3BE199219A48CA005C4BD8 /* Frameworks */,
140 | 5F3BE19A219A48CA005C4BD8 /* Resources */,
141 | );
142 | buildRules = (
143 | );
144 | dependencies = (
145 | );
146 | name = Puffer;
147 | productName = Puffer;
148 | productReference = 5F3BE19C219A48CA005C4BD8 /* Puffer.framework */;
149 | productType = "com.apple.product-type.framework";
150 | };
151 | 5F3BE1A4219A48CA005C4BD8 /* PufferTests */ = {
152 | isa = PBXNativeTarget;
153 | buildConfigurationList = 5F3BE1B3219A48CA005C4BD8 /* Build configuration list for PBXNativeTarget "PufferTests" */;
154 | buildPhases = (
155 | 5F3BE1A1219A48CA005C4BD8 /* Sources */,
156 | 5F3BE1A2219A48CA005C4BD8 /* Frameworks */,
157 | 5F3BE1A3219A48CA005C4BD8 /* Resources */,
158 | );
159 | buildRules = (
160 | );
161 | dependencies = (
162 | 5F3BE1A8219A48CA005C4BD8 /* PBXTargetDependency */,
163 | );
164 | name = PufferTests;
165 | productName = PufferTests;
166 | productReference = 5F3BE1A5219A48CA005C4BD8 /* PufferTests.xctest */;
167 | productType = "com.apple.product-type.bundle.unit-test";
168 | };
169 | /* End PBXNativeTarget section */
170 |
171 | /* Begin PBXProject section */
172 | 5F3BE193219A48CA005C4BD8 /* Project object */ = {
173 | isa = PBXProject;
174 | attributes = {
175 | LastSwiftUpdateCheck = 1010;
176 | LastUpgradeCheck = 1010;
177 | ORGANIZATIONNAME = Echo;
178 | TargetAttributes = {
179 | 5F3BE19B219A48CA005C4BD8 = {
180 | CreatedOnToolsVersion = 10.1;
181 | LastSwiftMigration = 1010;
182 | };
183 | 5F3BE1A4219A48CA005C4BD8 = {
184 | CreatedOnToolsVersion = 10.1;
185 | };
186 | };
187 | };
188 | buildConfigurationList = 5F3BE196219A48CA005C4BD8 /* Build configuration list for PBXProject "Puffer" */;
189 | compatibilityVersion = "Xcode 9.3";
190 | developmentRegion = en;
191 | hasScannedForEncodings = 0;
192 | knownRegions = (
193 | en,
194 | Base,
195 | );
196 | mainGroup = 5F3BE192219A48CA005C4BD8;
197 | productRefGroup = 5F3BE19D219A48CA005C4BD8 /* Products */;
198 | projectDirPath = "";
199 | projectRoot = "";
200 | targets = (
201 | 5F3BE19B219A48CA005C4BD8 /* Puffer */,
202 | 5F3BE1A4219A48CA005C4BD8 /* PufferTests */,
203 | );
204 | };
205 | /* End PBXProject section */
206 |
207 | /* Begin PBXResourcesBuildPhase section */
208 | 5F3BE19A219A48CA005C4BD8 /* Resources */ = {
209 | isa = PBXResourcesBuildPhase;
210 | buildActionMask = 2147483647;
211 | files = (
212 | 5F3BE1FD219CBFF1005C4BD8 /* Puffer.podspec in Resources */,
213 | 5F3BE1FB219CBD63005C4BD8 /* README.md in Resources */,
214 | );
215 | runOnlyForDeploymentPostprocessing = 0;
216 | };
217 | 5F3BE1A3219A48CA005C4BD8 /* Resources */ = {
218 | isa = PBXResourcesBuildPhase;
219 | buildActionMask = 2147483647;
220 | files = (
221 | );
222 | runOnlyForDeploymentPostprocessing = 0;
223 | };
224 | /* End PBXResourcesBuildPhase section */
225 |
226 | /* Begin PBXSourcesBuildPhase section */
227 | 5F3BE198219A48CA005C4BD8 /* Sources */ = {
228 | isa = PBXSourcesBuildPhase;
229 | buildActionMask = 2147483647;
230 | files = (
231 | 5F3BE1B8219A493E005C4BD8 /* RotationDial.swift in Sources */,
232 | 5F3BE1BB219A4996005C4BD8 /* CoreGraphicsExtensions.swift in Sources */,
233 | 5F3BE1FF219CCFC5005C4BD8 /* RotationDialPlate.swift in Sources */,
234 | 5FC56328229641C80094652C /* CGAngle.swift in Sources */,
235 | 5F3BE1BD219A49A8005C4BD8 /* Puffer.swift in Sources */,
236 | 5FC5635D229881A60094652C /* RotationDial+Touches.swift in Sources */,
237 | 5FC5632A229642F60094652C /* RotationDialViewModel.swift in Sources */,
238 | 5F3BE1EE219A70DD005C4BD8 /* RotationCalculator.swift in Sources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | 5F3BE1A1219A48CA005C4BD8 /* Sources */ = {
243 | isa = PBXSourcesBuildPhase;
244 | buildActionMask = 2147483647;
245 | files = (
246 | 5F3BE1AB219A48CA005C4BD8 /* PufferTests.swift in Sources */,
247 | );
248 | runOnlyForDeploymentPostprocessing = 0;
249 | };
250 | /* End PBXSourcesBuildPhase section */
251 |
252 | /* Begin PBXTargetDependency section */
253 | 5F3BE1A8219A48CA005C4BD8 /* PBXTargetDependency */ = {
254 | isa = PBXTargetDependency;
255 | target = 5F3BE19B219A48CA005C4BD8 /* Puffer */;
256 | targetProxy = 5F3BE1A7219A48CA005C4BD8 /* PBXContainerItemProxy */;
257 | };
258 | /* End PBXTargetDependency section */
259 |
260 | /* Begin XCBuildConfiguration section */
261 | 5F3BE1AE219A48CA005C4BD8 /* Debug */ = {
262 | isa = XCBuildConfiguration;
263 | buildSettings = {
264 | ALWAYS_SEARCH_USER_PATHS = NO;
265 | CLANG_ANALYZER_NONNULL = YES;
266 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
267 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
268 | CLANG_CXX_LIBRARY = "libc++";
269 | CLANG_ENABLE_MODULES = YES;
270 | CLANG_ENABLE_OBJC_ARC = YES;
271 | CLANG_ENABLE_OBJC_WEAK = YES;
272 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
273 | CLANG_WARN_BOOL_CONVERSION = YES;
274 | CLANG_WARN_COMMA = YES;
275 | CLANG_WARN_CONSTANT_CONVERSION = YES;
276 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
278 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
279 | CLANG_WARN_EMPTY_BODY = YES;
280 | CLANG_WARN_ENUM_CONVERSION = YES;
281 | CLANG_WARN_INFINITE_RECURSION = YES;
282 | CLANG_WARN_INT_CONVERSION = YES;
283 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
284 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
285 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
286 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
287 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
288 | CLANG_WARN_STRICT_PROTOTYPES = YES;
289 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
290 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
291 | CLANG_WARN_UNREACHABLE_CODE = YES;
292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
293 | CODE_SIGN_IDENTITY = "iPhone Developer";
294 | COPY_PHASE_STRIP = NO;
295 | CURRENT_PROJECT_VERSION = 1;
296 | DEBUG_INFORMATION_FORMAT = dwarf;
297 | ENABLE_STRICT_OBJC_MSGSEND = YES;
298 | ENABLE_TESTABILITY = YES;
299 | GCC_C_LANGUAGE_STANDARD = gnu11;
300 | GCC_DYNAMIC_NO_PIC = NO;
301 | GCC_NO_COMMON_BLOCKS = YES;
302 | GCC_OPTIMIZATION_LEVEL = 0;
303 | GCC_PREPROCESSOR_DEFINITIONS = (
304 | "DEBUG=1",
305 | "$(inherited)",
306 | );
307 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
308 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
309 | GCC_WARN_UNDECLARED_SELECTOR = YES;
310 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
311 | GCC_WARN_UNUSED_FUNCTION = YES;
312 | GCC_WARN_UNUSED_VARIABLE = YES;
313 | IPHONEOS_DEPLOYMENT_TARGET = 12.1;
314 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
315 | MTL_FAST_MATH = YES;
316 | ONLY_ACTIVE_ARCH = YES;
317 | SDKROOT = iphoneos;
318 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
319 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
320 | SWIFT_VERSION = 5.0;
321 | VERSIONING_SYSTEM = "apple-generic";
322 | VERSION_INFO_PREFIX = "";
323 | };
324 | name = Debug;
325 | };
326 | 5F3BE1AF219A48CA005C4BD8 /* Release */ = {
327 | isa = XCBuildConfiguration;
328 | buildSettings = {
329 | ALWAYS_SEARCH_USER_PATHS = NO;
330 | CLANG_ANALYZER_NONNULL = YES;
331 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
332 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
333 | CLANG_CXX_LIBRARY = "libc++";
334 | CLANG_ENABLE_MODULES = YES;
335 | CLANG_ENABLE_OBJC_ARC = YES;
336 | CLANG_ENABLE_OBJC_WEAK = YES;
337 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
338 | CLANG_WARN_BOOL_CONVERSION = YES;
339 | CLANG_WARN_COMMA = YES;
340 | CLANG_WARN_CONSTANT_CONVERSION = YES;
341 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
343 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
344 | CLANG_WARN_EMPTY_BODY = YES;
345 | CLANG_WARN_ENUM_CONVERSION = YES;
346 | CLANG_WARN_INFINITE_RECURSION = YES;
347 | CLANG_WARN_INT_CONVERSION = YES;
348 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
349 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
350 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
352 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
353 | CLANG_WARN_STRICT_PROTOTYPES = YES;
354 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
355 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
356 | CLANG_WARN_UNREACHABLE_CODE = YES;
357 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
358 | CODE_SIGN_IDENTITY = "iPhone Developer";
359 | COPY_PHASE_STRIP = NO;
360 | CURRENT_PROJECT_VERSION = 1;
361 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
362 | ENABLE_NS_ASSERTIONS = NO;
363 | ENABLE_STRICT_OBJC_MSGSEND = YES;
364 | GCC_C_LANGUAGE_STANDARD = gnu11;
365 | GCC_NO_COMMON_BLOCKS = YES;
366 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
367 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
368 | GCC_WARN_UNDECLARED_SELECTOR = YES;
369 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
370 | GCC_WARN_UNUSED_FUNCTION = YES;
371 | GCC_WARN_UNUSED_VARIABLE = YES;
372 | IPHONEOS_DEPLOYMENT_TARGET = 12.1;
373 | MTL_ENABLE_DEBUG_INFO = NO;
374 | MTL_FAST_MATH = YES;
375 | SDKROOT = iphoneos;
376 | SWIFT_COMPILATION_MODE = wholemodule;
377 | SWIFT_OPTIMIZATION_LEVEL = "-O";
378 | SWIFT_VERSION = 5.0;
379 | VALIDATE_PRODUCT = YES;
380 | VERSIONING_SYSTEM = "apple-generic";
381 | VERSION_INFO_PREFIX = "";
382 | };
383 | name = Release;
384 | };
385 | 5F3BE1B1219A48CA005C4BD8 /* Debug */ = {
386 | isa = XCBuildConfiguration;
387 | buildSettings = {
388 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
389 | CLANG_ENABLE_MODULES = YES;
390 | CODE_SIGN_IDENTITY = "";
391 | CODE_SIGN_STYLE = Automatic;
392 | DEFINES_MODULE = YES;
393 | DEVELOPMENT_TEAM = 3V26Q55U3S;
394 | DYLIB_COMPATIBILITY_VERSION = 1;
395 | DYLIB_CURRENT_VERSION = 1;
396 | DYLIB_INSTALL_NAME_BASE = "@rpath";
397 | INFOPLIST_FILE = Puffer/Info.plist;
398 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
399 | LD_RUNPATH_SEARCH_PATHS = (
400 | "$(inherited)",
401 | "@executable_path/Frameworks",
402 | "@loader_path/Frameworks",
403 | );
404 | MARKETING_VERSION = 1.0.3;
405 | PRODUCT_BUNDLE_IDENTIFIER = com.echo.Puffer;
406 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
407 | SKIP_INSTALL = YES;
408 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
409 | SWIFT_VERSION = 5.0;
410 | TARGETED_DEVICE_FAMILY = "1,2";
411 | };
412 | name = Debug;
413 | };
414 | 5F3BE1B2219A48CA005C4BD8 /* Release */ = {
415 | isa = XCBuildConfiguration;
416 | buildSettings = {
417 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
418 | CLANG_ENABLE_MODULES = YES;
419 | CODE_SIGN_IDENTITY = "";
420 | CODE_SIGN_STYLE = Automatic;
421 | DEFINES_MODULE = YES;
422 | DEVELOPMENT_TEAM = 3V26Q55U3S;
423 | DYLIB_COMPATIBILITY_VERSION = 1;
424 | DYLIB_CURRENT_VERSION = 1;
425 | DYLIB_INSTALL_NAME_BASE = "@rpath";
426 | INFOPLIST_FILE = Puffer/Info.plist;
427 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
428 | LD_RUNPATH_SEARCH_PATHS = (
429 | "$(inherited)",
430 | "@executable_path/Frameworks",
431 | "@loader_path/Frameworks",
432 | );
433 | MARKETING_VERSION = 1.0.3;
434 | PRODUCT_BUNDLE_IDENTIFIER = com.echo.Puffer;
435 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
436 | SKIP_INSTALL = YES;
437 | SWIFT_VERSION = 5.0;
438 | TARGETED_DEVICE_FAMILY = "1,2";
439 | };
440 | name = Release;
441 | };
442 | 5F3BE1B4219A48CA005C4BD8 /* Debug */ = {
443 | isa = XCBuildConfiguration;
444 | buildSettings = {
445 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
446 | CODE_SIGN_STYLE = Automatic;
447 | DEVELOPMENT_TEAM = 3V26Q55U3S;
448 | INFOPLIST_FILE = PufferTests/Info.plist;
449 | LD_RUNPATH_SEARCH_PATHS = (
450 | "$(inherited)",
451 | "@executable_path/Frameworks",
452 | "@loader_path/Frameworks",
453 | );
454 | PRODUCT_BUNDLE_IDENTIFIER = com.echo.PufferTests;
455 | PRODUCT_NAME = "$(TARGET_NAME)";
456 | SWIFT_VERSION = 5.0;
457 | TARGETED_DEVICE_FAMILY = "1,2";
458 | };
459 | name = Debug;
460 | };
461 | 5F3BE1B5219A48CA005C4BD8 /* Release */ = {
462 | isa = XCBuildConfiguration;
463 | buildSettings = {
464 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
465 | CODE_SIGN_STYLE = Automatic;
466 | DEVELOPMENT_TEAM = 3V26Q55U3S;
467 | INFOPLIST_FILE = PufferTests/Info.plist;
468 | LD_RUNPATH_SEARCH_PATHS = (
469 | "$(inherited)",
470 | "@executable_path/Frameworks",
471 | "@loader_path/Frameworks",
472 | );
473 | PRODUCT_BUNDLE_IDENTIFIER = com.echo.PufferTests;
474 | PRODUCT_NAME = "$(TARGET_NAME)";
475 | SWIFT_VERSION = 5.0;
476 | TARGETED_DEVICE_FAMILY = "1,2";
477 | };
478 | name = Release;
479 | };
480 | /* End XCBuildConfiguration section */
481 |
482 | /* Begin XCConfigurationList section */
483 | 5F3BE196219A48CA005C4BD8 /* Build configuration list for PBXProject "Puffer" */ = {
484 | isa = XCConfigurationList;
485 | buildConfigurations = (
486 | 5F3BE1AE219A48CA005C4BD8 /* Debug */,
487 | 5F3BE1AF219A48CA005C4BD8 /* Release */,
488 | );
489 | defaultConfigurationIsVisible = 0;
490 | defaultConfigurationName = Release;
491 | };
492 | 5F3BE1B0219A48CA005C4BD8 /* Build configuration list for PBXNativeTarget "Puffer" */ = {
493 | isa = XCConfigurationList;
494 | buildConfigurations = (
495 | 5F3BE1B1219A48CA005C4BD8 /* Debug */,
496 | 5F3BE1B2219A48CA005C4BD8 /* Release */,
497 | );
498 | defaultConfigurationIsVisible = 0;
499 | defaultConfigurationName = Release;
500 | };
501 | 5F3BE1B3219A48CA005C4BD8 /* Build configuration list for PBXNativeTarget "PufferTests" */ = {
502 | isa = XCConfigurationList;
503 | buildConfigurations = (
504 | 5F3BE1B4219A48CA005C4BD8 /* Debug */,
505 | 5F3BE1B5219A48CA005C4BD8 /* Release */,
506 | );
507 | defaultConfigurationIsVisible = 0;
508 | defaultConfigurationName = Release;
509 | };
510 | /* End XCConfigurationList section */
511 | };
512 | rootObject = 5F3BE193219A48CA005C4BD8 /* Project object */;
513 | }
514 |
--------------------------------------------------------------------------------
/PufferExample/PufferExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 4A91B6089CB01B45BDB9CCCD /* Pods_PufferExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 773F28649E274187013378ED /* Pods_PufferExampleTests.framework */; };
11 | 5F3BE1CB219A4AB7005C4BD8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1CA219A4AB7005C4BD8 /* AppDelegate.swift */; };
12 | 5F3BE1CD219A4AB7005C4BD8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1CC219A4AB7005C4BD8 /* ViewController.swift */; };
13 | 5F3BE1D2219A4AB8005C4BD8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5F3BE1D1219A4AB8005C4BD8 /* Assets.xcassets */; };
14 | 5F3BE1E0219A4AB8005C4BD8 /* PufferExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3BE1DF219A4AB8005C4BD8 /* PufferExampleTests.swift */; };
15 | 5FC56356229871620094652C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5FC56354229871620094652C /* Main.storyboard */; };
16 | 5FC56357229871620094652C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5FC56355229871620094652C /* LaunchScreen.storyboard */; };
17 | 91F4572B064718ED03856F36 /* Pods_PufferExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BF3CFC1041440C167E182C7 /* Pods_PufferExample.framework */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 5F3BE1DC219A4AB8005C4BD8 /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 5F3BE1BF219A4AB7005C4BD8 /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = 5F3BE1C6219A4AB7005C4BD8;
26 | remoteInfo = PufferExample;
27 | };
28 | /* End PBXContainerItemProxy section */
29 |
30 | /* Begin PBXFileReference section */
31 | 43B6A380093DB6B0B275C591 /* Pods-PufferExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PufferExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-PufferExampleTests/Pods-PufferExampleTests.debug.xcconfig"; sourceTree = ""; };
32 | 5F3BE1C7219A4AB7005C4BD8 /* PufferExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PufferExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
33 | 5F3BE1CA219A4AB7005C4BD8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
34 | 5F3BE1CC219A4AB7005C4BD8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
35 | 5F3BE1D1219A4AB8005C4BD8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
36 | 5F3BE1D6219A4AB8005C4BD8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
37 | 5F3BE1DB219A4AB8005C4BD8 /* PufferExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PufferExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
38 | 5F3BE1DF219A4AB8005C4BD8 /* PufferExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PufferExampleTests.swift; sourceTree = ""; };
39 | 5F3BE1E1219A4AB8005C4BD8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
40 | 5F3BE1F8219BAB27005C4BD8 /* Puffer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Puffer.framework; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 5FC56354229871620094652C /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; };
42 | 5FC56355229871620094652C /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; };
43 | 75D0576A280076B18CC19A7E /* Pods-PufferExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PufferExample.release.xcconfig"; path = "Target Support Files/Pods-PufferExample/Pods-PufferExample.release.xcconfig"; sourceTree = ""; };
44 | 773F28649E274187013378ED /* Pods_PufferExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PufferExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
45 | 7BF3CFC1041440C167E182C7 /* Pods_PufferExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PufferExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
46 | B91B6BEB690CA81580389C8F /* Pods-PufferExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PufferExample.debug.xcconfig"; path = "Target Support Files/Pods-PufferExample/Pods-PufferExample.debug.xcconfig"; sourceTree = ""; };
47 | E100F632F07CE00F4BB3AB83 /* Pods-PufferExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PufferExampleTests.release.xcconfig"; path = "Target Support Files/Pods-PufferExampleTests/Pods-PufferExampleTests.release.xcconfig"; sourceTree = ""; };
48 | /* End PBXFileReference section */
49 |
50 | /* Begin PBXFrameworksBuildPhase section */
51 | 5F3BE1C4219A4AB7005C4BD8 /* Frameworks */ = {
52 | isa = PBXFrameworksBuildPhase;
53 | buildActionMask = 2147483647;
54 | files = (
55 | 91F4572B064718ED03856F36 /* Pods_PufferExample.framework in Frameworks */,
56 | );
57 | runOnlyForDeploymentPostprocessing = 0;
58 | };
59 | 5F3BE1D8219A4AB8005C4BD8 /* Frameworks */ = {
60 | isa = PBXFrameworksBuildPhase;
61 | buildActionMask = 2147483647;
62 | files = (
63 | 4A91B6089CB01B45BDB9CCCD /* Pods_PufferExampleTests.framework in Frameworks */,
64 | );
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | /* End PBXFrameworksBuildPhase section */
68 |
69 | /* Begin PBXGroup section */
70 | 5F3BE1BE219A4AB7005C4BD8 = {
71 | isa = PBXGroup;
72 | children = (
73 | 5F3BE1C9219A4AB7005C4BD8 /* PufferExample */,
74 | 5F3BE1DE219A4AB8005C4BD8 /* PufferExampleTests */,
75 | 5F3BE1C8219A4AB7005C4BD8 /* Products */,
76 | 5F3BE1EA219A4B57005C4BD8 /* Frameworks */,
77 | 97CAAF0A5B54E464F0D006C7 /* Pods */,
78 | );
79 | sourceTree = "";
80 | };
81 | 5F3BE1C8219A4AB7005C4BD8 /* Products */ = {
82 | isa = PBXGroup;
83 | children = (
84 | 5F3BE1C7219A4AB7005C4BD8 /* PufferExample.app */,
85 | 5F3BE1DB219A4AB8005C4BD8 /* PufferExampleTests.xctest */,
86 | );
87 | name = Products;
88 | sourceTree = "";
89 | };
90 | 5F3BE1C9219A4AB7005C4BD8 /* PufferExample */ = {
91 | isa = PBXGroup;
92 | children = (
93 | 5FC56355229871620094652C /* LaunchScreen.storyboard */,
94 | 5FC56354229871620094652C /* Main.storyboard */,
95 | 5F3BE1CA219A4AB7005C4BD8 /* AppDelegate.swift */,
96 | 5F3BE1CC219A4AB7005C4BD8 /* ViewController.swift */,
97 | 5F3BE1D1219A4AB8005C4BD8 /* Assets.xcassets */,
98 | 5F3BE1D6219A4AB8005C4BD8 /* Info.plist */,
99 | );
100 | path = PufferExample;
101 | sourceTree = "";
102 | };
103 | 5F3BE1DE219A4AB8005C4BD8 /* PufferExampleTests */ = {
104 | isa = PBXGroup;
105 | children = (
106 | 5F3BE1DF219A4AB8005C4BD8 /* PufferExampleTests.swift */,
107 | 5F3BE1E1219A4AB8005C4BD8 /* Info.plist */,
108 | );
109 | path = PufferExampleTests;
110 | sourceTree = "";
111 | };
112 | 5F3BE1EA219A4B57005C4BD8 /* Frameworks */ = {
113 | isa = PBXGroup;
114 | children = (
115 | 5F3BE1F8219BAB27005C4BD8 /* Puffer.framework */,
116 | 7BF3CFC1041440C167E182C7 /* Pods_PufferExample.framework */,
117 | 773F28649E274187013378ED /* Pods_PufferExampleTests.framework */,
118 | );
119 | name = Frameworks;
120 | sourceTree = "";
121 | };
122 | 97CAAF0A5B54E464F0D006C7 /* Pods */ = {
123 | isa = PBXGroup;
124 | children = (
125 | B91B6BEB690CA81580389C8F /* Pods-PufferExample.debug.xcconfig */,
126 | 75D0576A280076B18CC19A7E /* Pods-PufferExample.release.xcconfig */,
127 | 43B6A380093DB6B0B275C591 /* Pods-PufferExampleTests.debug.xcconfig */,
128 | E100F632F07CE00F4BB3AB83 /* Pods-PufferExampleTests.release.xcconfig */,
129 | );
130 | path = Pods;
131 | sourceTree = "";
132 | };
133 | /* End PBXGroup section */
134 |
135 | /* Begin PBXNativeTarget section */
136 | 5F3BE1C6219A4AB7005C4BD8 /* PufferExample */ = {
137 | isa = PBXNativeTarget;
138 | buildConfigurationList = 5F3BE1E4219A4AB8005C4BD8 /* Build configuration list for PBXNativeTarget "PufferExample" */;
139 | buildPhases = (
140 | CCE710BBBD18D6A846DF41C8 /* [CP] Check Pods Manifest.lock */,
141 | 5F3BE1C3219A4AB7005C4BD8 /* Sources */,
142 | 5F3BE1C4219A4AB7005C4BD8 /* Frameworks */,
143 | 5F3BE1C5219A4AB7005C4BD8 /* Resources */,
144 | 4C8E660BE75C8BADF8A506AA /* [CP] Embed Pods Frameworks */,
145 | );
146 | buildRules = (
147 | );
148 | dependencies = (
149 | );
150 | name = PufferExample;
151 | productName = PufferExample;
152 | productReference = 5F3BE1C7219A4AB7005C4BD8 /* PufferExample.app */;
153 | productType = "com.apple.product-type.application";
154 | };
155 | 5F3BE1DA219A4AB8005C4BD8 /* PufferExampleTests */ = {
156 | isa = PBXNativeTarget;
157 | buildConfigurationList = 5F3BE1E7219A4AB8005C4BD8 /* Build configuration list for PBXNativeTarget "PufferExampleTests" */;
158 | buildPhases = (
159 | 4EB105CB1403CD67E233FE3F /* [CP] Check Pods Manifest.lock */,
160 | 5F3BE1D7219A4AB8005C4BD8 /* Sources */,
161 | 5F3BE1D8219A4AB8005C4BD8 /* Frameworks */,
162 | 5F3BE1D9219A4AB8005C4BD8 /* Resources */,
163 | );
164 | buildRules = (
165 | );
166 | dependencies = (
167 | 5F3BE1DD219A4AB8005C4BD8 /* PBXTargetDependency */,
168 | );
169 | name = PufferExampleTests;
170 | productName = PufferExampleTests;
171 | productReference = 5F3BE1DB219A4AB8005C4BD8 /* PufferExampleTests.xctest */;
172 | productType = "com.apple.product-type.bundle.unit-test";
173 | };
174 | /* End PBXNativeTarget section */
175 |
176 | /* Begin PBXProject section */
177 | 5F3BE1BF219A4AB7005C4BD8 /* Project object */ = {
178 | isa = PBXProject;
179 | attributes = {
180 | LastSwiftUpdateCheck = 1010;
181 | LastUpgradeCheck = 1010;
182 | ORGANIZATIONNAME = Echo;
183 | TargetAttributes = {
184 | 5F3BE1C6219A4AB7005C4BD8 = {
185 | CreatedOnToolsVersion = 10.1;
186 | };
187 | 5F3BE1DA219A4AB8005C4BD8 = {
188 | CreatedOnToolsVersion = 10.1;
189 | TestTargetID = 5F3BE1C6219A4AB7005C4BD8;
190 | };
191 | };
192 | };
193 | buildConfigurationList = 5F3BE1C2219A4AB7005C4BD8 /* Build configuration list for PBXProject "PufferExample" */;
194 | compatibilityVersion = "Xcode 9.3";
195 | developmentRegion = en;
196 | hasScannedForEncodings = 0;
197 | knownRegions = (
198 | );
199 | mainGroup = 5F3BE1BE219A4AB7005C4BD8;
200 | productRefGroup = 5F3BE1C8219A4AB7005C4BD8 /* Products */;
201 | projectDirPath = "";
202 | projectRoot = "";
203 | targets = (
204 | 5F3BE1C6219A4AB7005C4BD8 /* PufferExample */,
205 | 5F3BE1DA219A4AB8005C4BD8 /* PufferExampleTests */,
206 | );
207 | };
208 | /* End PBXProject section */
209 |
210 | /* Begin PBXResourcesBuildPhase section */
211 | 5F3BE1C5219A4AB7005C4BD8 /* Resources */ = {
212 | isa = PBXResourcesBuildPhase;
213 | buildActionMask = 2147483647;
214 | files = (
215 | 5FC56357229871620094652C /* LaunchScreen.storyboard in Resources */,
216 | 5F3BE1D2219A4AB8005C4BD8 /* Assets.xcassets in Resources */,
217 | 5FC56356229871620094652C /* Main.storyboard in Resources */,
218 | );
219 | runOnlyForDeploymentPostprocessing = 0;
220 | };
221 | 5F3BE1D9219A4AB8005C4BD8 /* Resources */ = {
222 | isa = PBXResourcesBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | };
228 | /* End PBXResourcesBuildPhase section */
229 |
230 | /* Begin PBXShellScriptBuildPhase section */
231 | 4C8E660BE75C8BADF8A506AA /* [CP] Embed Pods Frameworks */ = {
232 | isa = PBXShellScriptBuildPhase;
233 | buildActionMask = 2147483647;
234 | files = (
235 | );
236 | inputFileListPaths = (
237 | "${PODS_ROOT}/Target Support Files/Pods-PufferExample/Pods-PufferExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
238 | );
239 | name = "[CP] Embed Pods Frameworks";
240 | outputFileListPaths = (
241 | "${PODS_ROOT}/Target Support Files/Pods-PufferExample/Pods-PufferExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
242 | );
243 | runOnlyForDeploymentPostprocessing = 0;
244 | shellPath = /bin/sh;
245 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PufferExample/Pods-PufferExample-frameworks.sh\"\n";
246 | showEnvVarsInLog = 0;
247 | };
248 | 4EB105CB1403CD67E233FE3F /* [CP] Check Pods Manifest.lock */ = {
249 | isa = PBXShellScriptBuildPhase;
250 | buildActionMask = 2147483647;
251 | files = (
252 | );
253 | inputFileListPaths = (
254 | );
255 | inputPaths = (
256 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
257 | "${PODS_ROOT}/Manifest.lock",
258 | );
259 | name = "[CP] Check Pods Manifest.lock";
260 | outputFileListPaths = (
261 | );
262 | outputPaths = (
263 | "$(DERIVED_FILE_DIR)/Pods-PufferExampleTests-checkManifestLockResult.txt",
264 | );
265 | runOnlyForDeploymentPostprocessing = 0;
266 | shellPath = /bin/sh;
267 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
268 | showEnvVarsInLog = 0;
269 | };
270 | CCE710BBBD18D6A846DF41C8 /* [CP] Check Pods Manifest.lock */ = {
271 | isa = PBXShellScriptBuildPhase;
272 | buildActionMask = 2147483647;
273 | files = (
274 | );
275 | inputFileListPaths = (
276 | );
277 | inputPaths = (
278 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
279 | "${PODS_ROOT}/Manifest.lock",
280 | );
281 | name = "[CP] Check Pods Manifest.lock";
282 | outputFileListPaths = (
283 | );
284 | outputPaths = (
285 | "$(DERIVED_FILE_DIR)/Pods-PufferExample-checkManifestLockResult.txt",
286 | );
287 | runOnlyForDeploymentPostprocessing = 0;
288 | shellPath = /bin/sh;
289 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
290 | showEnvVarsInLog = 0;
291 | };
292 | /* End PBXShellScriptBuildPhase section */
293 |
294 | /* Begin PBXSourcesBuildPhase section */
295 | 5F3BE1C3219A4AB7005C4BD8 /* Sources */ = {
296 | isa = PBXSourcesBuildPhase;
297 | buildActionMask = 2147483647;
298 | files = (
299 | 5F3BE1CD219A4AB7005C4BD8 /* ViewController.swift in Sources */,
300 | 5F3BE1CB219A4AB7005C4BD8 /* AppDelegate.swift in Sources */,
301 | );
302 | runOnlyForDeploymentPostprocessing = 0;
303 | };
304 | 5F3BE1D7219A4AB8005C4BD8 /* Sources */ = {
305 | isa = PBXSourcesBuildPhase;
306 | buildActionMask = 2147483647;
307 | files = (
308 | 5F3BE1E0219A4AB8005C4BD8 /* PufferExampleTests.swift in Sources */,
309 | );
310 | runOnlyForDeploymentPostprocessing = 0;
311 | };
312 | /* End PBXSourcesBuildPhase section */
313 |
314 | /* Begin PBXTargetDependency section */
315 | 5F3BE1DD219A4AB8005C4BD8 /* PBXTargetDependency */ = {
316 | isa = PBXTargetDependency;
317 | target = 5F3BE1C6219A4AB7005C4BD8 /* PufferExample */;
318 | targetProxy = 5F3BE1DC219A4AB8005C4BD8 /* PBXContainerItemProxy */;
319 | };
320 | /* End PBXTargetDependency section */
321 |
322 | /* Begin XCBuildConfiguration section */
323 | 5F3BE1E2219A4AB8005C4BD8 /* Debug */ = {
324 | isa = XCBuildConfiguration;
325 | buildSettings = {
326 | ALWAYS_SEARCH_USER_PATHS = NO;
327 | CLANG_ANALYZER_NONNULL = YES;
328 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
329 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
330 | CLANG_CXX_LIBRARY = "libc++";
331 | CLANG_ENABLE_MODULES = YES;
332 | CLANG_ENABLE_OBJC_ARC = YES;
333 | CLANG_ENABLE_OBJC_WEAK = YES;
334 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
335 | CLANG_WARN_BOOL_CONVERSION = YES;
336 | CLANG_WARN_COMMA = YES;
337 | CLANG_WARN_CONSTANT_CONVERSION = YES;
338 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
340 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
341 | CLANG_WARN_EMPTY_BODY = YES;
342 | CLANG_WARN_ENUM_CONVERSION = YES;
343 | CLANG_WARN_INFINITE_RECURSION = YES;
344 | CLANG_WARN_INT_CONVERSION = YES;
345 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
346 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
347 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
348 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
349 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
350 | CLANG_WARN_STRICT_PROTOTYPES = YES;
351 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
352 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
353 | CLANG_WARN_UNREACHABLE_CODE = YES;
354 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
355 | CODE_SIGN_IDENTITY = "iPhone Developer";
356 | COPY_PHASE_STRIP = NO;
357 | DEBUG_INFORMATION_FORMAT = dwarf;
358 | ENABLE_STRICT_OBJC_MSGSEND = YES;
359 | ENABLE_TESTABILITY = YES;
360 | GCC_C_LANGUAGE_STANDARD = gnu11;
361 | GCC_DYNAMIC_NO_PIC = NO;
362 | GCC_NO_COMMON_BLOCKS = YES;
363 | GCC_OPTIMIZATION_LEVEL = 0;
364 | GCC_PREPROCESSOR_DEFINITIONS = (
365 | "DEBUG=1",
366 | "$(inherited)",
367 | );
368 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
369 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
370 | GCC_WARN_UNDECLARED_SELECTOR = YES;
371 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
372 | GCC_WARN_UNUSED_FUNCTION = YES;
373 | GCC_WARN_UNUSED_VARIABLE = YES;
374 | IPHONEOS_DEPLOYMENT_TARGET = 12.1;
375 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
376 | MTL_FAST_MATH = YES;
377 | ONLY_ACTIVE_ARCH = YES;
378 | SDKROOT = iphoneos;
379 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
380 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
381 | SWIFT_VERSION = 5.0;
382 | };
383 | name = Debug;
384 | };
385 | 5F3BE1E3219A4AB8005C4BD8 /* Release */ = {
386 | isa = XCBuildConfiguration;
387 | buildSettings = {
388 | ALWAYS_SEARCH_USER_PATHS = NO;
389 | CLANG_ANALYZER_NONNULL = YES;
390 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
391 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
392 | CLANG_CXX_LIBRARY = "libc++";
393 | CLANG_ENABLE_MODULES = YES;
394 | CLANG_ENABLE_OBJC_ARC = YES;
395 | CLANG_ENABLE_OBJC_WEAK = YES;
396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
397 | CLANG_WARN_BOOL_CONVERSION = YES;
398 | CLANG_WARN_COMMA = YES;
399 | CLANG_WARN_CONSTANT_CONVERSION = YES;
400 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
401 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
402 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
403 | CLANG_WARN_EMPTY_BODY = YES;
404 | CLANG_WARN_ENUM_CONVERSION = YES;
405 | CLANG_WARN_INFINITE_RECURSION = YES;
406 | CLANG_WARN_INT_CONVERSION = YES;
407 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
408 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
409 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
411 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
412 | CLANG_WARN_STRICT_PROTOTYPES = YES;
413 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
414 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
415 | CLANG_WARN_UNREACHABLE_CODE = YES;
416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
417 | CODE_SIGN_IDENTITY = "iPhone Developer";
418 | COPY_PHASE_STRIP = NO;
419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
420 | ENABLE_NS_ASSERTIONS = NO;
421 | ENABLE_STRICT_OBJC_MSGSEND = YES;
422 | GCC_C_LANGUAGE_STANDARD = gnu11;
423 | GCC_NO_COMMON_BLOCKS = YES;
424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
426 | GCC_WARN_UNDECLARED_SELECTOR = YES;
427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
428 | GCC_WARN_UNUSED_FUNCTION = YES;
429 | GCC_WARN_UNUSED_VARIABLE = YES;
430 | IPHONEOS_DEPLOYMENT_TARGET = 12.1;
431 | MTL_ENABLE_DEBUG_INFO = NO;
432 | MTL_FAST_MATH = YES;
433 | SDKROOT = iphoneos;
434 | SWIFT_COMPILATION_MODE = wholemodule;
435 | SWIFT_OPTIMIZATION_LEVEL = "-O";
436 | SWIFT_VERSION = 5.0;
437 | VALIDATE_PRODUCT = YES;
438 | };
439 | name = Release;
440 | };
441 | 5F3BE1E5219A4AB8005C4BD8 /* Debug */ = {
442 | isa = XCBuildConfiguration;
443 | baseConfigurationReference = B91B6BEB690CA81580389C8F /* Pods-PufferExample.debug.xcconfig */;
444 | buildSettings = {
445 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
447 | CODE_SIGN_STYLE = Automatic;
448 | DEVELOPMENT_TEAM = 3V26Q55U3S;
449 | INFOPLIST_FILE = PufferExample/Info.plist;
450 | LD_RUNPATH_SEARCH_PATHS = (
451 | "$(inherited)",
452 | "@executable_path/Frameworks",
453 | );
454 | PRODUCT_BUNDLE_IDENTIFIER = com.echo.PufferExample;
455 | PRODUCT_NAME = "$(TARGET_NAME)";
456 | SWIFT_VERSION = 5.0;
457 | TARGETED_DEVICE_FAMILY = "1,2";
458 | };
459 | name = Debug;
460 | };
461 | 5F3BE1E6219A4AB8005C4BD8 /* Release */ = {
462 | isa = XCBuildConfiguration;
463 | baseConfigurationReference = 75D0576A280076B18CC19A7E /* Pods-PufferExample.release.xcconfig */;
464 | buildSettings = {
465 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
466 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
467 | CODE_SIGN_STYLE = Automatic;
468 | DEVELOPMENT_TEAM = 3V26Q55U3S;
469 | INFOPLIST_FILE = PufferExample/Info.plist;
470 | LD_RUNPATH_SEARCH_PATHS = (
471 | "$(inherited)",
472 | "@executable_path/Frameworks",
473 | );
474 | PRODUCT_BUNDLE_IDENTIFIER = com.echo.PufferExample;
475 | PRODUCT_NAME = "$(TARGET_NAME)";
476 | SWIFT_VERSION = 5.0;
477 | TARGETED_DEVICE_FAMILY = "1,2";
478 | };
479 | name = Release;
480 | };
481 | 5F3BE1E8219A4AB8005C4BD8 /* Debug */ = {
482 | isa = XCBuildConfiguration;
483 | baseConfigurationReference = 43B6A380093DB6B0B275C591 /* Pods-PufferExampleTests.debug.xcconfig */;
484 | buildSettings = {
485 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
486 | BUNDLE_LOADER = "$(TEST_HOST)";
487 | CODE_SIGN_STYLE = Automatic;
488 | DEVELOPMENT_TEAM = 3V26Q55U3S;
489 | INFOPLIST_FILE = PufferExampleTests/Info.plist;
490 | LD_RUNPATH_SEARCH_PATHS = (
491 | "$(inherited)",
492 | "@executable_path/Frameworks",
493 | "@loader_path/Frameworks",
494 | );
495 | PRODUCT_BUNDLE_IDENTIFIER = com.echo.PufferExampleTests;
496 | PRODUCT_NAME = "$(TARGET_NAME)";
497 | SWIFT_VERSION = 5.0;
498 | TARGETED_DEVICE_FAMILY = "1,2";
499 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PufferExample.app/PufferExample";
500 | };
501 | name = Debug;
502 | };
503 | 5F3BE1E9219A4AB8005C4BD8 /* Release */ = {
504 | isa = XCBuildConfiguration;
505 | baseConfigurationReference = E100F632F07CE00F4BB3AB83 /* Pods-PufferExampleTests.release.xcconfig */;
506 | buildSettings = {
507 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
508 | BUNDLE_LOADER = "$(TEST_HOST)";
509 | CODE_SIGN_STYLE = Automatic;
510 | DEVELOPMENT_TEAM = 3V26Q55U3S;
511 | INFOPLIST_FILE = PufferExampleTests/Info.plist;
512 | LD_RUNPATH_SEARCH_PATHS = (
513 | "$(inherited)",
514 | "@executable_path/Frameworks",
515 | "@loader_path/Frameworks",
516 | );
517 | PRODUCT_BUNDLE_IDENTIFIER = com.echo.PufferExampleTests;
518 | PRODUCT_NAME = "$(TARGET_NAME)";
519 | SWIFT_VERSION = 5.0;
520 | TARGETED_DEVICE_FAMILY = "1,2";
521 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PufferExample.app/PufferExample";
522 | };
523 | name = Release;
524 | };
525 | /* End XCBuildConfiguration section */
526 |
527 | /* Begin XCConfigurationList section */
528 | 5F3BE1C2219A4AB7005C4BD8 /* Build configuration list for PBXProject "PufferExample" */ = {
529 | isa = XCConfigurationList;
530 | buildConfigurations = (
531 | 5F3BE1E2219A4AB8005C4BD8 /* Debug */,
532 | 5F3BE1E3219A4AB8005C4BD8 /* Release */,
533 | );
534 | defaultConfigurationIsVisible = 0;
535 | defaultConfigurationName = Release;
536 | };
537 | 5F3BE1E4219A4AB8005C4BD8 /* Build configuration list for PBXNativeTarget "PufferExample" */ = {
538 | isa = XCConfigurationList;
539 | buildConfigurations = (
540 | 5F3BE1E5219A4AB8005C4BD8 /* Debug */,
541 | 5F3BE1E6219A4AB8005C4BD8 /* Release */,
542 | );
543 | defaultConfigurationIsVisible = 0;
544 | defaultConfigurationName = Release;
545 | };
546 | 5F3BE1E7219A4AB8005C4BD8 /* Build configuration list for PBXNativeTarget "PufferExampleTests" */ = {
547 | isa = XCConfigurationList;
548 | buildConfigurations = (
549 | 5F3BE1E8219A4AB8005C4BD8 /* Debug */,
550 | 5F3BE1E9219A4AB8005C4BD8 /* Release */,
551 | );
552 | defaultConfigurationIsVisible = 0;
553 | defaultConfigurationName = Release;
554 | };
555 | /* End XCConfigurationList section */
556 | };
557 | rootObject = 5F3BE1BF219A4AB7005C4BD8 /* Project object */;
558 | }
559 |
--------------------------------------------------------------------------------