├── .DS_Store ├── rulerView.gif ├── YKScrollRulerSwift ├── .DS_Store ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── AppDelegate.swift ├── ViewController.swift └── DYScorllRuler │ └── DYScrollRulerView.swift ├── YKScrollRulerSwiftTests ├── .DS_Store ├── Info.plist └── YKScrollRulerSwiftTests.swift ├── YKScrollRulerSwiftUITests ├── .DS_Store ├── Info.plist └── YKScrollRulerSwiftUITests.swift ├── YKScrollRulerSwift.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── DanielYao.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcuserdata │ └── DanielYao.xcuserdatad │ │ ├── xcschemes │ │ ├── xcschememanagement.plist │ │ └── YKScrollRulerSwift.xcscheme │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist └── project.pbxproj └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/SwiftRulerView/HEAD/.DS_Store -------------------------------------------------------------------------------- /rulerView.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/SwiftRulerView/HEAD/rulerView.gif -------------------------------------------------------------------------------- /YKScrollRulerSwift/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/SwiftRulerView/HEAD/YKScrollRulerSwift/.DS_Store -------------------------------------------------------------------------------- /YKScrollRulerSwiftTests/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/SwiftRulerView/HEAD/YKScrollRulerSwiftTests/.DS_Store -------------------------------------------------------------------------------- /YKScrollRulerSwiftUITests/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/SwiftRulerView/HEAD/YKScrollRulerSwiftUITests/.DS_Store -------------------------------------------------------------------------------- /YKScrollRulerSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YKScrollRulerSwift.xcodeproj/project.xcworkspace/xcuserdata/DanielYao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/SwiftRulerView/HEAD/YKScrollRulerSwift.xcodeproj/project.xcworkspace/xcuserdata/DanielYao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /YKScrollRulerSwiftTests/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 | -------------------------------------------------------------------------------- /YKScrollRulerSwiftUITests/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 | -------------------------------------------------------------------------------- /YKScrollRulerSwift.xcodeproj/xcuserdata/DanielYao.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | YKScrollRulerSwift.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6D1677B51DE467710017ED30 16 | 17 | primary 18 | 19 | 20 | 6D1677C91DE467710017ED30 21 | 22 | primary 23 | 24 | 25 | 6D1677D41DE467710017ED30 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /YKScrollRulerSwiftTests/YKScrollRulerSwiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YKScrollRulerSwiftTests.swift 3 | // YKScrollRulerSwiftTests 4 | // 5 | // Created by Daniel Yao on 16/11/22. 6 | // Copyright © 2016年 Daniel Yao. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import YKScrollRulerSwift 11 | 12 | class YKScrollRulerSwiftTests: 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 | -------------------------------------------------------------------------------- /YKScrollRulerSwift.xcodeproj/xcuserdata/DanielYao.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 18 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /YKScrollRulerSwift/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /YKScrollRulerSwiftUITests/YKScrollRulerSwiftUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YKScrollRulerSwiftUITests.swift 3 | // YKScrollRulerSwiftUITests 4 | // 5 | // Created by Daniel Yao on 16/11/22. 6 | // Copyright © 2016年 Daniel Yao. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class YKScrollRulerSwiftUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /YKScrollRulerSwift/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 | -------------------------------------------------------------------------------- /YKScrollRulerSwift/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 | -------------------------------------------------------------------------------- /YKScrollRulerSwift/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SwiftRulerView 2 | = 3 | 喜欢的朋友可以下载下来,如果代码对你有所帮助,还请在 github 给个 star,非常感谢你的支持! 4 | - 5 | * swift版本的滑动标尺 , 之前用OC做了一个版本、最近在研究swift中的drawRect方法,刚好拿来练手 ! 6 | 7 | 8 | * 效果图 9 | 10 | ![image](https://github.com/DanielYK/SwiftRulerView/blob/master/rulerView.gif) 11 | 12 | * 使用方法 13 | 14 |

15 |   lazy var lazyRulerView:DYScrollRulerView = { [unowned self] in
16 |         let unitStr     = "¥"
17 |         let rulerHeight = DYScrollRulerView.rulerViewHeight
18 |         print(rulerHeight)
19 |         var rulerView   = DYScrollRulerView.init(frame: CGRect.init(x: 5, y: Int(ScreenHeight)/5, width: Int(ScreenWidth)-20, height: rulerHeight()), tminValue: 0, tmaxValue: 1000, tstep: 10, tunit: unitStr, tNum:10)
20 |         rulerView.bgColor       = UIColor.cyan
21 |         rulerView.triangleColor = UIColor.red
22 |         rulerView.delegate      = self
23 |         rulerView.scrollByHand  = true
24 |        return rulerView
25 |     }()
26 |     
27 |     lazy var lazyTimeRullerView:DYScrollRulerView = { [unowned self] in
28 |         let unitStr = ""
29 |         let rulersHeight = DYScrollRulerView.rulerViewHeight
30 |         print(rulersHeight)
31 |        
32 |         var timerView = DYScrollRulerView.init(frame: CGRect.init(x: 5, y: Int(ScreenHeight/5*3), width: Int(ScreenWidth)-20, height: rulersHeight()), tminValue: 0, tmaxValue: 23, tstep: 0.2, tunit: unitStr, tNum: 5)
33 |         timerView.bgColor       = UIColor.orange
34 |         timerView.triangleColor = UIColor.blue
35 |         timerView.delegate      = self
36 |         timerView.scrollByHand  = true
37 |         return timerView
38 |     }()
39 |     override func viewDidLoad() {
40 |         super.viewDidLoad()
41 |         // Do any additional setup after loading the view, typically from a nib.
42 |         
43 |         self.view.addSubview(lazyRulerView)
44 |         self.view.addSubview(lazyTimeRullerView)
45 |     }
46 | 
47 | 
48 | 
49 | 50 | //滑动尺子时产生的回调 51 | 52 |

53 | extension ViewController:DYScorllRulerDelegate {
54 |     func dyScrollRulerViewValueChange(rulerView: DYScrollRulerView, value: Float) {
55 |         print("滑动的值-------》"+"\(value)")
56 |     }
57 | }
58 | 
59 | - 使用过程中有问题请加QQ或发邮件:584379066 备注:Git ScrollRuler 60 | 61 | 62 | -------------------------------------------------------------------------------- /YKScrollRulerSwift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // YKScrollRulerSwift 4 | // 5 | // Created by Daniel Yao on 16/11/22. 6 | // Copyright © 2016年 Daniel Yao. 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 | -------------------------------------------------------------------------------- /YKScrollRulerSwift/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // YKScrollRulerSwift 4 | // 5 | // Created by Daniel Yao on 16/11/22. 6 | // Copyright © 2016年 Daniel Yao. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | // 屏幕宽度 11 | let ScreenWidth = UIScreen.main.bounds.width 12 | // 屏幕高度 13 | let ScreenHeight = UIScreen.main.bounds.height 14 | 15 | class ViewController: UIViewController { 16 | 17 | 18 | lazy var lazyRulerView:DYScrollRulerView = { [unowned self] in 19 | let unitStr = "¥" 20 | let rulerHeight = DYScrollRulerView.rulerViewHeight 21 | print(rulerHeight) 22 | var rulerView = DYScrollRulerView.init(frame: CGRect.init(x: 5, y: Int(ScreenHeight/5*0.5), width: Int(ScreenWidth)-20, height: rulerHeight()), tminValue: 0, tmaxValue: 1000, tstep: 10, tunit: unitStr, tNum:10, viewcontroller:self) 23 | rulerView.setDefaultValueAndAnimated(defaultValue: 500, animated: true) 24 | rulerView.bgColor = UIColor.cyan 25 | rulerView.triangleColor = UIColor.red 26 | rulerView.delegate = self 27 | rulerView.scrollByHand = true 28 | return rulerView 29 | }() 30 | 31 | lazy var lazyTimeRullerView:DYScrollRulerView = { [unowned self] in 32 | let unitStr = "" 33 | let rulersHeight = DYScrollRulerView.rulerViewHeight 34 | print(rulersHeight) 35 | 36 | var timerView = DYScrollRulerView.init(frame: CGRect.init(x: 5, y: Int(ScreenHeight/5*2), width: Int(ScreenWidth)-20, height: rulersHeight()), tminValue: 0, tmaxValue: 23, tstep: 0.2, tunit: unitStr, tNum: 5, viewcontroller:self) 37 | timerView.setDefaultValueAndAnimated(defaultValue: 2, animated: true) 38 | timerView.bgColor = UIColor.orange 39 | timerView.triangleColor = UIColor.blue 40 | timerView.delegate = self 41 | timerView.scrollByHand = true 42 | return timerView 43 | }() 44 | 45 | lazy var lazyNoneZeroRullerView:DYScrollRulerView = { [unowned self] in 46 | let unitStr = "" 47 | let rulersHeight = DYScrollRulerView.rulerViewHeight 48 | print(rulersHeight) 49 | 50 | var zeroRulerView = DYScrollRulerView.init(frame: CGRect.init(x: 5, y: Int(ScreenHeight/5*3.5), width: Int(ScreenWidth)-20, height: rulersHeight()), tminValue: 20, tmaxValue: 200, tstep: 1, tunit: unitStr, tNum: 5, viewcontroller:self) 51 | zeroRulerView.setDefaultValueAndAnimated(defaultValue: 50, animated: true) 52 | zeroRulerView.bgColor = UIColor.orange 53 | zeroRulerView.triangleColor = UIColor.blue 54 | zeroRulerView.delegate = self 55 | zeroRulerView.scrollByHand = true 56 | return zeroRulerView 57 | }() 58 | override func viewDidLoad() { 59 | super.viewDidLoad() 60 | // Do any additional setup after loading the view, typically from a nib. 61 | 62 | self.view.addSubview(lazyRulerView) 63 | self.view.addSubview(lazyTimeRullerView) 64 | self.view.addSubview(lazyNoneZeroRullerView) 65 | } 66 | 67 | override func didReceiveMemoryWarning() { 68 | super.didReceiveMemoryWarning() 69 | // Dispose of any resources that can be recreated. 70 | } 71 | 72 | 73 | } 74 | extension ViewController:DYScrollRulerDelegate { 75 | func dyScrollRulerViewValueChange(rulerView: DYScrollRulerView, value: Float) { 76 | print("滑动的值-------》"+"\(value)") 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /YKScrollRulerSwift.xcodeproj/xcuserdata/DanielYao.xcuserdatad/xcschemes/YKScrollRulerSwift.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /YKScrollRulerSwift/DYScorllRuler/DYScrollRulerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DYScrollRulerView.swift 3 | // YKScrollRulerSwift 4 | // 5 | // Created by Daniel Yao on 16/11/22. 6 | // Copyright © 2016年 Daniel Yao. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | fileprivate let TextRulerFont = UIFont.systemFont(ofSize: 11) 12 | fileprivate let RulerLineColor = UIColor.gray 13 | fileprivate let RulerGap = 12 14 | fileprivate let RulerLong = 40 15 | fileprivate let RulerShort = 30 16 | fileprivate let TriangleWidth = 16 17 | fileprivate let CollectionHeight = 70 18 | fileprivate let TextColorWhiteAlpha:CGFloat = 1.0 19 | 20 | fileprivate func alerts(vc:UIViewController,str:String){ 21 | let alert = UIAlertController.init(title: "提醒", message: str, preferredStyle: UIAlertControllerStyle.alert) 22 | let action:UIAlertAction = UIAlertAction.init(title: "OK", style: UIAlertActionStyle.default, handler: { (action) in 23 | 24 | }) 25 | alert.addAction(action) 26 | vc.present(alert, animated: true, completion: nil) 27 | } 28 | 29 | /***************DY************分************割************线***********/ 30 | 31 | class DYTriangleView: UIView { 32 | 33 | var triangleColor:UIColor? 34 | 35 | override func draw(_ rect: CGRect) { 36 | UIColor.clear.set() 37 | UIRectFill(self.bounds) 38 | 39 | let context = UIGraphicsGetCurrentContext() 40 | 41 | context!.beginPath() 42 | context!.move(to: CGPoint.init(x: 0, y: 0)) 43 | context!.addLine(to: CGPoint.init(x: TriangleWidth, y: 0)) 44 | context!.addLine(to: CGPoint.init(x: TriangleWidth/2, y: TriangleWidth/2)) 45 | context!.setLineCap(CGLineCap.butt) 46 | context!.setLineJoin(CGLineJoin.bevel) 47 | context!.closePath() 48 | 49 | triangleColor?.setFill() 50 | triangleColor?.setStroke() 51 | 52 | context!.drawPath(using: CGPathDrawingMode.fillStroke) 53 | } 54 | 55 | } 56 | 57 | /***************DY************分************割************线***********/ 58 | 59 | class DYRulerView: UIView { 60 | var minValue:Float = 0.0 61 | var maxValue:Float = 0.0 62 | var unit:String = "" 63 | var step:Float = 0.0 64 | var betweenNumber = 0 65 | override func draw(_ rect: CGRect) { 66 | let startX:CGFloat = 0 67 | let lineCenterX = CGFloat(RulerGap) 68 | let shortLineY = rect.size.height - CGFloat(RulerLong) 69 | let longLineY = rect.size.height - CGFloat(RulerShort) 70 | let topY:CGFloat = 0 71 | 72 | let context = UIGraphicsGetCurrentContext() 73 | context?.setLineWidth(1) 74 | context?.setLineCap(CGLineCap.butt) 75 | context?.setStrokeColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0) 76 | for i in 0...betweenNumber { 77 | print(i) 78 | context?.move(to: CGPoint.init(x: startX+lineCenterX*CGFloat(i), y: topY)) 79 | if i%betweenNumber == 0 { 80 | let num = Float(i)*step+minValue 81 | print(unit) 82 | var numStr = String(format: "%.f%@", num,unit) 83 | if num > 1000000 { 84 | numStr = String(format: "%f万%@", num/10000,unit) 85 | } 86 | print(i,step,minValue) 87 | let attribute:Dictionary = [NSAttributedStringKey.font:TextRulerFont,NSAttributedStringKey.foregroundColor:UIColor.init(white: TextColorWhiteAlpha, alpha: 1.0)] 88 | 89 | let width = numStr.boundingRect( 90 | with: CGSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude), 91 | options: NSStringDrawingOptions.usesLineFragmentOrigin, 92 | attributes: attribute,context: nil).size.width 93 | numStr.draw(in: CGRect.init(x: startX+lineCenterX*CGFloat(i)-width/2, y: longLineY+10, width: width, height: 14), withAttributes: attribute) 94 | context!.addLine(to: CGPoint.init(x: startX+lineCenterX*CGFloat(i), y: longLineY)) 95 | }else{ 96 | context!.addLine(to: CGPoint.init(x: startX+lineCenterX*CGFloat(i), y: shortLineY)) 97 | } 98 | context!.strokePath() 99 | 100 | } 101 | 102 | } 103 | } 104 | 105 | /***************DY************分************割************线***********/ 106 | 107 | class DYHeaderRulerView: UIView { 108 | 109 | var headerMinValue = 0 110 | var headerUnit = "" 111 | 112 | override func draw(_ rect: CGRect) { 113 | let longLineY = rect.size.height - CGFloat(RulerShort) 114 | let context = UIGraphicsGetCurrentContext() 115 | context?.setStrokeColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0) 116 | context?.setLineWidth(1.0) 117 | context?.setLineCap(CGLineCap.butt) 118 | 119 | context?.move(to: CGPoint.init(x: rect.size.width, y: 0)) 120 | var numStr:NSString = NSString(format: "%d%@", headerMinValue,headerUnit) 121 | if headerMinValue > 1000000 { 122 | numStr = NSString(format: "%f万%@", headerMinValue/10000,headerUnit) 123 | } 124 | let attribute:Dictionary = [NSAttributedStringKey.font:TextRulerFont,NSAttributedStringKey.foregroundColor:UIColor.init(white: TextColorWhiteAlpha, alpha: 1.0)] 125 | let width = numStr.boundingRect(with: CGSize.init(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude), options: NSStringDrawingOptions(rawValue: 0), attributes: attribute, context: nil).size.width 126 | numStr.draw(in: CGRect.init(x: rect.size.width-width/2, y: longLineY+10, width: width, height: 14), withAttributes: attribute) 127 | context?.addLine(to: CGPoint.init(x: rect.size.width, y: longLineY)) 128 | context?.strokePath() 129 | 130 | } 131 | } 132 | 133 | /***************DY************分************割************线***********/ 134 | 135 | class DYFooterRulerView: UIView { 136 | var footerMaxValue = 0 137 | var footerUnit = "" 138 | 139 | override func draw(_ rect: CGRect) { 140 | let longLineY = Int(rect.size.height) - RulerShort 141 | let context = UIGraphicsGetCurrentContext() 142 | context?.setStrokeColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0) 143 | context?.setLineWidth(1.0) 144 | context?.setLineCap(CGLineCap.butt) 145 | 146 | context?.move(to: CGPoint.init(x: 0, y: 0)) 147 | var numStr:NSString = NSString(format: "%d%@", footerMaxValue,footerUnit) 148 | if footerMaxValue > 1000000 { 149 | numStr = NSString(format: "%f万%@", footerMaxValue/10000,footerUnit) 150 | } 151 | let attribute:Dictionary = [NSAttributedStringKey.font:TextRulerFont,NSAttributedStringKey.foregroundColor:UIColor.init(white: TextColorWhiteAlpha, alpha: 1.0)] 152 | let width = numStr.boundingRect(with: CGSize.init(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude), options: NSStringDrawingOptions(rawValue: 0), attributes: attribute, context: nil).size.width 153 | numStr.draw(in: CGRect.init(x: 0-width/2, y: CGFloat(longLineY+10), width: width, height:CGFloat(14)), withAttributes: attribute) 154 | context?.addLine(to: CGPoint.init(x: 0, y: longLineY)) 155 | context?.strokePath() 156 | } 157 | } 158 | 159 | /***************DY************分************割************线***********/ 160 | 161 | protocol DYScrollRulerDelegate:NSObjectProtocol { 162 | func dyScrollRulerViewValueChange(rulerView:DYScrollRulerView,value:Float) 163 | } 164 | class DYScrollRulerView: UIView { 165 | 166 | /* 167 | // Only override draw() if you perform custom drawing. 168 | // An empty implementation adversely affects performance during animation. 169 | override func draw(_ rect: CGRect) { 170 | // Drawing code 171 | } 172 | */ 173 | weak var delegate:DYScrollRulerDelegate? 174 | 175 | var scrollByHand = true 176 | var triangleColor:UIColor? = nil 177 | var bgColor:UIColor? = nil 178 | var stepNum = 0//分多少个大区 179 | 180 | private var redLine:UIImageView? 181 | private var fileRealValue:Float = 0.0 182 | var rulerUnit:String = "" 183 | var minValue:Float = 0.0 184 | var maxValue:Float = 0.0 185 | var step:Float = 0.0 //间隔值,每两条相隔多少值 186 | var betweenNum:Int = 0 187 | 188 | var currentVC:UIViewController? 189 | 190 | 191 | 192 | class func rulerViewHeight() -> Int { 193 | return 40+20+CollectionHeight 194 | } 195 | 196 | init(frame: CGRect,tminValue:Float,tmaxValue:Float,tstep:Float,tunit:String,tNum:Int,viewcontroller:UIViewController) { 197 | super.init(frame: frame) 198 | minValue = tminValue 199 | maxValue = tmaxValue 200 | betweenNum = tNum 201 | step = tstep 202 | stepNum = Int((tmaxValue - tminValue)/step)/betweenNum 203 | rulerUnit = tunit 204 | bgColor = UIColor.white 205 | currentVC = viewcontroller 206 | 207 | triangleColor = UIColor.orange 208 | self.backgroundColor = UIColor.white 209 | 210 | lazyValueTF.frame = CGRect.init(x: self.bounds.size.width/2-60, y: 10, width: 80, height: 40) 211 | self.addSubview(self.lazyValueTF) 212 | 213 | lazyTriangle.frame = CGRect.init(x: self.bounds.size.width/2-0.5 - CGFloat(TriangleWidth)/2, y: lazyValueTF.frame.maxY, width: CGFloat(TriangleWidth), height: CGFloat(TriangleWidth)) 214 | lazyUnitLab.frame = CGRect.init(x: lazyValueTF.frame.maxX+10, y: lazyValueTF.frame.minY, width: 40, height: 40) 215 | lazyOKBtn.frame = CGRect.init(x: lazyUnitLab.frame.maxX+10, y: lazyValueTF.frame.minY+5, width: 40, height: 30) 216 | 217 | self.addSubview(self.lazyUnitLab) 218 | self.addSubview(self.lazyOKBtn) 219 | self.addSubview(self.lazyCollectionView) 220 | self.addSubview(self.lazyTriangle) 221 | 222 | self.lazyCollectionView.frame = CGRect.init(x: 0, y:self.lazyValueTF.frame.maxY, width: self.bounds.size.width, height: CGFloat(CollectionHeight)) 223 | self.lazyUnitLab.text = tunit 224 | } 225 | 226 | required init?(coder aDecoder: NSCoder) { 227 | fatalError("init(coder:) has not been implemented") 228 | } 229 | 230 | lazy var lazyValueTF: UITextField = {[unowned self] in 231 | let zyValueTF = UITextField() 232 | zyValueTF.isUserInteractionEnabled = true 233 | zyValueTF.defaultTextAttributes = [NSAttributedStringKey.font.rawValue:UIFont.systemFont(ofSize: 19)] 234 | zyValueTF.textAlignment = NSTextAlignment.right 235 | zyValueTF.delegate = self 236 | zyValueTF.keyboardType = UIKeyboardType.numbersAndPunctuation 237 | zyValueTF.returnKeyType = UIReturnKeyType.done 238 | 239 | return zyValueTF 240 | }() 241 | lazy var lazyOKBtn:UIButton = { 242 | let okBtn = UIButton.init(type: UIButtonType.custom) 243 | okBtn.setTitle("OK", for: UIControlState.normal) 244 | okBtn.setTitleColor(UIColor.init(white: 0.7, alpha: 1.0), for: UIControlState.highlighted) 245 | okBtn.setTitleColor(UIColor.white, for: UIControlState.normal) 246 | okBtn.addTarget(self, action: #selector(DYScrollRulerView.editDone), for: UIControlEvents.touchUpInside) 247 | okBtn.backgroundColor = UIColor.gray 248 | okBtn.layer.cornerRadius = 5.0 249 | 250 | return okBtn 251 | }() 252 | lazy var lazyUnitLab: UILabel = { 253 | let zyUnitLab = UILabel() 254 | zyUnitLab.textColor = UIColor.red 255 | 256 | return zyUnitLab 257 | }() 258 | lazy var lazyCollectionView: UICollectionView = {[unowned self]in 259 | 260 | let flowLayout = UICollectionViewFlowLayout() 261 | flowLayout.scrollDirection = UICollectionViewScrollDirection.horizontal 262 | flowLayout.sectionInset = UIEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0) 263 | 264 | let zyCollectionView:UICollectionView = UICollectionView.init(frame: CGRect.init(x: 0, y: 0, width: self.bounds.size.width, height: CGFloat(CollectionHeight)), collectionViewLayout: flowLayout) 265 | zyCollectionView.backgroundColor = UIColor.red 266 | zyCollectionView.bounces = true 267 | zyCollectionView.showsHorizontalScrollIndicator = false 268 | zyCollectionView.showsVerticalScrollIndicator = false 269 | zyCollectionView.delegate = self 270 | zyCollectionView.dataSource = self 271 | zyCollectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "headCell") 272 | zyCollectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "footerCell") 273 | zyCollectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "customeCell") 274 | 275 | return zyCollectionView 276 | }() 277 | lazy var lazyTriangle: DYTriangleView = { 278 | let triangleView = DYTriangleView() 279 | triangleView.backgroundColor = UIColor.clear 280 | triangleView.triangleColor = UIColor.blue 281 | return triangleView 282 | }() 283 | 284 | @objc fileprivate func didChangeCollectionValue() { 285 | let textFieldValue = Float(lazyValueTF.text!) 286 | if (textFieldValue!-minValue)>=0 { 287 | self.setRealValueAndAnimated(realValue: (textFieldValue!-minValue)/step, animated: true) 288 | } 289 | } 290 | 291 | @objc fileprivate func setRealValueAndAnimated(realValue:Float,animated:Bool){ 292 | fileRealValue = realValue 293 | lazyValueTF.text = String.init(format: "%.1f", fileRealValue*step+minValue) 294 | lazyCollectionView.setContentOffset(CGPoint.init(x: Int(realValue)*RulerGap, y: 0), animated: animated) 295 | } 296 | 297 | func setDefaultValueAndAnimated(defaultValue:Float,animated:Bool){ 298 | fileRealValue = defaultValue 299 | lazyValueTF.text = String.init(format: "%.1f", defaultValue) 300 | lazyCollectionView.setContentOffset(CGPoint.init(x: Int((defaultValue-minValue)/step) * RulerGap, y: 0), animated: animated) 301 | } 302 | 303 | @objc func editDone(){ 304 | 305 | 306 | let currentText:NSString = lazyValueTF.text! as NSString 307 | if !self.judgeTextsHasWord(texts: currentText as String){ 308 | alerts(vc: currentVC!, str: "请输入数字") 309 | return 310 | } 311 | lazyValueTF.resignFirstResponder() 312 | 313 | if currentText.floatValue > maxValue{ 314 | lazyValueTF.text = String.init(format: "%.1f", maxValue) 315 | self.perform(#selector(self.didChangeCollectionValue), with: nil, afterDelay: 0) 316 | }else if currentText.floatValue <= minValue || currentText.length == 0{ 317 | lazyValueTF.text = String.init(format: "%.1f", minValue) 318 | self.perform(#selector(self.didChangeCollectionValue), with: nil, afterDelay: 1) 319 | }else{ 320 | NSObject.cancelPreviousPerformRequests(withTarget: self) 321 | self.perform(#selector(self.didChangeCollectionValue), with: nil, afterDelay: 1) 322 | } 323 | 324 | } 325 | 326 | func judgeTextsHasWord(texts:String) -> Bool{ 327 | let scan:Scanner = Scanner.init(string: texts) 328 | var value:Float = 0.0 329 | return scan.scanFloat(&value) && scan.isAtEnd 330 | } 331 | } 332 | 333 | extension DYScrollRulerView:UICollectionViewDataSource{ 334 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 335 | return 2+stepNum 336 | } 337 | 338 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 339 | if indexPath.item == 0 { 340 | let cell:UICollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: "headCell", for: indexPath) 341 | var headerView:DYHeaderRulerView? = cell.contentView.viewWithTag(1000) as?DYHeaderRulerView 342 | 343 | if headerView == nil{ 344 | headerView = DYHeaderRulerView.init(frame: CGRect.init(x: 0, y: 0, width: Int(self.frame.size.width/2), height: CollectionHeight)) 345 | headerView!.backgroundColor = UIColor.clear 346 | headerView!.headerMinValue = Int(minValue) 347 | headerView!.headerUnit = rulerUnit 348 | headerView!.tag = 1000 349 | cell.contentView.addSubview(headerView!) 350 | } 351 | return cell 352 | }else if indexPath.item == stepNum+1 { 353 | let cell:UICollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: "footerCell", for: indexPath) 354 | var footerView:DYFooterRulerView? = cell.contentView.viewWithTag(1001) as? DYFooterRulerView 355 | if footerView == nil { 356 | footerView = DYFooterRulerView.init(frame: CGRect.init(x: 0, y: 0, width: Int(self.frame.size.width/2), height: CollectionHeight)) 357 | footerView!.backgroundColor = UIColor.clear 358 | footerView!.footerMaxValue = Int(maxValue) 359 | footerView!.footerUnit = rulerUnit 360 | footerView!.tag = 1001 361 | cell.contentView.addSubview(footerView!) 362 | } 363 | return cell 364 | }else{ 365 | let cell:UICollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: "customeCell", for: indexPath) 366 | var rulerView:DYRulerView? = cell.contentView.viewWithTag(1002) as? DYRulerView 367 | if rulerView == nil { 368 | rulerView = DYRulerView.init(frame: CGRect.init(x: 0, y: 0, width: RulerGap*betweenNum, height: CollectionHeight)) 369 | rulerView!.backgroundColor = UIColor.clear 370 | rulerView!.step = step 371 | rulerView!.unit = rulerUnit 372 | rulerView!.tag = 1002 373 | rulerView!.betweenNumber = betweenNum; 374 | cell.contentView.addSubview(rulerView!) 375 | } 376 | 377 | if indexPath.item >= 8 && indexPath.item <= 12{ 378 | rulerView?.backgroundColor = UIColor.green 379 | }else if(indexPath.item >= 13 && indexPath.item <= 18){ 380 | rulerView?.backgroundColor = UIColor.red 381 | }else{ 382 | rulerView?.backgroundColor = UIColor.gray 383 | } 384 | 385 | rulerView!.minValue = step*Float((indexPath.item-1))*Float(betweenNum)+minValue 386 | rulerView!.maxValue = step*Float(indexPath.item)*Float(betweenNum) 387 | rulerView!.setNeedsDisplay() 388 | 389 | return cell 390 | } 391 | 392 | } 393 | 394 | 395 | } 396 | extension DYScrollRulerView:UICollectionViewDelegate{ 397 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 398 | } 399 | 400 | func scrollViewDidScroll(_ scrollView: UIScrollView) { 401 | let value = Int(scrollView.contentOffset.x)/RulerGap 402 | let totalValue = Float(value)*step+minValue 403 | if scrollByHand { 404 | if totalValue>=maxValue { 405 | lazyValueTF.text = String.init(format: "%.1f", maxValue) 406 | }else if totalValue <= minValue { 407 | lazyValueTF.text = String.init(format: "%.1f", minValue) 408 | }else{ 409 | lazyValueTF.text = String.init(format: "%.1f", Float(value)*step+minValue) 410 | } 411 | } 412 | delegate?.dyScrollRulerViewValueChange(rulerView: self, value: totalValue) 413 | } 414 | func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { 415 | if !decelerate { 416 | self.setRealValueAndAnimated(realValue: Float(scrollView.contentOffset.x)/Float(RulerGap), animated: true) 417 | } 418 | } 419 | func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { 420 | self.setRealValueAndAnimated(realValue: Float(scrollView.contentOffset.x)/Float(RulerGap), animated: true) 421 | } 422 | } 423 | extension DYScrollRulerView:UICollectionViewDelegateFlowLayout{ 424 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { 425 | if indexPath.item == 0 || indexPath.item == stepNum + 1 { 426 | return CGSize(width: Int(self.frame.size.width/2), height: CollectionHeight) 427 | } 428 | return CGSize(width: RulerGap*betweenNum, height: CollectionHeight) 429 | } 430 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { 431 | return UIEdgeInsetsMake(0, 0, 0, 0) 432 | } 433 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { 434 | return 0 435 | } 436 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { 437 | return 0 438 | } 439 | } 440 | extension DYScrollRulerView:UITextFieldDelegate{ 441 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 442 | self.editDone() 443 | return true 444 | } 445 | } 446 | 447 | 448 | -------------------------------------------------------------------------------- /YKScrollRulerSwift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6D1677BA1DE467710017ED30 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D1677B91DE467710017ED30 /* AppDelegate.swift */; }; 11 | 6D1677BC1DE467710017ED30 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D1677BB1DE467710017ED30 /* ViewController.swift */; }; 12 | 6D1677BF1DE467710017ED30 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D1677BD1DE467710017ED30 /* Main.storyboard */; }; 13 | 6D1677C11DE467710017ED30 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D1677C01DE467710017ED30 /* Assets.xcassets */; }; 14 | 6D1677C41DE467710017ED30 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D1677C21DE467710017ED30 /* LaunchScreen.storyboard */; }; 15 | 6D1677CF1DE467710017ED30 /* YKScrollRulerSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D1677CE1DE467710017ED30 /* YKScrollRulerSwiftTests.swift */; }; 16 | 6D1677DA1DE467710017ED30 /* YKScrollRulerSwiftUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D1677D91DE467710017ED30 /* YKScrollRulerSwiftUITests.swift */; }; 17 | 6D1677EC1DE46C710017ED30 /* DYScrollRulerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D1677EB1DE46C710017ED30 /* DYScrollRulerView.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 6D1677CB1DE467710017ED30 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 6D1677AE1DE467710017ED30 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 6D1677B51DE467710017ED30; 26 | remoteInfo = YKScrollRulerSwift; 27 | }; 28 | 6D1677D61DE467710017ED30 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 6D1677AE1DE467710017ED30 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 6D1677B51DE467710017ED30; 33 | remoteInfo = YKScrollRulerSwift; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 6D1677B61DE467710017ED30 /* YKScrollRulerSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YKScrollRulerSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 6D1677B91DE467710017ED30 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 6D1677BB1DE467710017ED30 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 41 | 6D1677BE1DE467710017ED30 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 6D1677C01DE467710017ED30 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 6D1677C31DE467710017ED30 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 6D1677C51DE467710017ED30 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | 6D1677CA1DE467710017ED30 /* YKScrollRulerSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YKScrollRulerSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 6D1677CE1DE467710017ED30 /* YKScrollRulerSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YKScrollRulerSwiftTests.swift; sourceTree = ""; }; 47 | 6D1677D01DE467710017ED30 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 6D1677D51DE467710017ED30 /* YKScrollRulerSwiftUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YKScrollRulerSwiftUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 6D1677D91DE467710017ED30 /* YKScrollRulerSwiftUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YKScrollRulerSwiftUITests.swift; sourceTree = ""; }; 50 | 6D1677DB1DE467710017ED30 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 6D1677EB1DE46C710017ED30 /* DYScrollRulerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DYScrollRulerView.swift; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 6D1677B31DE467710017ED30 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | 6D1677C71DE467710017ED30 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | 6D1677D21DE467710017ED30 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | 6D1677AD1DE467710017ED30 = { 80 | isa = PBXGroup; 81 | children = ( 82 | 6D1677B81DE467710017ED30 /* YKScrollRulerSwift */, 83 | 6D1677CD1DE467710017ED30 /* YKScrollRulerSwiftTests */, 84 | 6D1677D81DE467710017ED30 /* YKScrollRulerSwiftUITests */, 85 | 6D1677B71DE467710017ED30 /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | 6D1677B71DE467710017ED30 /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 6D1677B61DE467710017ED30 /* YKScrollRulerSwift.app */, 93 | 6D1677CA1DE467710017ED30 /* YKScrollRulerSwiftTests.xctest */, 94 | 6D1677D51DE467710017ED30 /* YKScrollRulerSwiftUITests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 6D1677B81DE467710017ED30 /* YKScrollRulerSwift */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 6D1677B91DE467710017ED30 /* AppDelegate.swift */, 103 | 6D1677BB1DE467710017ED30 /* ViewController.swift */, 104 | 6D1677E81DE46C0A0017ED30 /* DYScorllRuler */, 105 | 6D1677BD1DE467710017ED30 /* Main.storyboard */, 106 | 6D1677C01DE467710017ED30 /* Assets.xcassets */, 107 | 6D1677C21DE467710017ED30 /* LaunchScreen.storyboard */, 108 | 6D1677C51DE467710017ED30 /* Info.plist */, 109 | ); 110 | path = YKScrollRulerSwift; 111 | sourceTree = ""; 112 | }; 113 | 6D1677CD1DE467710017ED30 /* YKScrollRulerSwiftTests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 6D1677CE1DE467710017ED30 /* YKScrollRulerSwiftTests.swift */, 117 | 6D1677D01DE467710017ED30 /* Info.plist */, 118 | ); 119 | path = YKScrollRulerSwiftTests; 120 | sourceTree = ""; 121 | }; 122 | 6D1677D81DE467710017ED30 /* YKScrollRulerSwiftUITests */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 6D1677D91DE467710017ED30 /* YKScrollRulerSwiftUITests.swift */, 126 | 6D1677DB1DE467710017ED30 /* Info.plist */, 127 | ); 128 | path = YKScrollRulerSwiftUITests; 129 | sourceTree = ""; 130 | }; 131 | 6D1677E81DE46C0A0017ED30 /* DYScorllRuler */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 6D1677EB1DE46C710017ED30 /* DYScrollRulerView.swift */, 135 | ); 136 | path = DYScorllRuler; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 6D1677B51DE467710017ED30 /* YKScrollRulerSwift */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 6D1677DE1DE467710017ED30 /* Build configuration list for PBXNativeTarget "YKScrollRulerSwift" */; 145 | buildPhases = ( 146 | 6D1677B21DE467710017ED30 /* Sources */, 147 | 6D1677B31DE467710017ED30 /* Frameworks */, 148 | 6D1677B41DE467710017ED30 /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | ); 154 | name = YKScrollRulerSwift; 155 | productName = YKScrollRulerSwift; 156 | productReference = 6D1677B61DE467710017ED30 /* YKScrollRulerSwift.app */; 157 | productType = "com.apple.product-type.application"; 158 | }; 159 | 6D1677C91DE467710017ED30 /* YKScrollRulerSwiftTests */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 6D1677E11DE467710017ED30 /* Build configuration list for PBXNativeTarget "YKScrollRulerSwiftTests" */; 162 | buildPhases = ( 163 | 6D1677C61DE467710017ED30 /* Sources */, 164 | 6D1677C71DE467710017ED30 /* Frameworks */, 165 | 6D1677C81DE467710017ED30 /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | 6D1677CC1DE467710017ED30 /* PBXTargetDependency */, 171 | ); 172 | name = YKScrollRulerSwiftTests; 173 | productName = YKScrollRulerSwiftTests; 174 | productReference = 6D1677CA1DE467710017ED30 /* YKScrollRulerSwiftTests.xctest */; 175 | productType = "com.apple.product-type.bundle.unit-test"; 176 | }; 177 | 6D1677D41DE467710017ED30 /* YKScrollRulerSwiftUITests */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 6D1677E41DE467710017ED30 /* Build configuration list for PBXNativeTarget "YKScrollRulerSwiftUITests" */; 180 | buildPhases = ( 181 | 6D1677D11DE467710017ED30 /* Sources */, 182 | 6D1677D21DE467710017ED30 /* Frameworks */, 183 | 6D1677D31DE467710017ED30 /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | 6D1677D71DE467710017ED30 /* PBXTargetDependency */, 189 | ); 190 | name = YKScrollRulerSwiftUITests; 191 | productName = YKScrollRulerSwiftUITests; 192 | productReference = 6D1677D51DE467710017ED30 /* YKScrollRulerSwiftUITests.xctest */; 193 | productType = "com.apple.product-type.bundle.ui-testing"; 194 | }; 195 | /* End PBXNativeTarget section */ 196 | 197 | /* Begin PBXProject section */ 198 | 6D1677AE1DE467710017ED30 /* Project object */ = { 199 | isa = PBXProject; 200 | attributes = { 201 | LastSwiftUpdateCheck = 0810; 202 | LastUpgradeCheck = 0900; 203 | ORGANIZATIONNAME = "Daniel Yao"; 204 | TargetAttributes = { 205 | 6D1677B51DE467710017ED30 = { 206 | CreatedOnToolsVersion = 8.1; 207 | DevelopmentTeam = C79HGK3MHM; 208 | LastSwiftMigration = 0900; 209 | ProvisioningStyle = Automatic; 210 | }; 211 | 6D1677C91DE467710017ED30 = { 212 | CreatedOnToolsVersion = 8.1; 213 | DevelopmentTeam = C79HGK3MHM; 214 | LastSwiftMigration = 0900; 215 | ProvisioningStyle = Automatic; 216 | TestTargetID = 6D1677B51DE467710017ED30; 217 | }; 218 | 6D1677D41DE467710017ED30 = { 219 | CreatedOnToolsVersion = 8.1; 220 | DevelopmentTeam = C79HGK3MHM; 221 | LastSwiftMigration = 0900; 222 | ProvisioningStyle = Automatic; 223 | TestTargetID = 6D1677B51DE467710017ED30; 224 | }; 225 | }; 226 | }; 227 | buildConfigurationList = 6D1677B11DE467710017ED30 /* Build configuration list for PBXProject "YKScrollRulerSwift" */; 228 | compatibilityVersion = "Xcode 3.2"; 229 | developmentRegion = English; 230 | hasScannedForEncodings = 0; 231 | knownRegions = ( 232 | en, 233 | Base, 234 | ); 235 | mainGroup = 6D1677AD1DE467710017ED30; 236 | productRefGroup = 6D1677B71DE467710017ED30 /* Products */; 237 | projectDirPath = ""; 238 | projectRoot = ""; 239 | targets = ( 240 | 6D1677B51DE467710017ED30 /* YKScrollRulerSwift */, 241 | 6D1677C91DE467710017ED30 /* YKScrollRulerSwiftTests */, 242 | 6D1677D41DE467710017ED30 /* YKScrollRulerSwiftUITests */, 243 | ); 244 | }; 245 | /* End PBXProject section */ 246 | 247 | /* Begin PBXResourcesBuildPhase section */ 248 | 6D1677B41DE467710017ED30 /* Resources */ = { 249 | isa = PBXResourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | 6D1677C41DE467710017ED30 /* LaunchScreen.storyboard in Resources */, 253 | 6D1677C11DE467710017ED30 /* Assets.xcassets in Resources */, 254 | 6D1677BF1DE467710017ED30 /* Main.storyboard in Resources */, 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | 6D1677C81DE467710017ED30 /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | 6D1677D31DE467710017ED30 /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | /* End PBXResourcesBuildPhase section */ 273 | 274 | /* Begin PBXSourcesBuildPhase section */ 275 | 6D1677B21DE467710017ED30 /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 6D1677BC1DE467710017ED30 /* ViewController.swift in Sources */, 280 | 6D1677EC1DE46C710017ED30 /* DYScrollRulerView.swift in Sources */, 281 | 6D1677BA1DE467710017ED30 /* AppDelegate.swift in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | 6D1677C61DE467710017ED30 /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 6D1677CF1DE467710017ED30 /* YKScrollRulerSwiftTests.swift in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | 6D1677D11DE467710017ED30 /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | 6D1677DA1DE467710017ED30 /* YKScrollRulerSwiftUITests.swift in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXSourcesBuildPhase section */ 302 | 303 | /* Begin PBXTargetDependency section */ 304 | 6D1677CC1DE467710017ED30 /* PBXTargetDependency */ = { 305 | isa = PBXTargetDependency; 306 | target = 6D1677B51DE467710017ED30 /* YKScrollRulerSwift */; 307 | targetProxy = 6D1677CB1DE467710017ED30 /* PBXContainerItemProxy */; 308 | }; 309 | 6D1677D71DE467710017ED30 /* PBXTargetDependency */ = { 310 | isa = PBXTargetDependency; 311 | target = 6D1677B51DE467710017ED30 /* YKScrollRulerSwift */; 312 | targetProxy = 6D1677D61DE467710017ED30 /* PBXContainerItemProxy */; 313 | }; 314 | /* End PBXTargetDependency section */ 315 | 316 | /* Begin PBXVariantGroup section */ 317 | 6D1677BD1DE467710017ED30 /* Main.storyboard */ = { 318 | isa = PBXVariantGroup; 319 | children = ( 320 | 6D1677BE1DE467710017ED30 /* Base */, 321 | ); 322 | name = Main.storyboard; 323 | sourceTree = ""; 324 | }; 325 | 6D1677C21DE467710017ED30 /* LaunchScreen.storyboard */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | 6D1677C31DE467710017ED30 /* Base */, 329 | ); 330 | name = LaunchScreen.storyboard; 331 | sourceTree = ""; 332 | }; 333 | /* End PBXVariantGroup section */ 334 | 335 | /* Begin XCBuildConfiguration section */ 336 | 6D1677DC1DE467710017ED30 /* Debug */ = { 337 | isa = XCBuildConfiguration; 338 | buildSettings = { 339 | ALWAYS_SEARCH_USER_PATHS = NO; 340 | CLANG_ANALYZER_NONNULL = YES; 341 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 342 | CLANG_CXX_LIBRARY = "libc++"; 343 | CLANG_ENABLE_MODULES = YES; 344 | CLANG_ENABLE_OBJC_ARC = YES; 345 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 346 | CLANG_WARN_BOOL_CONVERSION = YES; 347 | CLANG_WARN_COMMA = YES; 348 | CLANG_WARN_CONSTANT_CONVERSION = YES; 349 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 350 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 351 | CLANG_WARN_EMPTY_BODY = YES; 352 | CLANG_WARN_ENUM_CONVERSION = YES; 353 | CLANG_WARN_INFINITE_RECURSION = YES; 354 | CLANG_WARN_INT_CONVERSION = YES; 355 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 356 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 359 | CLANG_WARN_STRICT_PROTOTYPES = YES; 360 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 361 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 362 | CLANG_WARN_UNREACHABLE_CODE = YES; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 365 | COPY_PHASE_STRIP = NO; 366 | DEBUG_INFORMATION_FORMAT = dwarf; 367 | ENABLE_STRICT_OBJC_MSGSEND = YES; 368 | ENABLE_TESTABILITY = YES; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_DYNAMIC_NO_PIC = NO; 371 | GCC_NO_COMMON_BLOCKS = YES; 372 | GCC_OPTIMIZATION_LEVEL = 0; 373 | GCC_PREPROCESSOR_DEFINITIONS = ( 374 | "DEBUG=1", 375 | "$(inherited)", 376 | ); 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 384 | MTL_ENABLE_DEBUG_INFO = YES; 385 | ONLY_ACTIVE_ARCH = YES; 386 | SDKROOT = iphoneos; 387 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 388 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 389 | TARGETED_DEVICE_FAMILY = "1,2"; 390 | }; 391 | name = Debug; 392 | }; 393 | 6D1677DD1DE467710017ED30 /* Release */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ALWAYS_SEARCH_USER_PATHS = NO; 397 | CLANG_ANALYZER_NONNULL = YES; 398 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 399 | CLANG_CXX_LIBRARY = "libc++"; 400 | CLANG_ENABLE_MODULES = YES; 401 | CLANG_ENABLE_OBJC_ARC = YES; 402 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 403 | CLANG_WARN_BOOL_CONVERSION = YES; 404 | CLANG_WARN_COMMA = YES; 405 | CLANG_WARN_CONSTANT_CONVERSION = YES; 406 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 407 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 408 | CLANG_WARN_EMPTY_BODY = YES; 409 | CLANG_WARN_ENUM_CONVERSION = YES; 410 | CLANG_WARN_INFINITE_RECURSION = YES; 411 | CLANG_WARN_INT_CONVERSION = YES; 412 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 413 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 414 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 415 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 416 | CLANG_WARN_STRICT_PROTOTYPES = YES; 417 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 418 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 419 | CLANG_WARN_UNREACHABLE_CODE = YES; 420 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 421 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 422 | COPY_PHASE_STRIP = NO; 423 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 424 | ENABLE_NS_ASSERTIONS = NO; 425 | ENABLE_STRICT_OBJC_MSGSEND = YES; 426 | GCC_C_LANGUAGE_STANDARD = gnu99; 427 | GCC_NO_COMMON_BLOCKS = YES; 428 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 429 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 430 | GCC_WARN_UNDECLARED_SELECTOR = YES; 431 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 432 | GCC_WARN_UNUSED_FUNCTION = YES; 433 | GCC_WARN_UNUSED_VARIABLE = YES; 434 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 435 | MTL_ENABLE_DEBUG_INFO = NO; 436 | SDKROOT = iphoneos; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 438 | TARGETED_DEVICE_FAMILY = "1,2"; 439 | VALIDATE_PRODUCT = YES; 440 | }; 441 | name = Release; 442 | }; 443 | 6D1677DF1DE467710017ED30 /* Debug */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 447 | DEVELOPMENT_TEAM = C79HGK3MHM; 448 | INFOPLIST_FILE = YKScrollRulerSwift/Info.plist; 449 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 450 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.YKScrollRulerSwift; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 453 | SWIFT_VERSION = 4.0; 454 | }; 455 | name = Debug; 456 | }; 457 | 6D1677E01DE467710017ED30 /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 461 | DEVELOPMENT_TEAM = C79HGK3MHM; 462 | INFOPLIST_FILE = YKScrollRulerSwift/Info.plist; 463 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 464 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.YKScrollRulerSwift; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 467 | SWIFT_VERSION = 4.0; 468 | }; 469 | name = Release; 470 | }; 471 | 6D1677E21DE467710017ED30 /* Debug */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 475 | BUNDLE_LOADER = "$(TEST_HOST)"; 476 | DEVELOPMENT_TEAM = C79HGK3MHM; 477 | INFOPLIST_FILE = YKScrollRulerSwiftTests/Info.plist; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 479 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.YKScrollRulerSwiftTests; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 482 | SWIFT_VERSION = 4.0; 483 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YKScrollRulerSwift.app/YKScrollRulerSwift"; 484 | }; 485 | name = Debug; 486 | }; 487 | 6D1677E31DE467710017ED30 /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 491 | BUNDLE_LOADER = "$(TEST_HOST)"; 492 | DEVELOPMENT_TEAM = C79HGK3MHM; 493 | INFOPLIST_FILE = YKScrollRulerSwiftTests/Info.plist; 494 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 495 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.YKScrollRulerSwiftTests; 496 | PRODUCT_NAME = "$(TARGET_NAME)"; 497 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 498 | SWIFT_VERSION = 4.0; 499 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YKScrollRulerSwift.app/YKScrollRulerSwift"; 500 | }; 501 | name = Release; 502 | }; 503 | 6D1677E51DE467710017ED30 /* Debug */ = { 504 | isa = XCBuildConfiguration; 505 | buildSettings = { 506 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 507 | DEVELOPMENT_TEAM = C79HGK3MHM; 508 | INFOPLIST_FILE = YKScrollRulerSwiftUITests/Info.plist; 509 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 510 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.YKScrollRulerSwiftUITests; 511 | PRODUCT_NAME = "$(TARGET_NAME)"; 512 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 513 | SWIFT_VERSION = 4.0; 514 | TEST_TARGET_NAME = YKScrollRulerSwift; 515 | }; 516 | name = Debug; 517 | }; 518 | 6D1677E61DE467710017ED30 /* Release */ = { 519 | isa = XCBuildConfiguration; 520 | buildSettings = { 521 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 522 | DEVELOPMENT_TEAM = C79HGK3MHM; 523 | INFOPLIST_FILE = YKScrollRulerSwiftUITests/Info.plist; 524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 525 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.YKScrollRulerSwiftUITests; 526 | PRODUCT_NAME = "$(TARGET_NAME)"; 527 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 528 | SWIFT_VERSION = 4.0; 529 | TEST_TARGET_NAME = YKScrollRulerSwift; 530 | }; 531 | name = Release; 532 | }; 533 | /* End XCBuildConfiguration section */ 534 | 535 | /* Begin XCConfigurationList section */ 536 | 6D1677B11DE467710017ED30 /* Build configuration list for PBXProject "YKScrollRulerSwift" */ = { 537 | isa = XCConfigurationList; 538 | buildConfigurations = ( 539 | 6D1677DC1DE467710017ED30 /* Debug */, 540 | 6D1677DD1DE467710017ED30 /* Release */, 541 | ); 542 | defaultConfigurationIsVisible = 0; 543 | defaultConfigurationName = Release; 544 | }; 545 | 6D1677DE1DE467710017ED30 /* Build configuration list for PBXNativeTarget "YKScrollRulerSwift" */ = { 546 | isa = XCConfigurationList; 547 | buildConfigurations = ( 548 | 6D1677DF1DE467710017ED30 /* Debug */, 549 | 6D1677E01DE467710017ED30 /* Release */, 550 | ); 551 | defaultConfigurationIsVisible = 0; 552 | defaultConfigurationName = Release; 553 | }; 554 | 6D1677E11DE467710017ED30 /* Build configuration list for PBXNativeTarget "YKScrollRulerSwiftTests" */ = { 555 | isa = XCConfigurationList; 556 | buildConfigurations = ( 557 | 6D1677E21DE467710017ED30 /* Debug */, 558 | 6D1677E31DE467710017ED30 /* Release */, 559 | ); 560 | defaultConfigurationIsVisible = 0; 561 | defaultConfigurationName = Release; 562 | }; 563 | 6D1677E41DE467710017ED30 /* Build configuration list for PBXNativeTarget "YKScrollRulerSwiftUITests" */ = { 564 | isa = XCConfigurationList; 565 | buildConfigurations = ( 566 | 6D1677E51DE467710017ED30 /* Debug */, 567 | 6D1677E61DE467710017ED30 /* Release */, 568 | ); 569 | defaultConfigurationIsVisible = 0; 570 | defaultConfigurationName = Release; 571 | }; 572 | /* End XCConfigurationList section */ 573 | }; 574 | rootObject = 6D1677AE1DE467710017ED30 /* Project object */; 575 | } 576 | --------------------------------------------------------------------------------