├── loopdemo.gif ├── PlayPauseButton.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── PlayPauseButton.xccheckout └── project.pbxproj ├── .gitignore ├── PlayPauseButton ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── ViewController.swift ├── Info.plist ├── Base.lproj │ └── Main.storyboard ├── AppDelegate.swift ├── Launch Screen.storyboard └── PlayPauseButton.swift ├── PlayPauseButtonTests ├── Info.plist └── PlayPauseButtonTests.swift ├── LICENSE └── README.md /loopdemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KelvinJin/PlayPauseButton/HEAD/loopdemo.gif -------------------------------------------------------------------------------- /PlayPauseButton.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # CocoaPods 2 | # 3 | # We recommend against adding the Pods directory to your .gitignore. However 4 | # you should judge for yourself, the pros and cons are mentioned at: 5 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control? 6 | # 7 | # Pods/ 8 | 9 | PlayPauseButton.xcodeproj/project.xcworkspace/xcuserdata 10 | PlayPauseButton.xcodeproj/xcuserdata 11 | -------------------------------------------------------------------------------- /PlayPauseButton/Images.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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PlayPauseButton/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PlayPauseButtonTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /PlayPauseButtonTests/PlayPauseButtonTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlayPauseButtonTests.swift 3 | // PlayPauseButtonTests 4 | // 5 | // Created by Jin Wang on 2/09/2014. 6 | // Copyright (c) 2014 UThoft. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class PlayPauseButtonTests: 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 | XCTAssert(true, "Pass") 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 | -------------------------------------------------------------------------------- /PlayPauseButton/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // PlayPauseButton 4 | // 5 | // Created by Jin Wang on 2/09/2014. 6 | // Copyright (c) 2014 UThoft. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | var button: PlayPauseButton! = nil 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | self.view.backgroundColor = UIColor(red: 38.0 / 255, green: 151.0 / 255, blue: 68.0 / 255, alpha: 1) 18 | 19 | self.button = PlayPauseButton(frame: CGRect(x: 0, y: 0, width: 50, height: 50)) 20 | self.button.center = view.center 21 | self.button.addTarget(self, action: #selector(ViewController.toggle(_:)), for:.touchUpInside) 22 | 23 | self.view.addSubview(button) 24 | } 25 | 26 | override var preferredStatusBarStyle : UIStatusBarStyle { 27 | return .lightContent 28 | } 29 | 30 | func toggle(_ sender: AnyObject!) { 31 | self.button.showsMenu = !self.button.showsMenu 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Jin Wang 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PlayPauseButton 2 | =============== 3 | 4 | Animated Play & Pause Button, subclass of UIButton written in Swift 5 | 6 | PlayPauseButton 7 | 8 | **How to use** 9 | ```swift 10 | // Initial the button with a particular frame 11 | self.button = PlayPauseButton(frame: CGRectMake(0, 0, 50, 50)) 12 | 13 | // Add actions 14 | self.button.addTarget(self, action: "toggle:", forControlEvents:.TouchUpInside) 15 | 16 | // In the toggle function: 17 | func toggle(sender: AnyObject!) { 18 | self.button.showsMenu = !self.button.showsMenu 19 | } 20 | ``` 21 | 22 | **Customize** 23 | ```swift 24 | // Set the stroke color 25 | self.button.strokeColor = UIColor.blue.CGColor 26 | 27 | // Set the duration time 28 | self.button.duration = 0.5 29 | 30 | // Set the fill color 31 | self.button.fillColor = UIColor.red.CGColor 32 | 33 | // Set the line width 34 | self.button.lineWidth = 2.5 35 | ``` 36 | 37 | Credit 38 | =============== 39 | This project is highly inspired by [Robert Böhnke](http://robb.is/working-on/a-hamburger-button-transition/) 40 | And [CreativeDash team](https://dribbble.com/Creativedash) 41 | -------------------------------------------------------------------------------- /PlayPauseButton/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | Launch Screen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /PlayPauseButton.xcodeproj/project.xcworkspace/xcshareddata/PlayPauseButton.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | B88CF7EC-E2F5-4FC9-9E43-E86A6A2307DB 9 | IDESourceControlProjectName 10 | PlayPauseButton 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 0D471CA39623AC73657A4526DDD20A90A47B65C6 14 | github.com:KelvinJin/PlayPauseButton.git 15 | 16 | IDESourceControlProjectPath 17 | PlayPauseButton.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 0D471CA39623AC73657A4526DDD20A90A47B65C6 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:KelvinJin/PlayPauseButton.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 0D471CA39623AC73657A4526DDD20A90A47B65C6 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 0D471CA39623AC73657A4526DDD20A90A47B65C6 36 | IDESourceControlWCCName 37 | PlayPauseButton 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /PlayPauseButton/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 | -------------------------------------------------------------------------------- /PlayPauseButton/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // PlayPauseButton 4 | // 5 | // Created by Jin Wang on 2/09/2014. 6 | // Copyright (c) 2014 UThoft. 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 | return true 19 | } 20 | 21 | func applicationWillResignActive(_ application: UIApplication) { 22 | // 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. 23 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 24 | } 25 | 26 | func applicationDidEnterBackground(_ application: UIApplication) { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | func applicationWillEnterForeground(_ application: UIApplication) { 32 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 33 | } 34 | 35 | func applicationDidBecomeActive(_ application: UIApplication) { 36 | // 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. 37 | } 38 | 39 | func applicationWillTerminate(_ application: UIApplication) { 40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 41 | } 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /PlayPauseButton/Launch Screen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /PlayPauseButton/PlayPauseButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlayPauseButton.swift 3 | // PlayPauseButton 4 | // 5 | // Created by Jin Wang on 2/09/2014. 6 | // Copyright (c) 2014 UThoft. All rights reserved. 7 | // 8 | 9 | //import CoreGraphics 10 | import QuartzCore 11 | import UIKit 12 | 13 | class PlayPauseButton : UIButton { 14 | 15 | var top: CAShapeLayer! = CAShapeLayer() 16 | var bottom: CAShapeLayer! = CAShapeLayer() 17 | var left: CAShapeLayer! = CAShapeLayer() 18 | 19 | let topStrokeStart: CGFloat = 0.00 20 | let topStrokeEnd: CGFloat = 0.212 21 | 22 | let topStrokeStartToValue: CGFloat = 0.7 23 | let topStrokeEndToValue: CGFloat = 1.0 24 | 25 | let bottomStrokeStart: CGFloat = 0.00 26 | let bottomStrokeEnd: CGFloat = 0.085 27 | 28 | let bottomStrokeStartToValue: CGFloat = 0.30 29 | let bottomStrokeEndToValue: CGFloat = 0.96 30 | 31 | var duration = 0.7 32 | 33 | var lineWidth: CGFloat = 4 { 34 | didSet { 35 | for layer in [ self.top, self.left, self.bottom ] { 36 | layer?.lineWidth = lineWidth 37 | } 38 | self.setNeedsDisplay() 39 | } 40 | } 41 | var miterLimit: CGFloat = 4 { 42 | didSet { 43 | for layer in [ self.top, self.left, self.bottom ] { 44 | layer?.miterLimit = miterLimit 45 | } 46 | self.setNeedsDisplay() 47 | } 48 | } 49 | var fillColor: CGColor? { 50 | didSet { 51 | self.bottom.fillColor = fillColor 52 | self.setNeedsDisplay() 53 | } 54 | } 55 | 56 | var strokeColor: CGColor = UIColor.white.cgColor { 57 | didSet { 58 | for layer in [ self.top, self.left, self.bottom ] { 59 | layer?.strokeColor = strokeColor 60 | } 61 | self.setNeedsDisplay() 62 | } 63 | } 64 | 65 | required init?(coder aDecoder: NSCoder) { 66 | super.init(coder: aDecoder) 67 | } 68 | 69 | override init(frame: CGRect) { 70 | super.init(frame: frame) 71 | 72 | self.left.path = leftPath(frame) 73 | self.top.path = topPath(frame) 74 | self.bottom.path = bottomPath(frame) 75 | 76 | for layer in [ self.bottom, self.left, self.top ] { 77 | layer?.fillColor = fillColor 78 | layer?.strokeColor = strokeColor 79 | layer?.lineWidth = lineWidth 80 | layer?.miterLimit = miterLimit 81 | layer?.lineCap = kCALineCapRound 82 | layer?.masksToBounds = true 83 | layer?.anchorPoint = CGPoint(x: 0, y: 0) 84 | 85 | let strokingPath = CGPath(__byStroking: (layer?.path!)!, transform: nil, lineWidth: 4, lineCap: CGLineCap.round, lineJoin: CGLineJoin.round, miterLimit: 4) 86 | 87 | layer?.bounds = (strokingPath?.boundingBoxOfPath)! 88 | 89 | layer?.actions = [ 90 | "strokeStart": NSNull(), 91 | "strokeEnd": NSNull(), 92 | "transform": NSNull() 93 | ] 94 | 95 | self.layer.addSublayer(layer!) 96 | } 97 | 98 | self.top.position = CGPoint(x: self.bounds.midX - self.top.bounds.size.width / 2, 99 | y: self.bounds.midY - self.top.bounds.size.height / 2) 100 | self.top.strokeStart = topStrokeStart 101 | self.top.strokeEnd = topStrokeEnd 102 | 103 | self.left.position = self.top.position 104 | self.left.strokeStart = 0.0 105 | self.left.strokeEnd = 1.0 106 | 107 | self.bottom.position = CGPoint(x: self.bounds.midX - self.bottom.bounds.size.width / 2, 108 | y: self.bounds.midY - self.bottom.bounds.size.height / 2) 109 | self.bottom.strokeStart = bottomStrokeStart 110 | self.bottom.strokeEnd = bottomStrokeEnd 111 | 112 | } 113 | 114 | func leftPath(_ frame: CGRect) -> CGPath { 115 | let path = UIBezierPath() 116 | path.move(to: CGPoint(x: frame.minX + 0.36553 * frame.width, y: frame.minY + 0.22612 * frame.height)) 117 | path.addLine(to: CGPoint(x: frame.minX + 0.36553 * frame.width, y: frame.minY + 0.77388 * frame.height)) 118 | 119 | return path.cgPath 120 | } 121 | 122 | func topPath(_ frame: CGRect) -> CGPath { 123 | let thePath = UIBezierPath() 124 | thePath.move(to: CGPoint(x: frame.minX + 0.63447 * frame.width, y: frame.minY + 0.50000 * frame.height)) 125 | thePath.addLine(to: CGPoint(x: frame.minX + 0.36553 * frame.width, y: frame.minY + 0.22612 * frame.height)) 126 | thePath.addLine(to: CGPoint(x: frame.minX + 0.36553 * frame.width, y: frame.minY + 0.77388 * frame.height)) 127 | thePath.addLine(to: CGPoint(x: frame.minX + 0.63447 * frame.width, y: frame.minY + 0.77388 * frame.height)) 128 | thePath.addLine(to: CGPoint(x: frame.minX + 0.63447 * frame.width, y: frame.minY + 0.22612 * frame.height)) 129 | 130 | return thePath.cgPath 131 | } 132 | 133 | func bottomPath(_ frame: CGRect) -> CGPath { 134 | let myPath = UIBezierPath() 135 | 136 | myPath.move(to: CGPoint(x: frame.minX + 0.36553 * frame.width, y: frame.minY + 0.77388 * frame.height)) 137 | myPath.addLine(to: CGPoint(x: frame.minX + 0.79584 * frame.width, y: frame.minY + 0.33567 * frame.height)) 138 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.82273 * frame.width, y: frame.minY + 0.25351 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.79584 * frame.width, y: frame.minY + 0.33567 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.82273 * frame.width, y: frame.minY + 0.29459 * frame.height)) 139 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.76895 * frame.width, y: frame.minY + 0.14396 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.82273 * frame.width, y: frame.minY + 0.21243 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.79937 * frame.width, y: frame.minY + 0.17494 * frame.height)) 140 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.63447 * frame.width, y: frame.minY + 0.05494 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.72860 * frame.width, y: frame.minY + 0.10287 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.63447 * frame.width, y: frame.minY + 0.05494 * frame.height)) 141 | 142 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.60931 * frame.width, y: frame.minY + 0.04784 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.62812 * frame.width, y: frame.minY + 0.05286 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.61874 * frame.width, y: frame.minY + 0.05019 * frame.height)) 143 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.58750 * frame.width, y: frame.minY + 0.04296 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.60207 * frame.width, y: frame.minY + 0.04603 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.59480 * frame.width, y: frame.minY + 0.04440 * frame.height)) 144 | 145 | // The following curve will be duplicated at last 146 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.17671 * frame.width, y: frame.minY + 0.17077 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.44336 * frame.width, y: frame.minY + 0.01448 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.28835 * frame.width, y: frame.minY + 0.05708 * frame.height)) 147 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.17671 * frame.width, y: frame.minY + 0.82923 * frame.height), controlPoint1: CGPoint(x: frame.minX + -0.00184 * frame.width, y: frame.minY + 0.35260 * frame.height), controlPoint2: CGPoint(x: frame.minX + -0.00184 * frame.width, y: frame.minY + 0.64740 * frame.height)) 148 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.82329 * frame.width, y: frame.minY + 0.82923 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.35526 * frame.width, y: frame.minY + 1.01105 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.64474 * frame.width, y: frame.minY + 1.01105 * frame.height)) 149 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.82329 * frame.width, y: frame.minY + 0.17077 * frame.height), controlPoint1: CGPoint(x: frame.minX + 1.00184 * frame.width, y: frame.minY + 0.64740 * frame.height), controlPoint2: CGPoint(x: frame.minX + 1.00184 * frame.width, y: frame.minY + 0.35260 * frame.height)) 150 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.63742 * frame.width, y: frame.minY + 0.05583 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.76941 * frame.width, y: frame.minY + 0.11590 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.70542 * frame.width, y: frame.minY + 0.07758 * frame.height)) 151 | // Duplication here 152 | myPath.addCurve(to: CGPoint(x: frame.minX + 0.17671 * frame.width, y: frame.minY + 0.17077 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.44336 * frame.width, y: frame.minY + 0.01448 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.28835 * frame.width, y: frame.minY + 0.05708 * frame.height)) 153 | 154 | return myPath.cgPath 155 | } 156 | 157 | 158 | var showsMenu: Bool = false { 159 | didSet { 160 | let strokeStart = CABasicAnimation(keyPath: "strokeStart") 161 | let strokeEnd = CABasicAnimation(keyPath: "strokeEnd") 162 | 163 | 164 | if self.showsMenu { 165 | strokeStart.toValue = bottomStrokeStartToValue 166 | strokeStart.duration = duration 167 | strokeStart.timingFunction = CAMediaTimingFunction(controlPoints: 0.38, 0.14, 0.35, 2) 168 | 169 | strokeEnd.toValue = bottomStrokeEndToValue 170 | strokeEnd.duration = duration * 1.1 171 | strokeEnd.timingFunction = CAMediaTimingFunction(controlPoints: 0.38, 0.14, 0, 1.26) 172 | } else { 173 | strokeStart.toValue = bottomStrokeStart 174 | strokeStart.duration = duration 175 | strokeStart.timingFunction = CAMediaTimingFunction(controlPoints: 0.34, -0.43, 0.48, -0.4) 176 | // strokeStart.beginTime = CACurrentMediaTime() + 0.1 177 | // strokeStart.fillMode = kCAFillModeBackwards 178 | 179 | strokeEnd.toValue = bottomStrokeEnd 180 | strokeEnd.duration = duration * 1.1 181 | strokeEnd.timingFunction = CAMediaTimingFunction(controlPoints: 0.13, -0.47, 0.79, 1.0) 182 | 183 | } 184 | 185 | self.bottom.ocb_applyAnimation(strokeStart) 186 | self.bottom.ocb_applyAnimation(strokeEnd) 187 | 188 | if self.showsMenu { 189 | strokeStart.toValue = topStrokeStartToValue 190 | strokeStart.duration = duration 191 | strokeStart.timingFunction = CAMediaTimingFunction(controlPoints: 0.8, -0.3, 0.65, 1.0) 192 | 193 | strokeEnd.toValue = topStrokeEndToValue 194 | strokeEnd.duration = duration * 1.1 195 | strokeEnd.timingFunction = CAMediaTimingFunction(controlPoints: 0.6, -0.44, 0.13, 0.97) 196 | } else { 197 | strokeStart.toValue = topStrokeStart 198 | strokeStart.duration = duration 199 | strokeStart.timingFunction = CAMediaTimingFunction(controlPoints: 0.6, 0, 0.13, 0.97) 200 | // strokeStart.beginTime = CACurrentMediaTime() + 0.1 201 | // strokeStart.fillMode = kCAFillModeBackwards 202 | 203 | strokeEnd.toValue = topStrokeEnd 204 | strokeEnd.duration = duration * 1.1 205 | strokeEnd.timingFunction = CAMediaTimingFunction(controlPoints: 0.8, -0.3, 0.65, 1.52) 206 | } 207 | 208 | self.top.ocb_applyAnimation(strokeStart) 209 | self.top.ocb_applyAnimation(strokeEnd) 210 | 211 | } 212 | } 213 | } 214 | 215 | extension CALayer { 216 | func ocb_applyAnimation(_ animation: CABasicAnimation) { 217 | let copy = animation.copy() as! CABasicAnimation 218 | 219 | if copy.fromValue == nil { 220 | copy.fromValue = self.presentation()!.value(forKeyPath: copy.keyPath!) 221 | } 222 | copy.isRemovedOnCompletion = false; 223 | copy.fillMode = kCAFillModeForwards; 224 | // The animation object is already copied in the following method. So probably we don't need copy here. 225 | self.add(copy, forKey: copy.keyPath) 226 | 227 | // self.setValue(copy.toValue, forKeyPath:copy.keyPath) 228 | } 229 | } 230 | -------------------------------------------------------------------------------- /PlayPauseButton.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 293589EA19B4D768004867B9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 293589E919B4D768004867B9 /* AppDelegate.swift */; }; 11 | 293589EC19B4D768004867B9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 293589EB19B4D768004867B9 /* ViewController.swift */; }; 12 | 293589EF19B4D768004867B9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 293589ED19B4D768004867B9 /* Main.storyboard */; }; 13 | 293589F119B4D768004867B9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 293589F019B4D768004867B9 /* Images.xcassets */; }; 14 | 293589FD19B4D768004867B9 /* PlayPauseButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 293589FC19B4D768004867B9 /* PlayPauseButtonTests.swift */; }; 15 | 29358A0719B58D50004867B9 /* PlayPauseButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29358A0619B58D50004867B9 /* PlayPauseButton.swift */; }; 16 | 294CA0E71CEBEBD50064B62C /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 294CA0E61CEBEBD50064B62C /* Launch Screen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 293589F719B4D768004867B9 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 293589DC19B4D768004867B9 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 293589E319B4D768004867B9; 25 | remoteInfo = PlayPauseButton; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 293589E419B4D768004867B9 /* PlayPauseButton.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PlayPauseButton.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 293589E819B4D768004867B9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 293589E919B4D768004867B9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33 | 293589EB19B4D768004867B9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 34 | 293589EE19B4D768004867B9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 35 | 293589F019B4D768004867B9 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 36 | 293589F619B4D768004867B9 /* PlayPauseButtonTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PlayPauseButtonTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 293589FB19B4D768004867B9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 293589FC19B4D768004867B9 /* PlayPauseButtonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayPauseButtonTests.swift; sourceTree = ""; }; 39 | 29358A0619B58D50004867B9 /* PlayPauseButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayPauseButton.swift; sourceTree = ""; }; 40 | 294CA0E61CEBEBD50064B62C /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 293589E119B4D768004867B9 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | 293589F319B4D768004867B9 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | 293589DB19B4D768004867B9 = { 62 | isa = PBXGroup; 63 | children = ( 64 | 293589E619B4D768004867B9 /* PlayPauseButton */, 65 | 293589F919B4D768004867B9 /* PlayPauseButtonTests */, 66 | 293589E519B4D768004867B9 /* Products */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | 293589E519B4D768004867B9 /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 293589E419B4D768004867B9 /* PlayPauseButton.app */, 74 | 293589F619B4D768004867B9 /* PlayPauseButtonTests.xctest */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | 293589E619B4D768004867B9 /* PlayPauseButton */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 293589E919B4D768004867B9 /* AppDelegate.swift */, 83 | 293589EB19B4D768004867B9 /* ViewController.swift */, 84 | 293589ED19B4D768004867B9 /* Main.storyboard */, 85 | 293589F019B4D768004867B9 /* Images.xcassets */, 86 | 293589E719B4D768004867B9 /* Supporting Files */, 87 | 29358A0619B58D50004867B9 /* PlayPauseButton.swift */, 88 | 294CA0E61CEBEBD50064B62C /* Launch Screen.storyboard */, 89 | ); 90 | path = PlayPauseButton; 91 | sourceTree = ""; 92 | }; 93 | 293589E719B4D768004867B9 /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 293589E819B4D768004867B9 /* Info.plist */, 97 | ); 98 | name = "Supporting Files"; 99 | sourceTree = ""; 100 | }; 101 | 293589F919B4D768004867B9 /* PlayPauseButtonTests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 293589FC19B4D768004867B9 /* PlayPauseButtonTests.swift */, 105 | 293589FA19B4D768004867B9 /* Supporting Files */, 106 | ); 107 | path = PlayPauseButtonTests; 108 | sourceTree = ""; 109 | }; 110 | 293589FA19B4D768004867B9 /* Supporting Files */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 293589FB19B4D768004867B9 /* Info.plist */, 114 | ); 115 | name = "Supporting Files"; 116 | sourceTree = ""; 117 | }; 118 | /* End PBXGroup section */ 119 | 120 | /* Begin PBXNativeTarget section */ 121 | 293589E319B4D768004867B9 /* PlayPauseButton */ = { 122 | isa = PBXNativeTarget; 123 | buildConfigurationList = 29358A0019B4D768004867B9 /* Build configuration list for PBXNativeTarget "PlayPauseButton" */; 124 | buildPhases = ( 125 | 293589E019B4D768004867B9 /* Sources */, 126 | 293589E119B4D768004867B9 /* Frameworks */, 127 | 293589E219B4D768004867B9 /* Resources */, 128 | ); 129 | buildRules = ( 130 | ); 131 | dependencies = ( 132 | ); 133 | name = PlayPauseButton; 134 | productName = PlayPauseButton; 135 | productReference = 293589E419B4D768004867B9 /* PlayPauseButton.app */; 136 | productType = "com.apple.product-type.application"; 137 | }; 138 | 293589F519B4D768004867B9 /* PlayPauseButtonTests */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = 29358A0319B4D768004867B9 /* Build configuration list for PBXNativeTarget "PlayPauseButtonTests" */; 141 | buildPhases = ( 142 | 293589F219B4D768004867B9 /* Sources */, 143 | 293589F319B4D768004867B9 /* Frameworks */, 144 | 293589F419B4D768004867B9 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | 293589F819B4D768004867B9 /* PBXTargetDependency */, 150 | ); 151 | name = PlayPauseButtonTests; 152 | productName = PlayPauseButtonTests; 153 | productReference = 293589F619B4D768004867B9 /* PlayPauseButtonTests.xctest */; 154 | productType = "com.apple.product-type.bundle.unit-test"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | 293589DC19B4D768004867B9 /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | LastSwiftMigration = 0730; 163 | LastSwiftUpdateCheck = 0730; 164 | LastUpgradeCheck = 0800; 165 | ORGANIZATIONNAME = UThoft; 166 | TargetAttributes = { 167 | 293589E319B4D768004867B9 = { 168 | CreatedOnToolsVersion = 6.0; 169 | DevelopmentTeam = MG8YZ6JLG6; 170 | LastSwiftMigration = 0800; 171 | }; 172 | 293589F519B4D768004867B9 = { 173 | CreatedOnToolsVersion = 6.0; 174 | DevelopmentTeam = MG8YZ6JLG6; 175 | LastSwiftMigration = 0800; 176 | TestTargetID = 293589E319B4D768004867B9; 177 | }; 178 | }; 179 | }; 180 | buildConfigurationList = 293589DF19B4D768004867B9 /* Build configuration list for PBXProject "PlayPauseButton" */; 181 | compatibilityVersion = "Xcode 3.2"; 182 | developmentRegion = English; 183 | hasScannedForEncodings = 0; 184 | knownRegions = ( 185 | en, 186 | Base, 187 | ); 188 | mainGroup = 293589DB19B4D768004867B9; 189 | productRefGroup = 293589E519B4D768004867B9 /* Products */; 190 | projectDirPath = ""; 191 | projectRoot = ""; 192 | targets = ( 193 | 293589E319B4D768004867B9 /* PlayPauseButton */, 194 | 293589F519B4D768004867B9 /* PlayPauseButtonTests */, 195 | ); 196 | }; 197 | /* End PBXProject section */ 198 | 199 | /* Begin PBXResourcesBuildPhase section */ 200 | 293589E219B4D768004867B9 /* Resources */ = { 201 | isa = PBXResourcesBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | 294CA0E71CEBEBD50064B62C /* Launch Screen.storyboard in Resources */, 205 | 293589EF19B4D768004867B9 /* Main.storyboard in Resources */, 206 | 293589F119B4D768004867B9 /* Images.xcassets in Resources */, 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | }; 210 | 293589F419B4D768004867B9 /* Resources */ = { 211 | isa = PBXResourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | }; 217 | /* End PBXResourcesBuildPhase section */ 218 | 219 | /* Begin PBXSourcesBuildPhase section */ 220 | 293589E019B4D768004867B9 /* Sources */ = { 221 | isa = PBXSourcesBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | 293589EC19B4D768004867B9 /* ViewController.swift in Sources */, 225 | 29358A0719B58D50004867B9 /* PlayPauseButton.swift in Sources */, 226 | 293589EA19B4D768004867B9 /* AppDelegate.swift in Sources */, 227 | ); 228 | runOnlyForDeploymentPostprocessing = 0; 229 | }; 230 | 293589F219B4D768004867B9 /* Sources */ = { 231 | isa = PBXSourcesBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | 293589FD19B4D768004867B9 /* PlayPauseButtonTests.swift in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXTargetDependency section */ 241 | 293589F819B4D768004867B9 /* PBXTargetDependency */ = { 242 | isa = PBXTargetDependency; 243 | target = 293589E319B4D768004867B9 /* PlayPauseButton */; 244 | targetProxy = 293589F719B4D768004867B9 /* PBXContainerItemProxy */; 245 | }; 246 | /* End PBXTargetDependency section */ 247 | 248 | /* Begin PBXVariantGroup section */ 249 | 293589ED19B4D768004867B9 /* Main.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 293589EE19B4D768004867B9 /* Base */, 253 | ); 254 | name = Main.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 293589FE19B4D768004867B9 /* Debug */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ALWAYS_SEARCH_USER_PATHS = NO; 264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 265 | CLANG_CXX_LIBRARY = "libc++"; 266 | CLANG_ENABLE_MODULES = YES; 267 | CLANG_ENABLE_OBJC_ARC = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INFINITE_RECURSION = YES; 274 | CLANG_WARN_INT_CONVERSION = YES; 275 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 276 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 277 | CLANG_WARN_UNREACHABLE_CODE = YES; 278 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 279 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 280 | COPY_PHASE_STRIP = NO; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | ENABLE_TESTABILITY = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_DYNAMIC_NO_PIC = NO; 285 | GCC_NO_COMMON_BLOCKS = YES; 286 | GCC_OPTIMIZATION_LEVEL = 0; 287 | GCC_PREPROCESSOR_DEFINITIONS = ( 288 | "DEBUG=1", 289 | "$(inherited)", 290 | ); 291 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 294 | GCC_WARN_UNDECLARED_SELECTOR = YES; 295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 296 | GCC_WARN_UNUSED_FUNCTION = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 299 | MTL_ENABLE_DEBUG_INFO = YES; 300 | ONLY_ACTIVE_ARCH = YES; 301 | SDKROOT = iphoneos; 302 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 303 | }; 304 | name = Debug; 305 | }; 306 | 293589FF19B4D768004867B9 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ALWAYS_SEARCH_USER_PATHS = NO; 310 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 311 | CLANG_CXX_LIBRARY = "libc++"; 312 | CLANG_ENABLE_MODULES = YES; 313 | CLANG_ENABLE_OBJC_ARC = YES; 314 | CLANG_WARN_BOOL_CONVERSION = YES; 315 | CLANG_WARN_CONSTANT_CONVERSION = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 322 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 323 | CLANG_WARN_UNREACHABLE_CODE = YES; 324 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 325 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 326 | COPY_PHASE_STRIP = YES; 327 | ENABLE_NS_ASSERTIONS = NO; 328 | ENABLE_STRICT_OBJC_MSGSEND = YES; 329 | GCC_C_LANGUAGE_STANDARD = gnu99; 330 | GCC_NO_COMMON_BLOCKS = YES; 331 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 332 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 333 | GCC_WARN_UNDECLARED_SELECTOR = YES; 334 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 335 | GCC_WARN_UNUSED_FUNCTION = YES; 336 | GCC_WARN_UNUSED_VARIABLE = YES; 337 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 338 | MTL_ENABLE_DEBUG_INFO = NO; 339 | SDKROOT = iphoneos; 340 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 341 | VALIDATE_PRODUCT = YES; 342 | }; 343 | name = Release; 344 | }; 345 | 29358A0119B4D768004867B9 /* Debug */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 349 | DEVELOPMENT_TEAM = MG8YZ6JLG6; 350 | INFOPLIST_FILE = PlayPauseButton/Info.plist; 351 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 352 | PRODUCT_BUNDLE_IDENTIFIER = "com.Uthoft.$(PRODUCT_NAME:rfc1034identifier)"; 353 | PRODUCT_NAME = "$(TARGET_NAME)"; 354 | SWIFT_VERSION = 3.0; 355 | }; 356 | name = Debug; 357 | }; 358 | 29358A0219B4D768004867B9 /* Release */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 362 | DEVELOPMENT_TEAM = MG8YZ6JLG6; 363 | INFOPLIST_FILE = PlayPauseButton/Info.plist; 364 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 365 | PRODUCT_BUNDLE_IDENTIFIER = "com.Uthoft.$(PRODUCT_NAME:rfc1034identifier)"; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | SWIFT_VERSION = 3.0; 368 | }; 369 | name = Release; 370 | }; 371 | 29358A0419B4D768004867B9 /* Debug */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | BUNDLE_LOADER = "$(TEST_HOST)"; 375 | DEVELOPMENT_TEAM = MG8YZ6JLG6; 376 | GCC_PREPROCESSOR_DEFINITIONS = ( 377 | "DEBUG=1", 378 | "$(inherited)", 379 | ); 380 | INFOPLIST_FILE = PlayPauseButtonTests/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 382 | PRODUCT_BUNDLE_IDENTIFIER = "com.Uthoft.$(PRODUCT_NAME:rfc1034identifier)"; 383 | PRODUCT_NAME = "$(TARGET_NAME)"; 384 | SWIFT_VERSION = 3.0; 385 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PlayPauseButton.app/PlayPauseButton"; 386 | }; 387 | name = Debug; 388 | }; 389 | 29358A0519B4D768004867B9 /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | BUNDLE_LOADER = "$(TEST_HOST)"; 393 | DEVELOPMENT_TEAM = MG8YZ6JLG6; 394 | INFOPLIST_FILE = PlayPauseButtonTests/Info.plist; 395 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 396 | PRODUCT_BUNDLE_IDENTIFIER = "com.Uthoft.$(PRODUCT_NAME:rfc1034identifier)"; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | SWIFT_VERSION = 3.0; 399 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PlayPauseButton.app/PlayPauseButton"; 400 | }; 401 | name = Release; 402 | }; 403 | /* End XCBuildConfiguration section */ 404 | 405 | /* Begin XCConfigurationList section */ 406 | 293589DF19B4D768004867B9 /* Build configuration list for PBXProject "PlayPauseButton" */ = { 407 | isa = XCConfigurationList; 408 | buildConfigurations = ( 409 | 293589FE19B4D768004867B9 /* Debug */, 410 | 293589FF19B4D768004867B9 /* Release */, 411 | ); 412 | defaultConfigurationIsVisible = 0; 413 | defaultConfigurationName = Release; 414 | }; 415 | 29358A0019B4D768004867B9 /* Build configuration list for PBXNativeTarget "PlayPauseButton" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | 29358A0119B4D768004867B9 /* Debug */, 419 | 29358A0219B4D768004867B9 /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | 29358A0319B4D768004867B9 /* Build configuration list for PBXNativeTarget "PlayPauseButtonTests" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | 29358A0419B4D768004867B9 /* Debug */, 428 | 29358A0519B4D768004867B9 /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | /* End XCConfigurationList section */ 434 | }; 435 | rootObject = 293589DC19B4D768004867B9 /* Project object */; 436 | } 437 | --------------------------------------------------------------------------------