├── Screenshots ├── SS1.png ├── SS2.png └── SHSliderSwitch.png ├── SliderSwitchSample ├── SliderSwitchSample │ ├── Assets.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── ViewController.swift │ ├── Info.plist │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ └── SHSliderSwitch │ │ └── SHSliderSwitch.swift └── SliderSwitchSample.xcodeproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ └── focaloidtechnologies.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ ├── xcuserdata │ └── focaloidtechnologies.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist │ └── project.pbxproj ├── SHSliderSwitch.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ └── focaloidtechnologies.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcuserdata │ └── focaloidtechnologies.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── project.pbxproj ├── SHSliderSwitch ├── SHSliderSwitch.h ├── Info.plist └── SHSliderSwitch.swift ├── SHSliderSwitch.podspec ├── LICENSE ├── .gitignore └── README.md /Screenshots/SS1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamshezad/SHSliderSwitch/HEAD/Screenshots/SS1.png -------------------------------------------------------------------------------- /Screenshots/SS2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamshezad/SHSliderSwitch/HEAD/Screenshots/SS2.png -------------------------------------------------------------------------------- /Screenshots/SHSliderSwitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamshezad/SHSliderSwitch/HEAD/Screenshots/SHSliderSwitch.png -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SHSliderSwitch.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SHSliderSwitch.xcodeproj/project.xcworkspace/xcuserdata/focaloidtechnologies.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamshezad/SHSliderSwitch/HEAD/SHSliderSwitch.xcodeproj/project.xcworkspace/xcuserdata/focaloidtechnologies.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample.xcodeproj/project.xcworkspace/xcuserdata/focaloidtechnologies.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamshezad/SHSliderSwitch/HEAD/SliderSwitchSample/SliderSwitchSample.xcodeproj/project.xcworkspace/xcuserdata/focaloidtechnologies.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SHSliderSwitch.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SHSliderSwitch.xcodeproj/xcuserdata/focaloidtechnologies.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SHSliderSwitch.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample.xcodeproj/xcuserdata/focaloidtechnologies.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SliderSwitchSample.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SHSliderSwitch/SHSliderSwitch.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHSliderSwitch.h 3 | // SHSliderSwitch 4 | // 5 | // Created by Focaloid Technologies on 04/02/19. 6 | // Copyright © 2019 iamShezzad. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for SHSliderSwitch. 12 | FOUNDATION_EXPORT double SHSliderSwitchVersionNumber; 13 | 14 | //! Project version string for SHSliderSwitch. 15 | FOUNDATION_EXPORT const unsigned char SHSliderSwitchVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /SHSliderSwitch.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SHSliderSwitch" 3 | s.version = "1.0" 4 | s.summary = "A framework that implements a slider switch." 5 | s.description = "SHSliderSwitch is a simple lightweight library to implement an animated slider switch." 6 | 7 | s.homepage = "https://github.com/iamshezad/SHSliderSwitch" 8 | 9 | s.license = { :type => 'MIT', :file => 'LICENSE' } 10 | 11 | s.author = { "iamShezad" => "shezadahamed95@gmail.com" } 12 | 13 | s.source = { :git => "https://github.com/iamshezad/SHSliderSwitch.git", :tag => "1.0" } 14 | 15 | s.source_files = "SHSliderSwitch/*.{swift,h,m}" 16 | 17 | s.ios.deployment_target = "11.0" 18 | 19 | end 20 | -------------------------------------------------------------------------------- /SHSliderSwitch/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SliderSwitchSample 4 | // 5 | // Created by Focaloid Technologies on 05/02/19. 6 | // Copyright © 2019 iamShezad. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | setupSliderSwitch() 16 | } 17 | 18 | func setupSliderSwitch(){ 19 | let sliderFrame = CGRect(x: ((view.bounds.width/2)-75), y: view.bounds.height/2, width: 150, height: 40) 20 | let sliderSwitch = SHSliderSwitch(frame:sliderFrame) 21 | sliderSwitch.backgroundColor = UIColor.darkGray 22 | sliderSwitch.addTarget(self, action: #selector(ViewController.sliderValueChanged), for: .valueChanged) 23 | view.addSubview(sliderSwitch) 24 | } 25 | 26 | 27 | @objc func sliderValueChanged(sliderSwitch: SHSliderSwitch) { 28 | print("\(sliderSwitch.value) \n") 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Shezad Ahamed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample/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 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SliderSwitchSample 4 | // 5 | // Created by Focaloid Technologies on 05/02/19. 6 | // Copyright © 2019 iamShezad. 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 | 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SHSliderSwitch 2 | SHSliderSwitch is a simple lightweight library to implement an animated slider switch. 3 | 4 | [![Swift 4.0](https://img.shields.io/badge/Swift-4-orange.svg?style=flat)](https://developer.apple.com/swift/) 5 | [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) 6 | [![Platform](https://img.shields.io/badge/platform-ios-blue.svg?style=flat)]() 7 | 8 | 9 | 10 | ## Installation 11 | Just drag and drop the SHSliderSWitch.swift file from SHSliderSWitch folder to your project. 12 | #### Cocoapods 13 | ```swift 14 | pod 'SHSliderSwitch' 15 | 16 | ``` 17 | 18 | ## Usage 19 | 20 | 1. Just drag and drop an view in storyboard and set view class to SHSliderSWitch. 21 | 22 | 23 | 24 | 2. How to configure: 25 | 26 | -- can configure using IBInspectable. 27 | 28 | 29 | 30 | -- configure manually. 31 | ```swift 32 | //Current value of the switch. Defaults to 0. 33 | sliderSwitch.value = 0.0 34 | 35 | /// Minimum value. Must be less than maximumValue. Defaults to 0. 36 | sliderSwitch.minimumValue = 0.0 37 | 38 | /// Maximum value. Must be more than minimumValue. Defaults to 100. 39 | sliderSwitch.maximumValue = 100.0 40 | 41 | /// Increment value in switch. Defaults to 1. 42 | sliderSwitch.stepValue = 1 43 | 44 | /// Text color of the circular label. Defaults to white. 45 | sliderSwitch.labelTextColor = UIColor.white 46 | 47 | /// Background color of the circular label. Defaults to lighter white. 48 | sliderSwitch.labelBackgroundColor = UIColor.blue 49 | 50 | /// Font of the circular label. Defaults to Futura-Medium, 14.0 points in size. 51 | sliderSwitch.labelFont = UIFont(name: "Futura-Medium", size: 14.0) 52 | 53 | /// Border width of the switch and circular label's layer. Defaults to 0.0. 54 | sliderSwitch.borderColor = 0.0 55 | 56 | /// Color of the border of the switch and circular label's layer. Defaults to clear color. 57 | sliderSwitch.borderColor = UIColor.clear 58 | 59 | /// Font of the buttons. Defaults to Futura-Bold, 20.0 points in size. 60 | sliderSwitch.buttonsFont = UIFont(name: "Futura-Bold", size: 20.0) 61 | 62 | /// Text color of the buttons. Defaults to white. 63 | sliderSwitch.buttonsTextColor = UIColor.white 64 | 65 | 66 | ``` 67 | 68 | ## Requirements 69 | 70 | * iOS 11.0+ 71 | 72 | ## Example 73 | 74 | Download the Sample project. 75 | 76 | ## Contact 77 | 78 | Mail me @: shezadahamed95@gmail.com 79 | 80 | ## Acknowledge 81 | 82 | Inspired by [GMStepper](https://github.com/gmertk/GMStepper) 83 | 84 | ## License 85 | 86 | SHSliderSwitch is available under the MIT license. See the LICENSE file for more info. 87 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample/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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample/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 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /SHSliderSwitch/SHSliderSwitch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SHSliderSwitch.swift 3 | // SHSliderSwitch 4 | // 5 | // Created on 04/02/19. 6 | // Copyright © 2019 iamShezad. All rights reserved. 7 | // 8 | 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | @IBDesignable public class SHSliderSwitch: UIControl{ 14 | 15 | /// Current value of the switch. Defaults to 0. 16 | @objc @IBInspectable public var value: Double = 0 { 17 | didSet { 18 | value = min(maximumValue, max(minimumValue, value)) 19 | 20 | label.text = "\(formattedValue ?? "")" 21 | 22 | if oldValue != value { 23 | sendActions(for: .valueChanged) 24 | } 25 | } 26 | } 27 | 28 | private var formattedValue: String? { 29 | return formatter.string(from: NSNumber(value: value)) 30 | } 31 | 32 | 33 | /// Minimum value. Must be less than maximumValue. Defaults to 0. 34 | @objc @IBInspectable public var minimumValue: Double = 0 { 35 | didSet { 36 | value = min(maximumValue, max(minimumValue, value)) 37 | } 38 | } 39 | 40 | /// Maximum value. Must be more than minimumValue. Defaults to 100. 41 | @objc @IBInspectable public var maximumValue: Double = 100 { 42 | didSet { 43 | value = min(maximumValue, max(minimumValue, value)) 44 | } 45 | } 46 | 47 | /// Increment value in switch. Defaults to 1. 48 | @objc @IBInspectable public var stepValue: Double = 1 { 49 | didSet { 50 | setupNumberFormatter() 51 | } 52 | } 53 | 54 | 55 | /// Text color of the circular label. Defaults to white. 56 | @objc @IBInspectable public var labelTextColor: UIColor = UIColor.black { 57 | didSet { 58 | label.textColor = labelTextColor 59 | } 60 | } 61 | 62 | /// Background color of the circular label. Defaults to lighter blue. 63 | @objc @IBInspectable public var labelBackgroundColor: UIColor = UIColor.white { 64 | didSet { 65 | label.backgroundColor = labelBackgroundColor 66 | } 67 | } 68 | 69 | /// Font of the circular label. Defaults to Futura-Medium, 14.0 points in size. 70 | @objc public var labelFont = UIFont(name: "Futura-Medium", size: 14.0)! { 71 | didSet { 72 | label.font = labelFont 73 | } 74 | } 75 | 76 | /// Border width of the switch and circular label's layer. Defaults to 0.0. 77 | @objc @IBInspectable public var borderWidth: CGFloat = 0.0 { 78 | didSet { 79 | layer.borderWidth = borderWidth 80 | label.layer.borderWidth = borderWidth 81 | } 82 | } 83 | 84 | /// Color of the border of the switch and circular label's layer. Defaults to clear color. 85 | @objc @IBInspectable public var borderColor: UIColor = UIColor.clear { 86 | didSet { 87 | layer.borderColor = borderColor.cgColor 88 | label.layer.borderColor = borderColor.cgColor 89 | } 90 | } 91 | 92 | /// Font of the buttons. Defaults to Futura-Bold, 20.0 points in size. 93 | @objc public var buttonsFont = UIFont(name: "Futura-Bold", size: 20.0)! { 94 | didSet { 95 | for button in [leftButton, rightButton] { 96 | button.titleLabel?.font = buttonsFont 97 | } 98 | } 99 | } 100 | 101 | /// Text color of the buttons. Defaults to white. 102 | @objc @IBInspectable public var buttonsTextColor: UIColor = UIColor.white { 103 | didSet { 104 | for button in [leftButton, rightButton] { 105 | button.setTitleColor(buttonsTextColor, for: .normal) 106 | } 107 | } 108 | } 109 | 110 | let formatter = NumberFormatter() 111 | var labelOriginalCenter: CGPoint! 112 | 113 | lazy var leftButton: UIButton = { 114 | let button = UIButton() 115 | button.setTitle("-", for: .normal) 116 | button.setTitleColor(self.buttonsTextColor, for: .normal) 117 | button.backgroundColor = UIColor.clear 118 | button.titleLabel?.font = self.buttonsFont 119 | button.addTarget(self, action: #selector(SHSliderSwitch.leftButtonAction), for: .touchDown) 120 | return button 121 | }() 122 | 123 | lazy var rightButton: UIButton = { 124 | let button = UIButton() 125 | button.setTitle("+", for: .normal) 126 | button.setTitleColor(self.buttonsTextColor, for: .normal) 127 | button.backgroundColor = UIColor.clear 128 | button.titleLabel?.font = self.buttonsFont 129 | button.addTarget(self, action: #selector(SHSliderSwitch.rightButtonAction), for: .touchDown) 130 | return button 131 | }() 132 | 133 | 134 | lazy var label: UILabel = { 135 | let label = UILabel() 136 | label.textAlignment = .center 137 | label.text = "\(formattedValue ?? "")" 138 | label.textColor = self.labelTextColor 139 | label.backgroundColor = self.labelBackgroundColor 140 | label.font = self.labelFont 141 | label.layer.cornerRadius = self.bounds.size.height/2 142 | label.layer.masksToBounds = true 143 | label.isUserInteractionEnabled = true 144 | label.adjustsFontSizeToFitWidth = true 145 | let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(SHSliderSwitch.handlePan)) 146 | panRecognizer.maximumNumberOfTouches = 1 147 | label.addGestureRecognizer(panRecognizer) 148 | return label 149 | }() 150 | 151 | override init(frame: CGRect) { 152 | super.init(frame: frame) 153 | self.frame = frame 154 | guard bounds.width >= (bounds.height+100) && bounds.height >= 30 else { 155 | return 156 | } 157 | self.setupUI() 158 | } 159 | 160 | required public init?(coder aDecoder: NSCoder) { 161 | super.init(coder: aDecoder) 162 | guard bounds.width >= (bounds.height+100) && bounds.height >= 30 else { 163 | return 164 | } 165 | setupUI() 166 | } 167 | 168 | private func setupUI(){ 169 | self.layer.cornerRadius = self.frame.size.height/2 170 | self.layer.masksToBounds = true 171 | addSubview(leftButton) 172 | addSubview(rightButton) 173 | addSubview(label) 174 | labelOriginalCenter = label.center 175 | 176 | } 177 | 178 | func setupNumberFormatter() { 179 | let decValue = Decimal(stepValue) 180 | let digits = decValue.significantFractionalDecimalDigits 181 | formatter.minimumIntegerDigits = 1 182 | formatter.minimumFractionDigits = 0 183 | formatter.maximumFractionDigits = digits 184 | } 185 | 186 | public override func layoutSubviews() { 187 | leftButton.frame = CGRect(x: 0, y: 0, width: 50, height: bounds.size.height) 188 | rightButton.frame = CGRect(x: bounds.width-50, y: 0, width: 50, height: bounds.size.height) 189 | label.frame = CGRect(x: (self.bounds.width/2-(self.bounds.height/2)), y: 0, width: self.bounds.size.height, height: bounds.size.height) 190 | labelOriginalCenter = label.center 191 | } 192 | 193 | } 194 | 195 | extension SHSliderSwitch{ 196 | 197 | @objc func handlePan(gesture: UIPanGestureRecognizer) { 198 | switch gesture.state { 199 | case .began: 200 | leftButton.isEnabled = false 201 | rightButton.isEnabled = false 202 | case .changed: 203 | let translation = gesture.translation(in: label) 204 | gesture.setTranslation(CGPoint.zero, in: label) 205 | 206 | let slidingRight = gesture.velocity(in: label).x > 0 207 | let slidingLeft = gesture.velocity(in: label).x < 0 208 | 209 | let maxPoint = (self.bounds.width-(self.bounds.height/2)) 210 | let minPoint = ((self.bounds.height/2)) 211 | 212 | // Move the label with pan 213 | if slidingRight { 214 | label.center.x = min(maxPoint, label.center.x + translation.x) 215 | } else if slidingLeft { 216 | label.center.x = max(minPoint, label.center.x + translation.x) 217 | } 218 | 219 | if label.center.x == maxPoint{ 220 | if value != maximumValue{ 221 | 222 | value += stepValue 223 | } 224 | }else if label.center.x == minPoint{ 225 | if value != minimumValue{ 226 | 227 | value -= stepValue 228 | } 229 | } 230 | 231 | case .ended, .cancelled, .failed: 232 | UIView.animate(withDuration: 0.4, animations: { 233 | self.label.center = self.labelOriginalCenter 234 | self.layoutIfNeeded() 235 | }, completion: { (success) in 236 | self.leftButton.isEnabled = true 237 | self.rightButton.isEnabled = true 238 | }) 239 | 240 | default: 241 | break 242 | } 243 | } 244 | 245 | @objc func leftButtonAction(button: UIButton) { 246 | if value != minimumValue{ 247 | zoomIn(view: label) 248 | value -= stepValue 249 | } 250 | 251 | } 252 | 253 | @objc func rightButtonAction(button: UIButton) { 254 | if value != maximumValue{ 255 | zoomIn(view: label) 256 | value += stepValue 257 | } 258 | } 259 | 260 | func zoomIn(view:UIView, duration: TimeInterval = 0.1) { 261 | view.transform = CGAffineTransform(scaleX: 0.95, y: 0.95) 262 | UIView.animate(withDuration: duration, delay: 0.0, options: [.curveEaseInOut], animations: { 263 | view.transform = CGAffineTransform.identity 264 | }) 265 | } 266 | 267 | } 268 | 269 | extension Decimal { 270 | var significantFractionalDecimalDigits: Int { 271 | return max(-exponent, 0) 272 | } 273 | } 274 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample/SHSliderSwitch/SHSliderSwitch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SHSliderSwitch.swift 3 | // SHSliderSwitch 4 | // 5 | // Created on 04/02/19. 6 | // Copyright © 2019 iamShezad. All rights reserved. 7 | // 8 | 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | @IBDesignable public class SHSliderSwitch: UIControl{ 14 | 15 | /// Current value of the switch. Defaults to 0. 16 | @objc @IBInspectable public var value: Double = 0 { 17 | didSet { 18 | value = min(maximumValue, max(minimumValue, value)) 19 | 20 | label.text = "\(formattedValue ?? "")" 21 | 22 | if oldValue != value { 23 | sendActions(for: .valueChanged) 24 | } 25 | } 26 | } 27 | 28 | private var formattedValue: String? { 29 | return formatter.string(from: NSNumber(value: value)) 30 | } 31 | 32 | 33 | /// Minimum value. Must be less than maximumValue. Defaults to 0. 34 | @objc @IBInspectable public var minimumValue: Double = 0 { 35 | didSet { 36 | value = min(maximumValue, max(minimumValue, value)) 37 | } 38 | } 39 | 40 | /// Maximum value. Must be more than minimumValue. Defaults to 100. 41 | @objc @IBInspectable public var maximumValue: Double = 100 { 42 | didSet { 43 | value = min(maximumValue, max(minimumValue, value)) 44 | } 45 | } 46 | 47 | /// Increment value in switch. Defaults to 1. 48 | @objc @IBInspectable public var stepValue: Double = 1 { 49 | didSet { 50 | setupNumberFormatter() 51 | } 52 | } 53 | 54 | 55 | /// Text color of the circular label. Defaults to white. 56 | @objc @IBInspectable public var labelTextColor: UIColor = UIColor.black { 57 | didSet { 58 | label.textColor = labelTextColor 59 | } 60 | } 61 | 62 | /// Background color of the circular label. Defaults to lighter blue. 63 | @objc @IBInspectable public var labelBackgroundColor: UIColor = UIColor.white { 64 | didSet { 65 | label.backgroundColor = labelBackgroundColor 66 | } 67 | } 68 | 69 | /// Font of the circular label. Defaults to Futura-Medium, 14.0 points in size. 70 | @objc public var labelFont = UIFont(name: "Futura-Medium", size: 14.0)! { 71 | didSet { 72 | label.font = labelFont 73 | } 74 | } 75 | 76 | /// Border width of the switch and circular label's layer. Defaults to 0.0. 77 | @objc @IBInspectable public var borderWidth: CGFloat = 0.0 { 78 | didSet { 79 | layer.borderWidth = borderWidth 80 | label.layer.borderWidth = borderWidth 81 | } 82 | } 83 | 84 | /// Color of the border of the switch and circular label's layer. Defaults to clear color. 85 | @objc @IBInspectable public var borderColor: UIColor = UIColor.clear { 86 | didSet { 87 | layer.borderColor = borderColor.cgColor 88 | label.layer.borderColor = borderColor.cgColor 89 | } 90 | } 91 | 92 | /// Font of the buttons. Defaults to Futura-Bold, 20.0 points in size. 93 | @objc public var buttonsFont = UIFont(name: "Futura-Bold", size: 20.0)! { 94 | didSet { 95 | for button in [leftButton, rightButton] { 96 | button.titleLabel?.font = buttonsFont 97 | } 98 | } 99 | } 100 | 101 | /// Text color of the buttons. Defaults to white. 102 | @objc @IBInspectable public var buttonsTextColor: UIColor = UIColor.white { 103 | didSet { 104 | for button in [leftButton, rightButton] { 105 | button.setTitleColor(buttonsTextColor, for: .normal) 106 | } 107 | } 108 | } 109 | 110 | let formatter = NumberFormatter() 111 | var labelOriginalCenter: CGPoint! 112 | 113 | lazy var leftButton: UIButton = { 114 | let button = UIButton() 115 | button.setTitle("-", for: .normal) 116 | button.setTitleColor(self.buttonsTextColor, for: .normal) 117 | button.backgroundColor = UIColor.clear 118 | button.titleLabel?.font = self.buttonsFont 119 | button.addTarget(self, action: #selector(SHSliderSwitch.leftButtonAction), for: .touchDown) 120 | return button 121 | }() 122 | 123 | lazy var rightButton: UIButton = { 124 | let button = UIButton() 125 | button.setTitle("+", for: .normal) 126 | button.setTitleColor(self.buttonsTextColor, for: .normal) 127 | button.backgroundColor = UIColor.clear 128 | button.titleLabel?.font = self.buttonsFont 129 | button.addTarget(self, action: #selector(SHSliderSwitch.rightButtonAction), for: .touchDown) 130 | return button 131 | }() 132 | 133 | 134 | lazy var label: UILabel = { 135 | let label = UILabel() 136 | label.textAlignment = .center 137 | label.text = "\(formattedValue ?? "")" 138 | label.textColor = self.labelTextColor 139 | label.backgroundColor = self.labelBackgroundColor 140 | label.font = self.labelFont 141 | label.layer.cornerRadius = self.bounds.size.height/2 142 | label.layer.masksToBounds = true 143 | label.isUserInteractionEnabled = true 144 | label.adjustsFontSizeToFitWidth = true 145 | let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(SHSliderSwitch.handlePan)) 146 | panRecognizer.maximumNumberOfTouches = 1 147 | label.addGestureRecognizer(panRecognizer) 148 | return label 149 | }() 150 | 151 | override init(frame: CGRect) { 152 | super.init(frame: frame) 153 | self.frame = frame 154 | guard bounds.width >= (bounds.height+100) && bounds.height >= 30 else { 155 | return 156 | } 157 | self.setupUI() 158 | } 159 | 160 | required public init?(coder aDecoder: NSCoder) { 161 | super.init(coder: aDecoder) 162 | guard bounds.width >= (bounds.height+100) && bounds.height >= 30 else { 163 | return 164 | } 165 | setupUI() 166 | } 167 | 168 | private func setupUI(){ 169 | self.layer.cornerRadius = self.frame.size.height/2 170 | self.layer.masksToBounds = true 171 | addSubview(leftButton) 172 | addSubview(rightButton) 173 | addSubview(label) 174 | labelOriginalCenter = label.center 175 | 176 | } 177 | 178 | func setupNumberFormatter() { 179 | let decValue = Decimal(stepValue) 180 | let digits = decValue.significantFractionalDecimalDigits 181 | formatter.minimumIntegerDigits = 1 182 | formatter.minimumFractionDigits = 0 183 | formatter.maximumFractionDigits = digits 184 | } 185 | 186 | public override func layoutSubviews() { 187 | leftButton.frame = CGRect(x: 0, y: 0, width: 50, height: bounds.size.height) 188 | rightButton.frame = CGRect(x: bounds.width-50, y: 0, width: 50, height: bounds.size.height) 189 | label.frame = CGRect(x: (self.bounds.width/2-(self.bounds.height/2)), y: 0, width: self.bounds.size.height, height: bounds.size.height) 190 | labelOriginalCenter = label.center 191 | } 192 | 193 | } 194 | 195 | extension SHSliderSwitch{ 196 | 197 | @objc func handlePan(gesture: UIPanGestureRecognizer) { 198 | switch gesture.state { 199 | case .began: 200 | leftButton.isEnabled = false 201 | rightButton.isEnabled = false 202 | case .changed: 203 | let translation = gesture.translation(in: label) 204 | gesture.setTranslation(CGPoint.zero, in: label) 205 | 206 | let slidingRight = gesture.velocity(in: label).x > 0 207 | let slidingLeft = gesture.velocity(in: label).x < 0 208 | 209 | let maxPoint = (self.bounds.width-(self.bounds.height/2)) 210 | let minPoint = ((self.bounds.height/2)) 211 | 212 | // Move the label with pan 213 | if slidingRight { 214 | label.center.x = min(maxPoint, label.center.x + translation.x) 215 | } else if slidingLeft { 216 | label.center.x = max(minPoint, label.center.x + translation.x) 217 | } 218 | 219 | if label.center.x == maxPoint{ 220 | if value != maximumValue{ 221 | 222 | value += stepValue 223 | } 224 | }else if label.center.x == minPoint{ 225 | if value != minimumValue{ 226 | 227 | value -= stepValue 228 | } 229 | } 230 | 231 | case .ended, .cancelled, .failed: 232 | UIView.animate(withDuration: 0.4, animations: { 233 | self.label.center = self.labelOriginalCenter 234 | self.layoutIfNeeded() 235 | }, completion: { (success) in 236 | self.leftButton.isEnabled = true 237 | self.rightButton.isEnabled = true 238 | }) 239 | 240 | default: 241 | break 242 | } 243 | } 244 | 245 | @objc func leftButtonAction(button: UIButton) { 246 | if value != minimumValue{ 247 | zoomIn(view: label) 248 | value -= stepValue 249 | } 250 | 251 | } 252 | 253 | @objc func rightButtonAction(button: UIButton) { 254 | if value != maximumValue{ 255 | zoomIn(view: label) 256 | value += stepValue 257 | } 258 | } 259 | 260 | func zoomIn(view:UIView, duration: TimeInterval = 0.1) { 261 | view.transform = CGAffineTransform(scaleX: 0.95, y: 0.95) 262 | UIView.animate(withDuration: duration, delay: 0.0, options: [.curveEaseInOut], animations: { 263 | view.transform = CGAffineTransform.identity 264 | }) 265 | } 266 | 267 | } 268 | 269 | extension Decimal { 270 | var significantFractionalDecimalDigits: Int { 271 | return max(-exponent, 0) 272 | } 273 | } 274 | -------------------------------------------------------------------------------- /SHSliderSwitch.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 02110C4A22086429001CDCD8 /* SHSliderSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 02110C4822086429001CDCD8 /* SHSliderSwitch.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 02110C512208644A001CDCD8 /* SHSliderSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02110C502208644A001CDCD8 /* SHSliderSwitch.swift */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXFileReference section */ 15 | 02110C4522086429001CDCD8 /* SHSliderSwitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SHSliderSwitch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 16 | 02110C4822086429001CDCD8 /* SHSliderSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SHSliderSwitch.h; sourceTree = ""; }; 17 | 02110C4922086429001CDCD8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18 | 02110C502208644A001CDCD8 /* SHSliderSwitch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHSliderSwitch.swift; sourceTree = ""; }; 19 | /* End PBXFileReference section */ 20 | 21 | /* Begin PBXFrameworksBuildPhase section */ 22 | 02110C4222086429001CDCD8 /* Frameworks */ = { 23 | isa = PBXFrameworksBuildPhase; 24 | buildActionMask = 2147483647; 25 | files = ( 26 | ); 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXFrameworksBuildPhase section */ 30 | 31 | /* Begin PBXGroup section */ 32 | 02110C3B22086429001CDCD8 = { 33 | isa = PBXGroup; 34 | children = ( 35 | 02110C4722086429001CDCD8 /* SHSliderSwitch */, 36 | 02110C4622086429001CDCD8 /* Products */, 37 | ); 38 | sourceTree = ""; 39 | }; 40 | 02110C4622086429001CDCD8 /* Products */ = { 41 | isa = PBXGroup; 42 | children = ( 43 | 02110C4522086429001CDCD8 /* SHSliderSwitch.framework */, 44 | ); 45 | name = Products; 46 | sourceTree = ""; 47 | }; 48 | 02110C4722086429001CDCD8 /* SHSliderSwitch */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 02110C4822086429001CDCD8 /* SHSliderSwitch.h */, 52 | 02110C4922086429001CDCD8 /* Info.plist */, 53 | 02110C502208644A001CDCD8 /* SHSliderSwitch.swift */, 54 | ); 55 | path = SHSliderSwitch; 56 | sourceTree = ""; 57 | }; 58 | /* End PBXGroup section */ 59 | 60 | /* Begin PBXHeadersBuildPhase section */ 61 | 02110C4022086429001CDCD8 /* Headers */ = { 62 | isa = PBXHeadersBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | 02110C4A22086429001CDCD8 /* SHSliderSwitch.h in Headers */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXHeadersBuildPhase section */ 70 | 71 | /* Begin PBXNativeTarget section */ 72 | 02110C4422086429001CDCD8 /* SHSliderSwitch */ = { 73 | isa = PBXNativeTarget; 74 | buildConfigurationList = 02110C4D22086429001CDCD8 /* Build configuration list for PBXNativeTarget "SHSliderSwitch" */; 75 | buildPhases = ( 76 | 02110C4022086429001CDCD8 /* Headers */, 77 | 02110C4122086429001CDCD8 /* Sources */, 78 | 02110C4222086429001CDCD8 /* Frameworks */, 79 | 02110C4322086429001CDCD8 /* Resources */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = SHSliderSwitch; 86 | productName = SHSliderSwitch; 87 | productReference = 02110C4522086429001CDCD8 /* SHSliderSwitch.framework */; 88 | productType = "com.apple.product-type.framework"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | 02110C3C22086429001CDCD8 /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | LastUpgradeCheck = 1010; 97 | ORGANIZATIONNAME = iamShezzad; 98 | TargetAttributes = { 99 | 02110C4422086429001CDCD8 = { 100 | CreatedOnToolsVersion = 10.1; 101 | LastSwiftMigration = 1010; 102 | }; 103 | }; 104 | }; 105 | buildConfigurationList = 02110C3F22086429001CDCD8 /* Build configuration list for PBXProject "SHSliderSwitch" */; 106 | compatibilityVersion = "Xcode 9.3"; 107 | developmentRegion = en; 108 | hasScannedForEncodings = 0; 109 | knownRegions = ( 110 | en, 111 | ); 112 | mainGroup = 02110C3B22086429001CDCD8; 113 | productRefGroup = 02110C4622086429001CDCD8 /* Products */; 114 | projectDirPath = ""; 115 | projectRoot = ""; 116 | targets = ( 117 | 02110C4422086429001CDCD8 /* SHSliderSwitch */, 118 | ); 119 | }; 120 | /* End PBXProject section */ 121 | 122 | /* Begin PBXResourcesBuildPhase section */ 123 | 02110C4322086429001CDCD8 /* Resources */ = { 124 | isa = PBXResourcesBuildPhase; 125 | buildActionMask = 2147483647; 126 | files = ( 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | /* End PBXResourcesBuildPhase section */ 131 | 132 | /* Begin PBXSourcesBuildPhase section */ 133 | 02110C4122086429001CDCD8 /* Sources */ = { 134 | isa = PBXSourcesBuildPhase; 135 | buildActionMask = 2147483647; 136 | files = ( 137 | 02110C512208644A001CDCD8 /* SHSliderSwitch.swift in Sources */, 138 | ); 139 | runOnlyForDeploymentPostprocessing = 0; 140 | }; 141 | /* End PBXSourcesBuildPhase section */ 142 | 143 | /* Begin XCBuildConfiguration section */ 144 | 02110C4B22086429001CDCD8 /* Debug */ = { 145 | isa = XCBuildConfiguration; 146 | buildSettings = { 147 | ALWAYS_SEARCH_USER_PATHS = NO; 148 | CLANG_ANALYZER_NONNULL = YES; 149 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 150 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 151 | CLANG_CXX_LIBRARY = "libc++"; 152 | CLANG_ENABLE_MODULES = YES; 153 | CLANG_ENABLE_OBJC_ARC = YES; 154 | CLANG_ENABLE_OBJC_WEAK = YES; 155 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 156 | CLANG_WARN_BOOL_CONVERSION = YES; 157 | CLANG_WARN_COMMA = YES; 158 | CLANG_WARN_CONSTANT_CONVERSION = YES; 159 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 160 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 161 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 162 | CLANG_WARN_EMPTY_BODY = YES; 163 | CLANG_WARN_ENUM_CONVERSION = YES; 164 | CLANG_WARN_INFINITE_RECURSION = YES; 165 | CLANG_WARN_INT_CONVERSION = YES; 166 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 167 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 168 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 169 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 170 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 171 | CLANG_WARN_STRICT_PROTOTYPES = YES; 172 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 173 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 174 | CLANG_WARN_UNREACHABLE_CODE = YES; 175 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 176 | CODE_SIGN_IDENTITY = "iPhone Developer"; 177 | COPY_PHASE_STRIP = NO; 178 | CURRENT_PROJECT_VERSION = 1; 179 | DEBUG_INFORMATION_FORMAT = dwarf; 180 | ENABLE_STRICT_OBJC_MSGSEND = YES; 181 | ENABLE_TESTABILITY = YES; 182 | GCC_C_LANGUAGE_STANDARD = gnu11; 183 | GCC_DYNAMIC_NO_PIC = NO; 184 | GCC_NO_COMMON_BLOCKS = YES; 185 | GCC_OPTIMIZATION_LEVEL = 0; 186 | GCC_PREPROCESSOR_DEFINITIONS = ( 187 | "DEBUG=1", 188 | "$(inherited)", 189 | ); 190 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 191 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 192 | GCC_WARN_UNDECLARED_SELECTOR = YES; 193 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 194 | GCC_WARN_UNUSED_FUNCTION = YES; 195 | GCC_WARN_UNUSED_VARIABLE = YES; 196 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 197 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 198 | MTL_FAST_MATH = YES; 199 | ONLY_ACTIVE_ARCH = YES; 200 | SDKROOT = iphoneos; 201 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 202 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 203 | VERSIONING_SYSTEM = "apple-generic"; 204 | VERSION_INFO_PREFIX = ""; 205 | }; 206 | name = Debug; 207 | }; 208 | 02110C4C22086429001CDCD8 /* Release */ = { 209 | isa = XCBuildConfiguration; 210 | buildSettings = { 211 | ALWAYS_SEARCH_USER_PATHS = NO; 212 | CLANG_ANALYZER_NONNULL = YES; 213 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 214 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 215 | CLANG_CXX_LIBRARY = "libc++"; 216 | CLANG_ENABLE_MODULES = YES; 217 | CLANG_ENABLE_OBJC_ARC = YES; 218 | CLANG_ENABLE_OBJC_WEAK = YES; 219 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 220 | CLANG_WARN_BOOL_CONVERSION = YES; 221 | CLANG_WARN_COMMA = YES; 222 | CLANG_WARN_CONSTANT_CONVERSION = YES; 223 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 226 | CLANG_WARN_EMPTY_BODY = YES; 227 | CLANG_WARN_ENUM_CONVERSION = YES; 228 | CLANG_WARN_INFINITE_RECURSION = YES; 229 | CLANG_WARN_INT_CONVERSION = YES; 230 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 231 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 232 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 233 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 234 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 235 | CLANG_WARN_STRICT_PROTOTYPES = YES; 236 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 237 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 238 | CLANG_WARN_UNREACHABLE_CODE = YES; 239 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 240 | CODE_SIGN_IDENTITY = "iPhone Developer"; 241 | COPY_PHASE_STRIP = NO; 242 | CURRENT_PROJECT_VERSION = 1; 243 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 244 | ENABLE_NS_ASSERTIONS = NO; 245 | ENABLE_STRICT_OBJC_MSGSEND = YES; 246 | GCC_C_LANGUAGE_STANDARD = gnu11; 247 | GCC_NO_COMMON_BLOCKS = YES; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 250 | GCC_WARN_UNDECLARED_SELECTOR = YES; 251 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 252 | GCC_WARN_UNUSED_FUNCTION = YES; 253 | GCC_WARN_UNUSED_VARIABLE = YES; 254 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 255 | MTL_ENABLE_DEBUG_INFO = NO; 256 | MTL_FAST_MATH = YES; 257 | SDKROOT = iphoneos; 258 | SWIFT_COMPILATION_MODE = wholemodule; 259 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 260 | VALIDATE_PRODUCT = YES; 261 | VERSIONING_SYSTEM = "apple-generic"; 262 | VERSION_INFO_PREFIX = ""; 263 | }; 264 | name = Release; 265 | }; 266 | 02110C4E22086429001CDCD8 /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | CLANG_ENABLE_MODULES = YES; 270 | CODE_SIGN_IDENTITY = ""; 271 | CODE_SIGN_STYLE = Automatic; 272 | DEFINES_MODULE = YES; 273 | DYLIB_COMPATIBILITY_VERSION = 1; 274 | DYLIB_CURRENT_VERSION = 1; 275 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 276 | INFOPLIST_FILE = SHSliderSwitch/Info.plist; 277 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 278 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 279 | LD_RUNPATH_SEARCH_PATHS = ( 280 | "$(inherited)", 281 | "@executable_path/Frameworks", 282 | "@loader_path/Frameworks", 283 | ); 284 | PRODUCT_BUNDLE_IDENTIFIER = SH.SHSliderSwitch; 285 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 286 | SKIP_INSTALL = YES; 287 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 288 | SWIFT_VERSION = 4.2; 289 | TARGETED_DEVICE_FAMILY = 1; 290 | }; 291 | name = Debug; 292 | }; 293 | 02110C4F22086429001CDCD8 /* Release */ = { 294 | isa = XCBuildConfiguration; 295 | buildSettings = { 296 | CLANG_ENABLE_MODULES = YES; 297 | CODE_SIGN_IDENTITY = ""; 298 | CODE_SIGN_STYLE = Automatic; 299 | DEFINES_MODULE = YES; 300 | DYLIB_COMPATIBILITY_VERSION = 1; 301 | DYLIB_CURRENT_VERSION = 1; 302 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 303 | INFOPLIST_FILE = SHSliderSwitch/Info.plist; 304 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 305 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 306 | LD_RUNPATH_SEARCH_PATHS = ( 307 | "$(inherited)", 308 | "@executable_path/Frameworks", 309 | "@loader_path/Frameworks", 310 | ); 311 | PRODUCT_BUNDLE_IDENTIFIER = SH.SHSliderSwitch; 312 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 313 | SKIP_INSTALL = YES; 314 | SWIFT_VERSION = 4.2; 315 | TARGETED_DEVICE_FAMILY = 1; 316 | }; 317 | name = Release; 318 | }; 319 | /* End XCBuildConfiguration section */ 320 | 321 | /* Begin XCConfigurationList section */ 322 | 02110C3F22086429001CDCD8 /* Build configuration list for PBXProject "SHSliderSwitch" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | 02110C4B22086429001CDCD8 /* Debug */, 326 | 02110C4C22086429001CDCD8 /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | 02110C4D22086429001CDCD8 /* Build configuration list for PBXNativeTarget "SHSliderSwitch" */ = { 332 | isa = XCConfigurationList; 333 | buildConfigurations = ( 334 | 02110C4E22086429001CDCD8 /* Debug */, 335 | 02110C4F22086429001CDCD8 /* Release */, 336 | ); 337 | defaultConfigurationIsVisible = 0; 338 | defaultConfigurationName = Release; 339 | }; 340 | /* End XCConfigurationList section */ 341 | }; 342 | rootObject = 02110C3C22086429001CDCD8 /* Project object */; 343 | } 344 | -------------------------------------------------------------------------------- /SliderSwitchSample/SliderSwitchSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 02F40E9D2209572C00502815 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02F40E9C2209572C00502815 /* AppDelegate.swift */; }; 11 | 02F40E9F2209572C00502815 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02F40E9E2209572C00502815 /* ViewController.swift */; }; 12 | 02F40EA22209572C00502815 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 02F40EA02209572C00502815 /* Main.storyboard */; }; 13 | 02F40EA42209572C00502815 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 02F40EA32209572C00502815 /* Assets.xcassets */; }; 14 | 02F40EA72209572C00502815 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 02F40EA52209572C00502815 /* LaunchScreen.storyboard */; }; 15 | 02F40EB22209575800502815 /* SHSliderSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02F40EB02209575800502815 /* SHSliderSwitch.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 02F40E992209572C00502815 /* SliderSwitchSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SliderSwitchSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 02F40E9C2209572C00502815 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 02F40E9E2209572C00502815 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 22 | 02F40EA12209572C00502815 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 23 | 02F40EA32209572C00502815 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | 02F40EA62209572C00502815 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 25 | 02F40EA82209572C00502815 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | 02F40EB02209575800502815 /* SHSliderSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHSliderSwitch.swift; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 02F40E962209572C00502815 /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | 02F40E902209572C00502815 = { 41 | isa = PBXGroup; 42 | children = ( 43 | 02F40E9B2209572C00502815 /* SliderSwitchSample */, 44 | 02F40E9A2209572C00502815 /* Products */, 45 | ); 46 | sourceTree = ""; 47 | }; 48 | 02F40E9A2209572C00502815 /* Products */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 02F40E992209572C00502815 /* SliderSwitchSample.app */, 52 | ); 53 | name = Products; 54 | sourceTree = ""; 55 | }; 56 | 02F40E9B2209572C00502815 /* SliderSwitchSample */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 02F40EAE2209575800502815 /* SHSliderSwitch */, 60 | 02F40E9C2209572C00502815 /* AppDelegate.swift */, 61 | 02F40E9E2209572C00502815 /* ViewController.swift */, 62 | 02F40EA02209572C00502815 /* Main.storyboard */, 63 | 02F40EA32209572C00502815 /* Assets.xcassets */, 64 | 02F40EA52209572C00502815 /* LaunchScreen.storyboard */, 65 | 02F40EA82209572C00502815 /* Info.plist */, 66 | ); 67 | path = SliderSwitchSample; 68 | sourceTree = ""; 69 | }; 70 | 02F40EAE2209575800502815 /* SHSliderSwitch */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 02F40EB02209575800502815 /* SHSliderSwitch.swift */, 74 | ); 75 | path = SHSliderSwitch; 76 | sourceTree = ""; 77 | }; 78 | /* End PBXGroup section */ 79 | 80 | /* Begin PBXNativeTarget section */ 81 | 02F40E982209572C00502815 /* SliderSwitchSample */ = { 82 | isa = PBXNativeTarget; 83 | buildConfigurationList = 02F40EAB2209572C00502815 /* Build configuration list for PBXNativeTarget "SliderSwitchSample" */; 84 | buildPhases = ( 85 | 02F40E952209572C00502815 /* Sources */, 86 | 02F40E962209572C00502815 /* Frameworks */, 87 | 02F40E972209572C00502815 /* Resources */, 88 | ); 89 | buildRules = ( 90 | ); 91 | dependencies = ( 92 | ); 93 | name = SliderSwitchSample; 94 | productName = SliderSwitchSample; 95 | productReference = 02F40E992209572C00502815 /* SliderSwitchSample.app */; 96 | productType = "com.apple.product-type.application"; 97 | }; 98 | /* End PBXNativeTarget section */ 99 | 100 | /* Begin PBXProject section */ 101 | 02F40E912209572C00502815 /* Project object */ = { 102 | isa = PBXProject; 103 | attributes = { 104 | LastSwiftUpdateCheck = 1010; 105 | LastUpgradeCheck = 1010; 106 | ORGANIZATIONNAME = iamShezad; 107 | TargetAttributes = { 108 | 02F40E982209572C00502815 = { 109 | CreatedOnToolsVersion = 10.1; 110 | }; 111 | }; 112 | }; 113 | buildConfigurationList = 02F40E942209572C00502815 /* Build configuration list for PBXProject "SliderSwitchSample" */; 114 | compatibilityVersion = "Xcode 9.3"; 115 | developmentRegion = en; 116 | hasScannedForEncodings = 0; 117 | knownRegions = ( 118 | en, 119 | Base, 120 | ); 121 | mainGroup = 02F40E902209572C00502815; 122 | productRefGroup = 02F40E9A2209572C00502815 /* Products */; 123 | projectDirPath = ""; 124 | projectRoot = ""; 125 | targets = ( 126 | 02F40E982209572C00502815 /* SliderSwitchSample */, 127 | ); 128 | }; 129 | /* End PBXProject section */ 130 | 131 | /* Begin PBXResourcesBuildPhase section */ 132 | 02F40E972209572C00502815 /* Resources */ = { 133 | isa = PBXResourcesBuildPhase; 134 | buildActionMask = 2147483647; 135 | files = ( 136 | 02F40EA72209572C00502815 /* LaunchScreen.storyboard in Resources */, 137 | 02F40EA42209572C00502815 /* Assets.xcassets in Resources */, 138 | 02F40EA22209572C00502815 /* Main.storyboard in Resources */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXResourcesBuildPhase section */ 143 | 144 | /* Begin PBXSourcesBuildPhase section */ 145 | 02F40E952209572C00502815 /* Sources */ = { 146 | isa = PBXSourcesBuildPhase; 147 | buildActionMask = 2147483647; 148 | files = ( 149 | 02F40EB22209575800502815 /* SHSliderSwitch.swift in Sources */, 150 | 02F40E9F2209572C00502815 /* ViewController.swift in Sources */, 151 | 02F40E9D2209572C00502815 /* AppDelegate.swift in Sources */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXSourcesBuildPhase section */ 156 | 157 | /* Begin PBXVariantGroup section */ 158 | 02F40EA02209572C00502815 /* Main.storyboard */ = { 159 | isa = PBXVariantGroup; 160 | children = ( 161 | 02F40EA12209572C00502815 /* Base */, 162 | ); 163 | name = Main.storyboard; 164 | sourceTree = ""; 165 | }; 166 | 02F40EA52209572C00502815 /* LaunchScreen.storyboard */ = { 167 | isa = PBXVariantGroup; 168 | children = ( 169 | 02F40EA62209572C00502815 /* Base */, 170 | ); 171 | name = LaunchScreen.storyboard; 172 | sourceTree = ""; 173 | }; 174 | /* End PBXVariantGroup section */ 175 | 176 | /* Begin XCBuildConfiguration section */ 177 | 02F40EA92209572C00502815 /* Debug */ = { 178 | isa = XCBuildConfiguration; 179 | buildSettings = { 180 | ALWAYS_SEARCH_USER_PATHS = NO; 181 | CLANG_ANALYZER_NONNULL = YES; 182 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 183 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 184 | CLANG_CXX_LIBRARY = "libc++"; 185 | CLANG_ENABLE_MODULES = YES; 186 | CLANG_ENABLE_OBJC_ARC = YES; 187 | CLANG_ENABLE_OBJC_WEAK = YES; 188 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 189 | CLANG_WARN_BOOL_CONVERSION = YES; 190 | CLANG_WARN_COMMA = YES; 191 | CLANG_WARN_CONSTANT_CONVERSION = YES; 192 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 193 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 194 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 195 | CLANG_WARN_EMPTY_BODY = YES; 196 | CLANG_WARN_ENUM_CONVERSION = YES; 197 | CLANG_WARN_INFINITE_RECURSION = YES; 198 | CLANG_WARN_INT_CONVERSION = YES; 199 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 200 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 201 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 202 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 203 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 204 | CLANG_WARN_STRICT_PROTOTYPES = YES; 205 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 206 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 207 | CLANG_WARN_UNREACHABLE_CODE = YES; 208 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 209 | CODE_SIGN_IDENTITY = "iPhone Developer"; 210 | COPY_PHASE_STRIP = NO; 211 | DEBUG_INFORMATION_FORMAT = dwarf; 212 | ENABLE_STRICT_OBJC_MSGSEND = YES; 213 | ENABLE_TESTABILITY = YES; 214 | GCC_C_LANGUAGE_STANDARD = gnu11; 215 | GCC_DYNAMIC_NO_PIC = NO; 216 | GCC_NO_COMMON_BLOCKS = YES; 217 | GCC_OPTIMIZATION_LEVEL = 0; 218 | GCC_PREPROCESSOR_DEFINITIONS = ( 219 | "DEBUG=1", 220 | "$(inherited)", 221 | ); 222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 224 | GCC_WARN_UNDECLARED_SELECTOR = YES; 225 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 226 | GCC_WARN_UNUSED_FUNCTION = YES; 227 | GCC_WARN_UNUSED_VARIABLE = YES; 228 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 229 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 230 | MTL_FAST_MATH = YES; 231 | ONLY_ACTIVE_ARCH = YES; 232 | SDKROOT = iphoneos; 233 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 234 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 235 | }; 236 | name = Debug; 237 | }; 238 | 02F40EAA2209572C00502815 /* Release */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | CLANG_ANALYZER_NONNULL = YES; 243 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 244 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 245 | CLANG_CXX_LIBRARY = "libc++"; 246 | CLANG_ENABLE_MODULES = YES; 247 | CLANG_ENABLE_OBJC_ARC = YES; 248 | CLANG_ENABLE_OBJC_WEAK = YES; 249 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 250 | CLANG_WARN_BOOL_CONVERSION = YES; 251 | CLANG_WARN_COMMA = YES; 252 | CLANG_WARN_CONSTANT_CONVERSION = YES; 253 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 254 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 255 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 256 | CLANG_WARN_EMPTY_BODY = YES; 257 | CLANG_WARN_ENUM_CONVERSION = YES; 258 | CLANG_WARN_INFINITE_RECURSION = YES; 259 | CLANG_WARN_INT_CONVERSION = YES; 260 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 261 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 262 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 263 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 264 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 265 | CLANG_WARN_STRICT_PROTOTYPES = YES; 266 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 267 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 268 | CLANG_WARN_UNREACHABLE_CODE = YES; 269 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 270 | CODE_SIGN_IDENTITY = "iPhone Developer"; 271 | COPY_PHASE_STRIP = NO; 272 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 273 | ENABLE_NS_ASSERTIONS = NO; 274 | ENABLE_STRICT_OBJC_MSGSEND = YES; 275 | GCC_C_LANGUAGE_STANDARD = gnu11; 276 | GCC_NO_COMMON_BLOCKS = YES; 277 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 278 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 279 | GCC_WARN_UNDECLARED_SELECTOR = YES; 280 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 281 | GCC_WARN_UNUSED_FUNCTION = YES; 282 | GCC_WARN_UNUSED_VARIABLE = YES; 283 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 284 | MTL_ENABLE_DEBUG_INFO = NO; 285 | MTL_FAST_MATH = YES; 286 | SDKROOT = iphoneos; 287 | SWIFT_COMPILATION_MODE = wholemodule; 288 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 289 | VALIDATE_PRODUCT = YES; 290 | }; 291 | name = Release; 292 | }; 293 | 02F40EAC2209572C00502815 /* Debug */ = { 294 | isa = XCBuildConfiguration; 295 | buildSettings = { 296 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 297 | CODE_SIGN_STYLE = Automatic; 298 | INFOPLIST_FILE = SliderSwitchSample/Info.plist; 299 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 300 | LD_RUNPATH_SEARCH_PATHS = ( 301 | "$(inherited)", 302 | "@executable_path/Frameworks", 303 | ); 304 | PRODUCT_BUNDLE_IDENTIFIER = SH.SliderSwitchSample; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | SWIFT_VERSION = 4.2; 307 | TARGETED_DEVICE_FAMILY = 1; 308 | }; 309 | name = Debug; 310 | }; 311 | 02F40EAD2209572C00502815 /* Release */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 315 | CODE_SIGN_STYLE = Automatic; 316 | INFOPLIST_FILE = SliderSwitchSample/Info.plist; 317 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 318 | LD_RUNPATH_SEARCH_PATHS = ( 319 | "$(inherited)", 320 | "@executable_path/Frameworks", 321 | ); 322 | PRODUCT_BUNDLE_IDENTIFIER = SH.SliderSwitchSample; 323 | PRODUCT_NAME = "$(TARGET_NAME)"; 324 | SWIFT_VERSION = 4.2; 325 | TARGETED_DEVICE_FAMILY = 1; 326 | }; 327 | name = Release; 328 | }; 329 | /* End XCBuildConfiguration section */ 330 | 331 | /* Begin XCConfigurationList section */ 332 | 02F40E942209572C00502815 /* Build configuration list for PBXProject "SliderSwitchSample" */ = { 333 | isa = XCConfigurationList; 334 | buildConfigurations = ( 335 | 02F40EA92209572C00502815 /* Debug */, 336 | 02F40EAA2209572C00502815 /* Release */, 337 | ); 338 | defaultConfigurationIsVisible = 0; 339 | defaultConfigurationName = Release; 340 | }; 341 | 02F40EAB2209572C00502815 /* Build configuration list for PBXNativeTarget "SliderSwitchSample" */ = { 342 | isa = XCConfigurationList; 343 | buildConfigurations = ( 344 | 02F40EAC2209572C00502815 /* Debug */, 345 | 02F40EAD2209572C00502815 /* Release */, 346 | ); 347 | defaultConfigurationIsVisible = 0; 348 | defaultConfigurationName = Release; 349 | }; 350 | /* End XCConfigurationList section */ 351 | }; 352 | rootObject = 02F40E912209572C00502815 /* Project object */; 353 | } 354 | --------------------------------------------------------------------------------