├── Example ├── Example │ ├── Podfile │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── Images.xcassets │ │ ├── Contents.json │ │ ├── Default-flat.imageset │ │ │ ├── Default-flat@2x.png │ │ │ └── Contents.json │ │ ├── chooser-button-tab.imageset │ │ │ ├── chooser-button-tab.png │ │ │ ├── chooser-button-tab@2x.png │ │ │ └── Contents.json │ │ ├── chooser-button-input.imageset │ │ │ ├── chooser-button-input.png │ │ │ ├── chooser-button-input@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-button.imageset │ │ │ ├── chooser-moment-button.png │ │ │ ├── chooser-moment-button@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-camera.imageset │ │ │ ├── chooser-moment-icon-camera.png │ │ │ ├── chooser-moment-icon-camera@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-music.imageset │ │ │ ├── chooser-moment-icon-music.png │ │ │ ├── chooser-moment-icon-music@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-place.imageset │ │ │ ├── chooser-moment-icon-place.png │ │ │ ├── chooser-moment-icon-place@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-sleep.imageset │ │ │ ├── chooser-moment-icon-sleep.png │ │ │ ├── chooser-moment-icon-sleep@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-thought.imageset │ │ │ ├── chooser-moment-icon-thought.png │ │ │ ├── chooser-moment-icon-thought@2x.png │ │ │ └── Contents.json │ │ ├── chooser-button-tab-highlighted.imageset │ │ │ ├── chooser-button-tab-highlighted.png │ │ │ ├── chooser-button-tab-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-button-input-highlighted.imageset │ │ │ ├── chooser-button-input-highlighted.png │ │ │ ├── chooser-button-input-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-button-highlighted.imageset │ │ │ ├── chooser-moment-button-highlighted.png │ │ │ ├── chooser-moment-button-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-music-highlighted.imageset │ │ │ ├── chooser-moment-icon-music-highlighted.png │ │ │ ├── chooser-moment-icon-music-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-place-highlighted.imageset │ │ │ ├── chooser-moment-icon-place-highlighted.png │ │ │ ├── chooser-moment-icon-place-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-sleep-highlighted.imageset │ │ │ ├── chooser-moment-icon-sleep-highlighted.png │ │ │ ├── chooser-moment-icon-sleep-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-camera-highlighted.imageset │ │ │ ├── chooser-moment-icon-camera-highlighted.png │ │ │ ├── chooser-moment-icon-camera-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-thought-highlighted.imageset │ │ │ ├── chooser-moment-icon-thought-highlighted.png │ │ │ ├── chooser-moment-icon-thought-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── TabBarViewController.h │ ├── UIScrollViewController.h │ ├── ViewController.h │ ├── BarButtonItemViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── Example-Prefix.pch │ ├── Example-Info.plist │ ├── AppDelegate.m │ ├── BarButtonItemViewController.m │ ├── UIScrollViewController.m │ ├── TabBarViewController.m │ └── ViewController.m ├── ExampleTests │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── DCPathButtonTestObject.h │ ├── ExampleTests-Info.plist │ ├── ExampleTests.m │ └── DCPathButtonTestObject.m ├── Default-568h@2x.png ├── Podfile ├── Example.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── Example.xccheckout │ └── xcshareddata │ │ └── xcschemes │ │ └── Example.xcscheme ├── Example.xcworkspace │ └── contents.xcworkspacedata └── Podfile.lock ├── ScreenShot ├── 0.png ├── 1.png ├── 2.png ├── 3.png ├── 4.png └── 5.png ├── DCPathButton ├── Sounds │ ├── fold.caf │ ├── bloom.caf │ └── selected.caf └── Classes │ ├── DCPathItemButton.h │ ├── DCPathItemButton.m │ └── DCPathButton.h ├── Example-Swift ├── DCPathButton │ ├── Sounds │ │ ├── bloom.caf │ │ ├── fold.caf │ │ └── selected.caf │ └── Classes │ │ ├── DCPathItemButton.h │ │ ├── DCPathItemButton.m │ │ ├── DCPathButton.h │ │ └── DCPathButton.m ├── Example-Swift │ ├── Images.xcassets │ │ ├── Default-flat.imageset │ │ │ ├── Default-flat@2x.png │ │ │ └── Contents.json │ │ ├── chooser-button-tab.imageset │ │ │ ├── chooser-button-tab.png │ │ │ ├── chooser-button-tab@2x.png │ │ │ └── Contents.json │ │ ├── chooser-button-input.imageset │ │ │ ├── chooser-button-input.png │ │ │ ├── chooser-button-input@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-button.imageset │ │ │ ├── chooser-moment-button.png │ │ │ ├── chooser-moment-button@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-music.imageset │ │ │ ├── chooser-moment-icon-music.png │ │ │ ├── chooser-moment-icon-music@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-place.imageset │ │ │ ├── chooser-moment-icon-place.png │ │ │ ├── chooser-moment-icon-place@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-sleep.imageset │ │ │ ├── chooser-moment-icon-sleep.png │ │ │ ├── chooser-moment-icon-sleep@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-camera.imageset │ │ │ ├── chooser-moment-icon-camera.png │ │ │ ├── chooser-moment-icon-camera@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-thought.imageset │ │ │ ├── chooser-moment-icon-thought.png │ │ │ ├── chooser-moment-icon-thought@2x.png │ │ │ └── Contents.json │ │ ├── chooser-button-tab-highlighted.imageset │ │ │ ├── chooser-button-tab-highlighted.png │ │ │ ├── chooser-button-tab-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-button-input-highlighted.imageset │ │ │ ├── chooser-button-input-highlighted.png │ │ │ ├── chooser-button-input-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-button-highlighted.imageset │ │ │ ├── chooser-moment-button-highlighted.png │ │ │ ├── chooser-moment-button-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-music-highlighted.imageset │ │ │ ├── chooser-moment-icon-music-highlighted.png │ │ │ ├── chooser-moment-icon-music-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-place-highlighted.imageset │ │ │ ├── chooser-moment-icon-place-highlighted.png │ │ │ ├── chooser-moment-icon-place-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-sleep-highlighted.imageset │ │ │ ├── chooser-moment-icon-sleep-highlighted.png │ │ │ ├── chooser-moment-icon-sleep-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-camera-highlighted.imageset │ │ │ ├── chooser-moment-icon-camera-highlighted.png │ │ │ ├── chooser-moment-icon-camera-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── chooser-moment-icon-thought-highlighted.imageset │ │ │ ├── chooser-moment-icon-thought-highlighted.png │ │ │ ├── chooser-moment-icon-thought-highlighted@2x.png │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── Info.plist │ ├── AppDelegate.swift │ ├── ViewController.swift │ └── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard ├── Example-Swift-Bridging-Header.h ├── Example-Swift.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── Example-Swift.xccheckout │ └── project.pbxproj └── Example-SwiftTests │ ├── Info.plist │ └── Example_SwiftTests.swift ├── Gemfile ├── .travis.yml ├── .gitignore ├── DCPathButton.podspec.json ├── LISENCE ├── fastlane ├── README.md └── Fastfile ├── Gemfile.lock └── README.md /Example/Example/Podfile: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ScreenShot/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/ScreenShot/0.png -------------------------------------------------------------------------------- /ScreenShot/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/ScreenShot/1.png -------------------------------------------------------------------------------- /ScreenShot/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/ScreenShot/2.png -------------------------------------------------------------------------------- /ScreenShot/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/ScreenShot/3.png -------------------------------------------------------------------------------- /ScreenShot/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/ScreenShot/4.png -------------------------------------------------------------------------------- /ScreenShot/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/ScreenShot/5.png -------------------------------------------------------------------------------- /Example/Example/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/ExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /DCPathButton/Sounds/fold.caf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/DCPathButton/Sounds/fold.caf -------------------------------------------------------------------------------- /Example/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Default-568h@2x.png -------------------------------------------------------------------------------- /DCPathButton/Sounds/bloom.caf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/DCPathButton/Sounds/bloom.caf -------------------------------------------------------------------------------- /DCPathButton/Sounds/selected.caf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/DCPathButton/Sounds/selected.caf -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example-Swift/DCPathButton/Sounds/bloom.caf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/DCPathButton/Sounds/bloom.caf -------------------------------------------------------------------------------- /Example-Swift/DCPathButton/Sounds/fold.caf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/DCPathButton/Sounds/fold.caf -------------------------------------------------------------------------------- /Example-Swift/DCPathButton/Sounds/selected.caf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/DCPathButton/Sounds/selected.caf -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/Default-flat.imageset/Default-flat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/Default-flat.imageset/Default-flat@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-tab.imageset/chooser-button-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-button-tab.imageset/chooser-button-tab.png -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # Autogenerated by fastlane 2 | # 3 | # Ensure this file is checked in to source control! 4 | 5 | source "https://rubygems.org" 6 | 7 | gem "cocoapods", '~>1.3.1' 8 | gem "fastlane", '~>2.61.0' 9 | 10 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/Default-flat.imageset/Default-flat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/Default-flat.imageset/Default-flat@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-tab.imageset/chooser-button-tab@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-button-tab.imageset/chooser-button-tab@2x.png -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | 3 | target 'Example' do 4 | pod 'DCPathButton', :path => "../DCPathButton.podspec" 5 | 6 | target "ExampleTests" do 7 | inherit! :search_paths 8 | end 9 | 10 | end -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-input.imageset/chooser-button-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-button-input.imageset/chooser-button-input.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-button.imageset/chooser-moment-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-button.imageset/chooser-moment-button.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-input.imageset/chooser-button-input@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-button-input.imageset/chooser-button-input@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-button.imageset/chooser-moment-button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-button.imageset/chooser-moment-button@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab.imageset/chooser-button-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab.imageset/chooser-button-tab.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-input.imageset/chooser-button-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-button-input.imageset/chooser-button-input.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab.imageset/chooser-button-tab@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab.imageset/chooser-button-tab@2x.png -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-camera.imageset/chooser-moment-icon-camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-camera.imageset/chooser-moment-icon-camera.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-music.imageset/chooser-moment-icon-music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-music.imageset/chooser-moment-icon-music.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-place.imageset/chooser-moment-icon-place.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-place.imageset/chooser-moment-icon-place.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-sleep.imageset/chooser-moment-icon-sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-sleep.imageset/chooser-moment-icon-sleep.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button.imageset/chooser-moment-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button.imageset/chooser-moment-button.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-music.imageset/chooser-moment-icon-music@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-music.imageset/chooser-moment-icon-music@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-place.imageset/chooser-moment-icon-place@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-place.imageset/chooser-moment-icon-place@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-sleep.imageset/chooser-moment-icon-sleep@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-sleep.imageset/chooser-moment-icon-sleep@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-thought.imageset/chooser-moment-icon-thought.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-thought.imageset/chooser-moment-icon-thought.png -------------------------------------------------------------------------------- /Example/Example/TabBarViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarViewController.h 3 | // 4 | // 5 | // Created by Paul on 6/29/15. 6 | // 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface TabBarViewController : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-input.imageset/chooser-button-input@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-button-input.imageset/chooser-button-input@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button.imageset/chooser-moment-button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button.imageset/chooser-moment-button@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-camera.imageset/chooser-moment-icon-camera@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-camera.imageset/chooser-moment-icon-camera@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-thought.imageset/chooser-moment-icon-thought@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-thought.imageset/chooser-moment-icon-thought@2x.png -------------------------------------------------------------------------------- /Example/Example/UIScrollViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollViewController.h 3 | // 4 | // 5 | // Created by Paul on 6/29/15. 6 | // 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface UIScrollViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathButton-Bridging-Header.h 3 | // Example-Swift 4 | // 5 | // Created by Paul on 6/1/15. 6 | // Copyright (c) 2015 DC. All rights reserved. 7 | // 8 | 9 | #import "DCPathButton.h" 10 | 11 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music.imageset/chooser-moment-icon-music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music.imageset/chooser-moment-icon-music.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place.imageset/chooser-moment-icon-place.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place.imageset/chooser-moment-icon-place.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep.imageset/chooser-moment-icon-sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep.imageset/chooser-moment-icon-sleep.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-tab-highlighted.imageset/chooser-button-tab-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-button-tab-highlighted.imageset/chooser-button-tab-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera.imageset/chooser-moment-icon-camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera.imageset/chooser-moment-icon-camera.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-input-highlighted.imageset/chooser-button-input-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-button-input-highlighted.imageset/chooser-button-input-highlighted.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-tab-highlighted.imageset/chooser-button-tab-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-button-tab-highlighted.imageset/chooser-button-tab-highlighted@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera.imageset/chooser-moment-icon-camera@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera.imageset/chooser-moment-icon-camera@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music.imageset/chooser-moment-icon-music@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music.imageset/chooser-moment-icon-music@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place.imageset/chooser-moment-icon-place@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place.imageset/chooser-moment-icon-place@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep.imageset/chooser-moment-icon-sleep@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep.imageset/chooser-moment-icon-sleep@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought.imageset/chooser-moment-icon-thought.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought.imageset/chooser-moment-icon-thought.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-input-highlighted.imageset/chooser-button-input-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-button-input-highlighted.imageset/chooser-button-input-highlighted@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-button-highlighted.imageset/chooser-moment-button-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-button-highlighted.imageset/chooser-moment-button-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought.imageset/chooser-moment-icon-thought@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought.imageset/chooser-moment-icon-thought@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-button-highlighted.imageset/chooser-moment-button-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-button-highlighted.imageset/chooser-moment-button-highlighted@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab-highlighted.imageset/chooser-button-tab-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab-highlighted.imageset/chooser-button-tab-highlighted.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/chooser-moment-icon-music-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/chooser-moment-icon-music-highlighted.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/chooser-moment-icon-place-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/chooser-moment-icon-place-highlighted.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/chooser-moment-icon-sleep-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/chooser-moment-icon-sleep-highlighted.png -------------------------------------------------------------------------------- /Example/Example/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Example 4 | // 5 | // Created by tang dixi on 12/8/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-input-highlighted.imageset/chooser-button-input-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-button-input-highlighted.imageset/chooser-button-input-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab-highlighted.imageset/chooser-button-tab-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab-highlighted.imageset/chooser-button-tab-highlighted@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/chooser-moment-icon-camera-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/chooser-moment-icon-camera-highlighted.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/chooser-moment-icon-music-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/chooser-moment-icon-music-highlighted@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/chooser-moment-icon-place-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/chooser-moment-icon-place-highlighted@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/chooser-moment-icon-sleep-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/chooser-moment-icon-sleep-highlighted@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-input-highlighted.imageset/chooser-button-input-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-button-input-highlighted.imageset/chooser-button-input-highlighted@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button-highlighted.imageset/chooser-moment-button-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button-highlighted.imageset/chooser-moment-button-highlighted.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/chooser-moment-icon-camera-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/chooser-moment-icon-camera-highlighted@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/chooser-moment-icon-thought-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/chooser-moment-icon-thought-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button-highlighted.imageset/chooser-moment-button-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button-highlighted.imageset/chooser-moment-button-highlighted@2x.png -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/chooser-moment-icon-thought-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example/Example/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/chooser-moment-icon-thought-highlighted@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/chooser-moment-icon-music-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/chooser-moment-icon-music-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/chooser-moment-icon-place-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/chooser-moment-icon-place-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/chooser-moment-icon-sleep-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/chooser-moment-icon-sleep-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/chooser-moment-icon-camera-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/chooser-moment-icon-camera-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/chooser-moment-icon-music-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/chooser-moment-icon-music-highlighted@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/chooser-moment-icon-place-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/chooser-moment-icon-place-highlighted@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/chooser-moment-icon-sleep-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/chooser-moment-icon-sleep-highlighted@2x.png -------------------------------------------------------------------------------- /Example/Example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/chooser-moment-icon-camera-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/chooser-moment-icon-camera-highlighted@2x.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/chooser-moment-icon-thought-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/chooser-moment-icon-thought-highlighted.png -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/chooser-moment-icon-thought-highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tangdixi/DCPathButton/HEAD/Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/chooser-moment-icon-thought-highlighted@2x.png -------------------------------------------------------------------------------- /Example/Example/BarButtonItemViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController.h 3 | // Example 4 | // 5 | // Created by Tangdixi on 2/11/2015. 6 | // Copyright © 2015 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BarButtonItemViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Example 4 | // 5 | // Created by tang dixi on 12/8/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DCPathButton (2.1.4) 3 | 4 | DEPENDENCIES: 5 | - DCPathButton (from `../DCPathButton.podspec`) 6 | 7 | EXTERNAL SOURCES: 8 | DCPathButton: 9 | :path: ../DCPathButton.podspec 10 | 11 | SPEC CHECKSUMS: 12 | DCPathButton: 99c8211ef3eafc3b438c917a4c7b4502fa77eee7 13 | 14 | PODFILE CHECKSUM: a5cc8c54de5d850a3645c13a4428b5499efbc25c 15 | 16 | COCOAPODS: 1.3.1 17 | -------------------------------------------------------------------------------- /Example/Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Example 4 | // 5 | // Created by tang dixi on 12/8/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/ExampleTests/DCPathButtonTestObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathButtonTestObject.h 3 | // Example 4 | // 5 | // Created by Kevin Morton on 7/11/17. 6 | // Copyright © 2017 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DCPathButton; 12 | 13 | @interface DCPathButtonTestObject : UIView 14 | 15 | @property (nonatomic, readonly, strong) NSArray *pathButtonItems; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Example/Example-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/Default-flat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Default-flat@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/Default-flat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Default-flat@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-tab.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-button-tab.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-button-tab@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-input.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-button-input.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-button-input@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-button.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-button@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-button-tab.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-button-tab@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-input.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-button-input.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-button-input@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-button.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-button@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-music.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-music.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-music@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-place.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-place.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-place@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-sleep.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-sleep.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-sleep@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-camera.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-camera.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-camera@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-thought.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-thought.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-thought@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-camera.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-camera@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-music.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-music@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-place.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-place@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-sleep.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-sleep@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-tab-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-button-tab-highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-button-tab-highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-thought.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-thought@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-button-input-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-button-input-highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-button-input-highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-button-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-button-highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-button-highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-tab-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-button-tab-highlighted.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-button-tab-highlighted@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-button-input-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-button-input-highlighted.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-button-input-highlighted@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-button-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-button-highlighted.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-button-highlighted@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-camera-highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-camera-highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-music-highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-music-highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-place-highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-place-highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-sleep-highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-sleep-highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chooser-moment-icon-thought-highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chooser-moment-icon-thought-highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-music-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-music-highlighted.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-music-highlighted@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-place-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-place-highlighted.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-place-highlighted@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-sleep-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-sleep-highlighted.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-sleep-highlighted@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-camera-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-camera-highlighted.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-camera-highlighted@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Images.xcassets/chooser-moment-icon-thought-highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chooser-moment-icon-thought-highlighted.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chooser-moment-icon-thought-highlighted@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/Example/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 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/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 | "idiom" : "iphone", 20 | "size" : "60x60", 21 | "scale" : "3x" 22 | } 23 | ], 24 | "info" : { 25 | "version" : 1, 26 | "author" : "xcode" 27 | } 28 | } -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/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 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: objective-c 3 | osx_image: xcode9 4 | podfile: Example/Podfile 5 | xcode_scheme: Example 6 | xcode_workspace: Example/Example.xcworkspace 7 | before_install: 8 | - gem install bundler 9 | - bundle install 10 | before_script: 11 | - "SIMULATOR_ID=$(xcrun instruments -s | grep -o \"iPhone 8 \\[.*\\]\" | grep -o \"\\[.*\\]\" | sed \"s/^\\[\\(.*\\)\\]$/\\1/\")" 12 | script: 13 | - open -a "simulator" --args -CurrentDeviceUDID $SIMULATOR_ID 14 | - bundle exec fastlane test 15 | cache: 16 | - bundler # Save/cache "bundler" (local Ruby gems) for future builds. 17 | after_success: 18 | - bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | 18 | Example/Pods 19 | 20 | # fastlane 21 | # 22 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 23 | # screenshots whenever they are needed. 24 | # For more information about the recommended setup visit: 25 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 26 | 27 | fastlane/Preview.html 28 | fastlane/screenshots 29 | Example/fastlane/test_output 30 | *.junit 31 | report.xml 32 | fastlane/test_output 33 | -------------------------------------------------------------------------------- /Example/ExampleTests/ExampleTests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Example/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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example-Swift/DCPathButton/Classes/DCPathItemButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathItemButton.h 3 | // DCPathButton 4 | // 5 | // Created by tang dixi on 31/7/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @class DCPathItemButton; 12 | 13 | @protocol DCPathItemButtonDelegate 14 | 15 | - (void)itemButtonTapped:(DCPathItemButton *)itemButton; 16 | 17 | @end 18 | 19 | @interface DCPathItemButton : UIButton 20 | 21 | @property (assign, nonatomic) NSUInteger index; 22 | @property (weak, nonatomic) id delegate; 23 | 24 | - (instancetype)initWithImage:(UIImage *)image 25 | highlightedImage:(UIImage *)highlightedImage 26 | backgroundImage:(UIImage *)backgroundImage 27 | backgroundHighlightedImage:(UIImage *)backgroundHighlightedImage; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Example-Swift/Example-SwiftTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | DC.$(PRODUCT_NAME:rfc1034identifier) 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 | -------------------------------------------------------------------------------- /DCPathButton.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DCPathButton", 3 | "version": "2.1.4", 4 | "summary": " A beautiful button copy from Path® ", 5 | "description": "\t\t\tDCPathButton is a menu button, design by an famous App Path®.\n\t\t\tSince Path® 4.0, it return to use a tab bar instead of a side bar,\n\t\t\tand also change the menu button. So I try to implement it and then \n\t\t\tthe DCPathButton born :) \n", 6 | "homepage": "https://github.com/Tangdixi/DCPathButton", 7 | "license": { 8 | "type": "MIT", 9 | "text": "The DCPathButton use the MIT license" 10 | }, 11 | "authors": { 12 | "Tangdixi": "Tangdixi@gmail.com" 13 | }, 14 | "platforms": { 15 | "ios": "7.0" 16 | }, 17 | "source": { 18 | "git": "https://github.com/Tangdixi/DCPathButton.git", 19 | "tag": "2.1.4" 20 | }, 21 | "source_files": "DCPathButton/Classes/*.{h,m}", 22 | "resources": [ 23 | "DCPathButton/Sounds/*" 24 | ], 25 | "frameworks": [ 26 | "QuartzCore", 27 | "AudioToolBox" 28 | ], 29 | "requires_arc": true 30 | } 31 | -------------------------------------------------------------------------------- /Example-Swift/Example-SwiftTests/Example_SwiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Example_SwiftTests.swift 3 | // Example-SwiftTests 4 | // 5 | // Created by Paul on 6/1/15. 6 | // Copyright (c) 2015 DC. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class Example_SwiftTests: 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.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LISENCE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Tangdixi 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 13 | all 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 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | DC.$(PRODUCT_NAME:rfc1034identifier) 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 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ================ 3 | # Installation 4 | 5 | Make sure you have the latest version of the Xcode command line tools installed: 6 | 7 | ``` 8 | xcode-select --install 9 | ``` 10 | 11 | ## Choose your installation method: 12 | 13 | 14 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
Homebrew 16 | Installer Script 17 | Rubygems 18 |
macOSmacOSmacOS or Linux with Ruby 2.0.0 or above
brew cask install fastlaneDownload the zip file. Then double click on the install script (or run it in a terminal window).sudo gem install fastlane -NV
30 | 31 | # Available Actions 32 | ## iOS 33 | ### ios test 34 | ``` 35 | fastlane ios test 36 | ``` 37 | Runs all the tests of the iOS App and gathers code coverage 38 | 39 | ---- 40 | 41 | This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. 42 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). 43 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 44 | -------------------------------------------------------------------------------- /Example/Example/Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | DCPathButton 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarStyle 34 | UIStatusBarStyleLightContent 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | 40 | UIViewControllerBasedStatusBarAppearance 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift.xcodeproj/project.xcworkspace/xcshareddata/Example-Swift.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 8ED13E01-50CF-4937-BD4E-0083855EFBFE 9 | IDESourceControlProjectName 10 | Example-Swift 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 75E24B51C8B1C7E80F139F4E1D45145A8D81C736 14 | https://www.github.com/tangdixi/DCPathButton.git 15 | 16 | IDESourceControlProjectPath 17 | Example-Swift/Example-Swift.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 75E24B51C8B1C7E80F139F4E1D45145A8D81C736 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://www.github.com/tangdixi/DCPathButton.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 75E24B51C8B1C7E80F139F4E1D45145A8D81C736 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 75E24B51C8B1C7E80F139F4E1D45145A8D81C736 36 | IDESourceControlWCCName 37 | DCPathButton 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | fastlane_require 'fileutils' 2 | fastlane_version "2.60.1" 3 | 4 | default_platform :ios 5 | 6 | platform :ios do 7 | 8 | # Scheme to test. 9 | app_scheme_name = "Example" 10 | workspace_path = File.join("Example", app_scheme_name) 11 | 12 | # Root fastlane folder. 13 | fastlane_folder = "fastlane" 14 | 15 | # Folder for test output files. 16 | test_output_folder = "test_output" 17 | 18 | ########### 19 | ## SETUP ## 20 | ########### 21 | before_all do 22 | 23 | end 24 | 25 | ############################# 26 | ## TESTING & CODE COVERAGE ## 27 | ############################# 28 | 29 | desc "Runs all the tests of the iOS App and gathers code coverage" 30 | lane :test do 31 | # Make the test output folder, if it doesn't exist 32 | FileUtils.mkdir_p(test_output_folder) 33 | 34 | scan( 35 | workspace: "#{workspace_path}.xcworkspace", 36 | scheme: "#{app_scheme_name}", 37 | clean: true, 38 | device: "iPhone 8", 39 | code_coverage: true, 40 | output_directory: File.join(fastlane_folder, test_output_folder), 41 | skip_build: true, #the test action will already kick off a build, don't build twice 42 | ) 43 | 44 | if is_ci? 45 | clean_build_artifacts 46 | end 47 | end 48 | 49 | ###################### 50 | ## SUCCESS HANDLING ## 51 | ###################### 52 | 53 | after_all do |lane| 54 | puts "Success!" 55 | 56 | if !is_ci? 57 | notification(message: "Fastlane finished '#{lane}'") 58 | end 59 | end 60 | 61 | ###################### 62 | ## FAILURE HANDLING ## 63 | ###################### 64 | 65 | error do |lane, exception| 66 | puts "FAIL!!!!: #{exception}" 67 | 68 | notification(message: "Error completing Fastlane '#{lane}'") 69 | end 70 | end 71 | -------------------------------------------------------------------------------- /DCPathButton/Classes/DCPathItemButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathItemButton.h 3 | // DCPathButton 4 | // 5 | // Created by tang dixi on 31/7/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @class DCPathItemButton; 12 | 13 | /*! 14 | * `DCPathItemButtonDelegate` protocol defines method that informs the delegate object the event of item button's selection. 15 | */ 16 | @protocol DCPathItemButtonDelegate 17 | 18 | /*! 19 | * Tells the delegate that the `DCPathItemButton` has been selected. 20 | * 21 | * @param itemButton A `DCPathItemButton` that has been selected. 22 | */ 23 | - (void)itemButtonTapped:(DCPathItemButton *)itemButton; 24 | 25 | @end 26 | 27 | @interface DCPathItemButton : UIButton 28 | 29 | /*! 30 | * The location of the `DCPathItemButton` object in a `DCPathButton` object. 31 | */ 32 | @property (assign, nonatomic) NSUInteger index; 33 | 34 | /*! 35 | * The object that acts as the delegate of the `DCPathItemButton` object. 36 | */ 37 | @property (weak, nonatomic) id delegate; 38 | 39 | /*! 40 | * Creates a `DCPathItemButton` with normal and highlighted foreground and background images of the button. 41 | * 42 | * @param image The normal foreground image. 43 | * @param highlightedImage The highlighted foreground image. 44 | * @param backgroundImage The normal background image. 45 | * @param backgroundHighlightedImage The highlighted background image. 46 | * 47 | * @return A `DCPathItemButton` object. 48 | */ 49 | - (instancetype)initWithImage:(UIImage *)image 50 | highlightedImage:(UIImage *)highlightedImage 51 | backgroundImage:(UIImage *)backgroundImage 52 | backgroundHighlightedImage:(UIImage *)backgroundHighlightedImage; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /DCPathButton/Classes/DCPathItemButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathItemButton.m 3 | // DCPathButton 4 | // 5 | // Created by tang dixi on 31/7/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "DCPathItemButton.h" 10 | 11 | @interface DCPathItemButton () 12 | 13 | @property (strong, nonatomic) UIImageView *backgroundImageView; 14 | 15 | @end 16 | 17 | @implementation DCPathItemButton 18 | 19 | - (instancetype)initWithImage:(UIImage *)image 20 | highlightedImage:(UIImage *)highlightedImage 21 | backgroundImage:(UIImage *)backgroundImage 22 | backgroundHighlightedImage:(UIImage *)backgroundHighlightedImage 23 | { 24 | if (self = [super init]) { 25 | 26 | // Make sure the iteam has a certain frame 27 | // 28 | CGRect itemFrame = CGRectMake(0, 0, backgroundImage.size.width, backgroundImage.size.height); 29 | 30 | if (!backgroundImage || !backgroundHighlightedImage) { 31 | itemFrame = CGRectMake(0, 0, image.size.width, image.size.height); 32 | } 33 | self.frame = itemFrame; 34 | 35 | // Configure the item's image 36 | // 37 | [self setImage:backgroundImage forState:UIControlStateNormal]; 38 | [self setImage:backgroundHighlightedImage forState:UIControlStateHighlighted]; 39 | 40 | // Configure background 41 | // 42 | _backgroundImageView = [[UIImageView alloc]initWithImage:image 43 | highlightedImage:highlightedImage]; 44 | _backgroundImageView.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2); 45 | 46 | [self addSubview:_backgroundImageView]; 47 | 48 | // Add an action for the item button 49 | // 50 | [self addTarget:_delegate action:@selector(itemButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; 51 | 52 | } 53 | return self; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example-Swift/DCPathButton/Classes/DCPathItemButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathItemButton.m 3 | // DCPathButton 4 | // 5 | // Created by tang dixi on 31/7/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "DCPathItemButton.h" 10 | 11 | @interface DCPathItemButton () 12 | 13 | @property (strong, nonatomic) UIImageView *backgroundImageView; 14 | 15 | @end 16 | 17 | @implementation DCPathItemButton 18 | 19 | - (instancetype)initWithImage:(UIImage *)image 20 | highlightedImage:(UIImage *)highlightedImage 21 | backgroundImage:(UIImage *)backgroundImage 22 | backgroundHighlightedImage:(UIImage *)backgroundHighlightedImage 23 | { 24 | if (self = [super init]) { 25 | 26 | // Make sure the iteam has a certain frame 27 | // 28 | CGRect itemFrame = CGRectMake(0, 0, backgroundImage.size.width, backgroundImage.size.height); 29 | 30 | if (!backgroundImage || !backgroundHighlightedImage) { 31 | itemFrame = CGRectMake(0, 0, image.size.width, image.size.height); 32 | } 33 | self.frame = itemFrame; 34 | 35 | // Configure the item's image 36 | // 37 | [self setImage:backgroundImage forState:UIControlStateNormal]; 38 | [self setImage:backgroundHighlightedImage forState:UIControlStateHighlighted]; 39 | 40 | // Configure background 41 | // 42 | _backgroundImageView = [[UIImageView alloc]initWithImage:image 43 | highlightedImage:highlightedImage]; 44 | _backgroundImageView.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2); 45 | 46 | [self addSubview:_backgroundImageView]; 47 | 48 | // Add an action for the item button 49 | // 50 | [self addTarget:_delegate action:@selector(itemButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; 51 | 52 | } 53 | return self; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/xcshareddata/Example.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 0260A90C-FAB2-43CB-A854-D7402F5B674A 9 | IDESourceControlProjectName 10 | Example 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 2FF8437B86C866F265531C21FDF18BF1E20AE9D9 14 | github.com:Tangdixi/NETerminal-JYU.git 15 | 75E24B51C8B1C7E80F139F4E1D45145A8D81C736 16 | github.com:Tangdixi/DCPathButton.git 17 | 18 | IDESourceControlProjectPath 19 | Example/Example.xcodeproj 20 | IDESourceControlProjectRelativeInstallPathDictionary 21 | 22 | 2FF8437B86C866F265531C21FDF18BF1E20AE9D9 23 | ../../../.. 24 | 75E24B51C8B1C7E80F139F4E1D45145A8D81C736 25 | ../../.. 26 | 27 | IDESourceControlProjectURL 28 | github.com:Tangdixi/DCPathButton.git 29 | IDESourceControlProjectVersion 30 | 111 31 | IDESourceControlProjectWCCIdentifier 32 | 75E24B51C8B1C7E80F139F4E1D45145A8D81C736 33 | IDESourceControlProjectWCConfigurations 34 | 35 | 36 | IDESourceControlRepositoryExtensionIdentifierKey 37 | public.vcs.git 38 | IDESourceControlWCCIdentifierKey 39 | 2FF8437B86C866F265531C21FDF18BF1E20AE9D9 40 | IDESourceControlWCCName 41 | 42 | 43 | 44 | IDESourceControlRepositoryExtensionIdentifierKey 45 | public.vcs.git 46 | IDESourceControlWCCIdentifierKey 47 | 75E24B51C8B1C7E80F139F4E1D45145A8D81C736 48 | IDESourceControlWCCName 49 | DCPathButton 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Example 4 | // 5 | // Created by tang dixi on 12/8/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | 17 | [application setStatusBarStyle:UIStatusBarStyleLightContent]; 18 | return YES; 19 | } 20 | 21 | - (void)applicationWillResignActive:(UIApplication *)application 22 | { 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 throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | - (void)applicationDidEnterBackground:(UIApplication *)application 28 | { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application 34 | { 35 | // 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. 36 | } 37 | 38 | - (void)applicationDidBecomeActive:(UIApplication *)application 39 | { 40 | // 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. 41 | } 42 | 43 | - (void)applicationWillTerminate:(UIApplication *)application 44 | { 45 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/ExampleTests/ExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleTests.m 3 | // ExampleTests 4 | // 5 | // Created by tang dixi on 12/8/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DCPathButtonTestObject.h" 11 | #import 12 | 13 | @interface ExampleTests : XCTestCase 14 | 15 | @property (nonatomic, strong) DCPathButtonTestObject *pathButtonTestView; 16 | @property (nonatomic, strong) DCPathButton *dcPathButton; 17 | 18 | @end 19 | 20 | @implementation ExampleTests 21 | 22 | #pragma mark - Setup - 23 | 24 | - (void)setUp { 25 | [super setUp]; 26 | 27 | self.pathButtonTestView = [DCPathButtonTestObject new]; 28 | 29 | self.dcPathButton = [[DCPathButton alloc] initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"] 30 | highlightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]]; 31 | 32 | [self.dcPathButton addPathItems:self.pathButtonTestView.pathButtonItems]; 33 | } 34 | 35 | - (void)tearDown { 36 | self.pathButtonTestView = nil; 37 | self.dcPathButton = nil; 38 | 39 | [super tearDown]; 40 | } 41 | 42 | #pragma mark - Tests - 43 | 44 | - (void)testDCPathButtonBloomDirectionIsTopDirectionTrue { 45 | self.dcPathButton.bloomDirection = kDCPathButtonBloomDirectionTop; 46 | XCTAssertTrue(self.dcPathButton.bloomDirection == kDCPathButtonBloomDirectionTop); 47 | } 48 | 49 | - (void)testDCPathButtonAllowsCenterRotationIsTrue { 50 | self.dcPathButton.allowCenterButtonRotation = YES; 51 | XCTAssertTrue(self.dcPathButton.allowCenterButtonRotation); 52 | } 53 | 54 | - (void)testDCPathButtonCenterMatchesAssignedCGPointIsTrue { 55 | CGPoint centerPoint = CGPointMake(250, 200); 56 | 57 | self.dcPathButton.center = centerPoint; 58 | 59 | XCTAssertTrue(CGPointEqualToPoint(self.dcPathButton.center, centerPoint)); 60 | } 61 | 62 | - (void)testDCPathButtonAllowsSoundIsFalse { 63 | self.dcPathButton.allowSounds = NO; 64 | XCTAssertFalse(self.dcPathButton.allowSounds); 65 | } 66 | 67 | - (void)testDCPathButtonAllowSubItemRotationIsFalse { 68 | self.dcPathButton.allowSubItemRotation = NO; 69 | XCTAssertFalse(self.dcPathButton.allowSubItemRotation); 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Example-Swift 4 | // 5 | // Created by Paul on 6/1/15. 6 | // Copyright (c) 2015 DC. 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: [NSObject: AnyObject]?) -> 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 throttle down OpenGL ES frame rates. 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 inactive 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 | -------------------------------------------------------------------------------- /Example-Swift/DCPathButton/Classes/DCPathButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathButton.h 3 | // DCPathButton 4 | // 5 | // Created by tang dixi on 30/7/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "DCPathItemButton.h" 10 | 11 | @import UIKit; 12 | @import QuartzCore; 13 | @import AudioToolbox; 14 | 15 | @class DCPathButton; 16 | 17 | typedef NS_ENUM(NSUInteger, kDCPathButtonBloomDirection) { 18 | 19 | kDCPathButtonBloomDirectionTop = 1, 20 | kDCPathButtonBloomDirectionTopLeft = 2, 21 | kDCPathButtonBloomDirectionLeft = 3, 22 | kDCPathButtonBloomDirectionBottomLeft = 4, 23 | kDCPathButtonBloomDirectionBottom = 5, 24 | kDCPathButtonBloomDirectionBottomRight = 6, 25 | kDCPathButtonBloomDirectionRight = 7, 26 | kDCPathButtonBloomDirectionTopRight = 8, 27 | 28 | }; 29 | 30 | @protocol DCPathButtonDelegate 31 | 32 | - (void)pathButton:(DCPathButton *)dcPathButton clickItemButtonAtIndex:(NSUInteger)itemButtonIndex; 33 | 34 | @optional 35 | 36 | - (void)willPresentDCPathButtonItems:(DCPathButton *)dcPathButton; 37 | - (void)didPresentDCPathButtonItems:(DCPathButton *)dcPathButton; 38 | 39 | - (void)willDismissDCPathButtonItems:(DCPathButton *)dcPathButton; 40 | - (void)didDismissDCPathButtonItems:(DCPathButton *)dcPathButton; 41 | 42 | @end 43 | 44 | @interface DCPathButton : UIView 45 | 46 | @property (weak, nonatomic) id delegate; 47 | 48 | @property (assign, nonatomic) CGFloat bloomRadius; 49 | @property (assign, nonatomic) CGFloat bloomAngel; 50 | @property (assign, nonatomic) CGPoint dcButtonCenter; 51 | 52 | @property (assign, nonatomic) BOOL allowSounds; 53 | 54 | @property (copy, nonatomic) NSString *bloomSoundPath; 55 | @property (copy, nonatomic) NSString *foldSoundPath; 56 | @property (copy, nonatomic) NSString *itemSoundPath; 57 | 58 | @property (assign, nonatomic) BOOL allowCenterButtonRotation; 59 | 60 | @property (strong, nonatomic) UIColor *bottomViewColor; 61 | 62 | @property (assign, nonatomic) kDCPathButtonBloomDirection bloomDirection; 63 | 64 | - (instancetype)initWithCenterImage:(UIImage *)centerImage 65 | highlightedImage:(UIImage *)centerHighlightedImage; 66 | 67 | - (instancetype)initWithButtonFrame:(CGRect)centerButtonFrame 68 | centerImage:(UIImage *)centerImage 69 | highlightedImage:(UIImage *)centerHighlightedImage; 70 | 71 | - (void)addPathItems:(NSArray *)pathItemButtons; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Example/ExampleTests/DCPathButtonTestObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathButtonTestObject.m 3 | // Example 4 | // 5 | // Created by Kevin Morton on 7/11/17. 6 | // Copyright © 2017 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "DCPathButtonTestObject.h" 10 | #import 11 | 12 | @interface DCPathButtonTestObject () 13 | 14 | @end 15 | 16 | @implementation DCPathButtonTestObject 17 | 18 | #pragma mark - Accessors - 19 | 20 | - (NSArray *)pathButtonItems { 21 | DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc] initWithImage:[UIImage imageNamed:@"chooser-moment-icon-music"] 22 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-music-highlighted"] 23 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 24 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 25 | 26 | DCPathItemButton *itemButton_2 = [[DCPathItemButton alloc] initWithImage:[UIImage imageNamed:@"chooser-moment-icon-place"] 27 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-place-highlighted"] 28 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 29 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 30 | 31 | DCPathItemButton *itemButton_3 = [[DCPathItemButton alloc] initWithImage:[UIImage imageNamed:@"chooser-moment-icon-camera"] 32 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-camera-highlighted"] 33 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 34 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 35 | 36 | DCPathItemButton *itemButton_4 = [[DCPathItemButton alloc] initWithImage:[UIImage imageNamed:@"chooser-moment-icon-thought"] 37 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-thought-highlighted"] 38 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 39 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 40 | 41 | DCPathItemButton *itemButton_5 = [[DCPathItemButton alloc] initWithImage:[UIImage imageNamed:@"chooser-moment-icon-sleep"] 42 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-sleep-highlighted"] 43 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 44 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 45 | 46 | return @[ 47 | itemButton_1, 48 | itemButton_2, 49 | itemButton_3, 50 | itemButton_4, 51 | itemButton_5 52 | ]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Example-Swift 4 | // 5 | // Created by Paul on 6/1/15. 6 | // Copyright (c) 2015 DC. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController, DCPathButtonDelegate { 12 | 13 | var dcPathButton:DCPathButton! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | // Do any additional setup after loading the view, typically from a nib. 18 | 19 | configureDCPathButton() 20 | } 21 | 22 | override func didReceiveMemoryWarning() { 23 | super.didReceiveMemoryWarning() 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | func configureDCPathButton() { 28 | 29 | dcPathButton = DCPathButton(centerImage: UIImage(named: "chooser-button-tab"), highlightedImage: UIImage(named: "chooser-button-tab-highlighted")) 30 | 31 | dcPathButton.delegate = self 32 | dcPathButton.dcButtonCenter = CGPointMake(self.view.bounds.width/2, self.view.bounds.height - 25.5) 33 | dcPathButton.allowSounds = true 34 | dcPathButton.allowCenterButtonRotation = true 35 | dcPathButton.bloomRadius = 105 36 | 37 | var itemButton_1 = DCPathItemButton(image: UIImage(named: "chooser-moment-icon-music"), highlightedImage: UIImage(named: "chooser-moment-icon-music-highlighted"), backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) 38 | var itemButton_2 = DCPathItemButton(image: UIImage(named: "chooser-moment-icon-place"), highlightedImage: UIImage(named: "chooser-moment-icon-place-highlighted"), backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) 39 | var itemButton_3 = DCPathItemButton(image: UIImage(named: "chooser-moment-icon-camera"), highlightedImage: UIImage(named: "chooser-moment-icon-camera-highlighted"), backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) 40 | var itemButton_4 = DCPathItemButton(image: UIImage(named: "chooser-moment-icon-thought"), highlightedImage: UIImage(named: "chooser-moment-icon-thought-highlighted"), backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) 41 | var itemButton_5 = DCPathItemButton(image: UIImage(named: "chooser-moment-icon-sleep"), highlightedImage: UIImage(named: "chooser-moment-icon-sleep-highlighted"), backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) 42 | 43 | 44 | dcPathButton.addPathItems([itemButton_1, itemButton_2, itemButton_3, itemButton_4, itemButton_5]) 45 | 46 | self.view.addSubview(dcPathButton) 47 | 48 | } 49 | 50 | // DCPathButton Delegate 51 | // 52 | func pathButton(dcPathButton: DCPathButton!, clickItemButtonAtIndex itemButtonIndex: UInt) { 53 | 54 | var alertView = UIAlertView(title: "", message: "You tap at index \(itemButtonIndex)", delegate: nil, cancelButtonTitle: "Ok") 55 | 56 | alertView.show() 57 | 58 | } 59 | 60 | } 61 | 62 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/Example/BarButtonItemViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController.m 3 | // Example 4 | // 5 | // Created by Tangdixi on 2/11/2015. 6 | // Copyright © 2015 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "BarButtonItemViewController.h" 10 | #import "DCPathButton.h" 11 | 12 | @interface BarButtonItemViewController () 13 | 14 | @property (strong, nonatomic) DCPathButton *dcPathButton; 15 | 16 | @end 17 | 18 | @implementation BarButtonItemViewController 19 | 20 | - (void)viewDidLoad { 21 | 22 | _dcPathButton = [[DCPathButton alloc]initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"] 23 | highlightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]]; 24 | _dcPathButton.delegate = self; 25 | 26 | // Configure item buttons 27 | // 28 | DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-music"] 29 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-music-highlighted"] 30 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 31 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 32 | 33 | DCPathItemButton *itemButton_2 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-place"] 34 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-place-highlighted"] 35 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 36 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 37 | 38 | DCPathItemButton *itemButton_3 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-camera"] 39 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-camera-highlighted"] 40 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 41 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 42 | 43 | DCPathItemButton *itemButton_4 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-thought"] 44 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-thought-highlighted"] 45 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 46 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 47 | 48 | DCPathItemButton *itemButton_5 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-sleep"] 49 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-sleep-highlighted"] 50 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 51 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 52 | 53 | // Add the item button into the center button 54 | // 55 | [_dcPathButton addPathItems:@[itemButton_1, 56 | itemButton_2, 57 | itemButton_3, 58 | itemButton_4, 59 | itemButton_5 60 | ]]; 61 | 62 | UIBarButtonItem *rightButtonItem = [[UIBarButtonItem alloc]initWithCustomView:self.dcPathButton]; 63 | 64 | self.navigationItem.rightBarButtonItem = rightButtonItem; 65 | 66 | } 67 | 68 | #pragma mark - DCPathButtonDelegate 69 | - (void)pathButton:(DCPathButton *)dcPathButton clickItemButtonAtIndex:(NSUInteger)itemButtonIndex { 70 | NSLog(@"You tap %@ at index : %tu", dcPathButton, itemButtonIndex); 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Example/Example/UIScrollViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollViewController.m 3 | // 4 | // 5 | // Created by Paul on 6/29/15. 6 | // 7 | // 8 | 9 | #import "UIScrollViewController.h" 10 | #import "DCPathButton.h" 11 | 12 | @interface UIScrollViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UIView *scrollView; 15 | @end 16 | 17 | @implementation UIScrollViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view. 22 | 23 | [self configureDCPathButton]; 24 | 25 | } 26 | 27 | - (void)didReceiveMemoryWarning { 28 | [super didReceiveMemoryWarning]; 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | - (void)configureDCPathButton 33 | { 34 | // Configure center button 35 | // 36 | DCPathButton *dcPathButton = [[DCPathButton alloc]initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"] 37 | highlightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]]; 38 | dcPathButton.delegate = self; 39 | 40 | // Configure item buttons 41 | // 42 | DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-music"] 43 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-music-highlighted"] 44 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 45 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 46 | 47 | DCPathItemButton *itemButton_2 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-place"] 48 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-place-highlighted"] 49 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 50 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 51 | 52 | DCPathItemButton *itemButton_3 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-camera"] 53 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-camera-highlighted"] 54 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 55 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 56 | 57 | DCPathItemButton *itemButton_4 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-thought"] 58 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-thought-highlighted"] 59 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 60 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 61 | 62 | DCPathItemButton *itemButton_5 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-sleep"] 63 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-sleep-highlighted"] 64 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 65 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 66 | 67 | // Add the item button into the center button 68 | // 69 | [dcPathButton addPathItems:@[itemButton_1, 70 | itemButton_2, 71 | itemButton_3, 72 | itemButton_4, 73 | itemButton_5 74 | ]]; 75 | 76 | // Change the bloom radius, default is 105.0f 77 | // 78 | dcPathButton.bloomRadius = 120.0f; 79 | 80 | // Change the DCButton's center 81 | // 82 | dcPathButton.dcButtonCenter = CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height - 25.5f); 83 | 84 | // Setting the DCButton appearance 85 | // 86 | dcPathButton.allowSounds = YES; 87 | dcPathButton.allowCenterButtonRotation = YES; 88 | 89 | dcPathButton.bottomViewColor = [UIColor grayColor]; 90 | 91 | dcPathButton.bloomDirection = kDCPathButtonBloomDirectionBottom; 92 | dcPathButton.dcButtonCenter = CGPointMake(self.view.frame.size.width/2, 50); 93 | 94 | [self.scrollView addSubview:dcPathButton]; 95 | 96 | } 97 | 98 | #pragma mark - DCPathButton Delegate 99 | 100 | - (void)willPresentDCPathButtonItems:(DCPathButton *)dcPathButton { 101 | 102 | NSLog(@"ItemButton will present"); 103 | 104 | } 105 | 106 | - (void)pathButton:(DCPathButton *)dcPathButton clickItemButtonAtIndex:(NSUInteger)itemButtonIndex { 107 | NSLog(@"You tap %@ at index : %lu", dcPathButton, (unsigned long)itemButtonIndex); 108 | } 109 | 110 | - (void)didPresentDCPathButtonItems:(DCPathButton *)dcPathButton { 111 | 112 | NSLog(@"ItemButton did present"); 113 | 114 | } 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (2.3.5) 5 | activesupport (4.2.10) 6 | i18n (~> 0.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | addressable (2.5.2) 11 | public_suffix (>= 2.0.2, < 4.0) 12 | babosa (1.0.2) 13 | claide (1.0.2) 14 | cocoapods (1.3.1) 15 | activesupport (>= 4.0.2, < 5) 16 | claide (>= 1.0.2, < 2.0) 17 | cocoapods-core (= 1.3.1) 18 | cocoapods-deintegrate (>= 1.0.1, < 2.0) 19 | cocoapods-downloader (>= 1.1.3, < 2.0) 20 | cocoapods-plugins (>= 1.0.0, < 2.0) 21 | cocoapods-search (>= 1.0.0, < 2.0) 22 | cocoapods-stats (>= 1.0.0, < 2.0) 23 | cocoapods-trunk (>= 1.2.0, < 2.0) 24 | cocoapods-try (>= 1.1.0, < 2.0) 25 | colored2 (~> 3.1) 26 | escape (~> 0.0.4) 27 | fourflusher (~> 2.0.1) 28 | gh_inspector (~> 1.0) 29 | molinillo (~> 0.5.7) 30 | nap (~> 1.0) 31 | ruby-macho (~> 1.1) 32 | xcodeproj (>= 1.5.1, < 2.0) 33 | cocoapods-core (1.3.1) 34 | activesupport (>= 4.0.2, < 6) 35 | fuzzy_match (~> 2.0.4) 36 | nap (~> 1.0) 37 | cocoapods-deintegrate (1.0.1) 38 | cocoapods-downloader (1.1.3) 39 | cocoapods-plugins (1.0.0) 40 | nap 41 | cocoapods-search (1.0.0) 42 | cocoapods-stats (1.0.0) 43 | cocoapods-trunk (1.3.0) 44 | nap (>= 0.8, < 2.0) 45 | netrc (~> 0.11) 46 | cocoapods-try (1.1.0) 47 | colored (1.2) 48 | colored2 (3.1.2) 49 | commander-fastlane (4.4.5) 50 | highline (~> 1.7.2) 51 | declarative (0.0.10) 52 | declarative-option (0.1.0) 53 | domain_name (0.5.20170404) 54 | unf (>= 0.0.5, < 1.0.0) 55 | dotenv (2.2.1) 56 | escape (0.0.4) 57 | excon (0.59.0) 58 | faraday (0.13.1) 59 | multipart-post (>= 1.2, < 3) 60 | faraday-cookie_jar (0.0.6) 61 | faraday (>= 0.7.4) 62 | http-cookie (~> 1.0.0) 63 | faraday_middleware (0.12.2) 64 | faraday (>= 0.7.4, < 1.0) 65 | fastimage (2.1.0) 66 | fastlane (2.61.0) 67 | CFPropertyList (>= 2.3, < 3.0.0) 68 | addressable (>= 2.3, < 3.0.0) 69 | babosa (>= 1.0.2, < 2.0.0) 70 | bundler (>= 1.12.0, < 2.0.0) 71 | colored 72 | commander-fastlane (>= 4.4.5, < 5.0.0) 73 | dotenv (>= 2.1.1, < 3.0.0) 74 | excon (>= 0.45.0, < 1.0.0) 75 | faraday (~> 0.9) 76 | faraday-cookie_jar (~> 0.0.6) 77 | faraday_middleware (~> 0.9) 78 | fastimage (>= 2.1.0, < 3.0.0) 79 | gh_inspector (>= 1.0.1, < 2.0.0) 80 | google-api-client (>= 0.13.1, < 0.14.0) 81 | highline (>= 1.7.2, < 2.0.0) 82 | json (< 3.0.0) 83 | mini_magick (~> 4.5.1) 84 | multi_json 85 | multi_xml (~> 0.5) 86 | multipart-post (~> 2.0.0) 87 | plist (>= 3.1.0, < 4.0.0) 88 | public_suffix (~> 2.0.0) 89 | rubyzip (>= 1.1.0, < 2.0.0) 90 | security (= 0.1.3) 91 | slack-notifier (>= 1.3, < 2.0.0) 92 | terminal-notifier (>= 1.6.2, < 2.0.0) 93 | terminal-table (>= 1.4.5, < 2.0.0) 94 | tty-screen (~> 0.5.0) 95 | word_wrap (~> 1.0.0) 96 | xcodeproj (>= 1.5.0, < 2.0.0) 97 | xcpretty (>= 0.2.4, < 1.0.0) 98 | xcpretty-travis-formatter (>= 0.0.3) 99 | fourflusher (2.0.1) 100 | fuzzy_match (2.0.4) 101 | gh_inspector (1.0.3) 102 | google-api-client (0.13.6) 103 | addressable (~> 2.5, >= 2.5.1) 104 | googleauth (~> 0.5) 105 | httpclient (>= 2.8.1, < 3.0) 106 | mime-types (~> 3.0) 107 | representable (~> 3.0) 108 | retriable (>= 2.0, < 4.0) 109 | googleauth (0.5.3) 110 | faraday (~> 0.12) 111 | jwt (~> 1.4) 112 | logging (~> 2.0) 113 | memoist (~> 0.12) 114 | multi_json (~> 1.11) 115 | os (~> 0.9) 116 | signet (~> 0.7) 117 | highline (1.7.8) 118 | http-cookie (1.0.3) 119 | domain_name (~> 0.5) 120 | httpclient (2.8.3) 121 | i18n (0.8.6) 122 | json (2.1.0) 123 | jwt (1.5.6) 124 | little-plugger (1.1.4) 125 | logging (2.2.2) 126 | little-plugger (~> 1.1) 127 | multi_json (~> 1.10) 128 | memoist (0.16.0) 129 | mime-types (3.1) 130 | mime-types-data (~> 3.2015) 131 | mime-types-data (3.2016.0521) 132 | mini_magick (4.5.1) 133 | minitest (5.10.3) 134 | molinillo (0.5.7) 135 | multi_json (1.12.2) 136 | multi_xml (0.6.0) 137 | multipart-post (2.0.0) 138 | nanaimo (0.2.3) 139 | nap (1.1.0) 140 | netrc (0.11.0) 141 | os (0.9.6) 142 | plist (3.3.0) 143 | public_suffix (2.0.5) 144 | representable (3.0.4) 145 | declarative (< 0.1.0) 146 | declarative-option (< 0.2.0) 147 | uber (< 0.2.0) 148 | retriable (3.1.1) 149 | rouge (2.0.7) 150 | ruby-macho (1.1.0) 151 | rubyzip (1.2.1) 152 | security (0.1.3) 153 | signet (0.7.3) 154 | addressable (~> 2.3) 155 | faraday (~> 0.9) 156 | jwt (~> 1.5) 157 | multi_json (~> 1.10) 158 | slack-notifier (1.5.1) 159 | terminal-notifier (1.8.0) 160 | terminal-table (1.8.0) 161 | unicode-display_width (~> 1.1, >= 1.1.1) 162 | thread_safe (0.3.6) 163 | tty-screen (0.5.0) 164 | tzinfo (1.2.3) 165 | thread_safe (~> 0.1) 166 | uber (0.1.0) 167 | unf (0.1.4) 168 | unf_ext 169 | unf_ext (0.0.7.4) 170 | unicode-display_width (1.3.0) 171 | word_wrap (1.0.0) 172 | xcodeproj (1.5.2) 173 | CFPropertyList (~> 2.3.3) 174 | claide (>= 1.0.2, < 2.0) 175 | colored2 (~> 3.1) 176 | nanaimo (~> 0.2.3) 177 | xcpretty (0.2.8) 178 | rouge (~> 2.0.7) 179 | xcpretty-travis-formatter (0.0.4) 180 | xcpretty (~> 0.2, >= 0.0.7) 181 | 182 | PLATFORMS 183 | ruby 184 | 185 | DEPENDENCIES 186 | cocoapods (~> 1.3.1) 187 | fastlane (~> 2.61.0) 188 | 189 | BUNDLED WITH 190 | 1.15.4 191 | -------------------------------------------------------------------------------- /Example/Example/TabBarViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarViewController.m 3 | // 4 | // 5 | // Created by Paul on 6/29/15. 6 | // 7 | // 8 | 9 | #import "TabBarViewController.h" 10 | #import "DCPathButton.h" 11 | 12 | @interface TabBarViewController () 13 | 14 | @end 15 | 16 | @implementation TabBarViewController 17 | 18 | #pragma mark - Lifecycle 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view. 23 | 24 | [self configureDCPathButton]; 25 | } 26 | 27 | - (void)didReceiveMemoryWarning { 28 | [super didReceiveMemoryWarning]; 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | - (void)configureDCPathButton { 33 | // Configure center button 34 | // 35 | DCPathButton *dcPathButton = [[DCPathButton alloc]initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"] 36 | highlightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]]; 37 | dcPathButton.delegate = self; 38 | 39 | // Configure item buttons 40 | // 41 | DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-music"] 42 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-music-highlighted"] 43 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 44 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 45 | 46 | DCPathItemButton *itemButton_2 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-place"] 47 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-place-highlighted"] 48 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 49 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 50 | 51 | DCPathItemButton *itemButton_3 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-camera"] 52 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-camera-highlighted"] 53 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 54 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 55 | 56 | DCPathItemButton *itemButton_4 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-thought"] 57 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-thought-highlighted"] 58 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 59 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 60 | 61 | DCPathItemButton *itemButton_5 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-sleep"] 62 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-sleep-highlighted"] 63 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 64 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 65 | 66 | // Add the item button into the center button 67 | // 68 | [dcPathButton addPathItems:@[itemButton_1, 69 | itemButton_2, 70 | itemButton_3, 71 | itemButton_4, 72 | itemButton_5 73 | ]]; 74 | 75 | // Change the bloom radius, default is 105.0f 76 | // 77 | dcPathButton.bloomRadius = 120.0f; 78 | 79 | // Change the DCButton's center 80 | // 81 | dcPathButton.dcButtonCenter = CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height - 25.5f); 82 | 83 | // Setting the DCButton appearance 84 | // 85 | dcPathButton.allowSounds = YES; 86 | dcPathButton.allowCenterButtonRotation = YES; 87 | 88 | dcPathButton.bottomViewColor = [UIColor blackColor]; 89 | 90 | dcPathButton.bloomDirection = kDCPathButtonBloomDirectionTop; 91 | 92 | [self.view addSubview:dcPathButton]; 93 | } 94 | 95 | - (UIStatusBarStyle)preferredStatusBarStyle { 96 | return UIStatusBarStyleLightContent; 97 | } 98 | 99 | #pragma mark - DCPathButton Delegate 100 | 101 | - (void)pathButton:(DCPathButton *)dcPathButton didUpdateOrientation:(DCPathButtonOrientation)orientation { 102 | // Update the buttons center to account for the device orientation change. 103 | // 104 | [UIView transitionWithView:self.view duration:0.3 options:UIViewAnimationOptionLayoutSubviews animations:^{ 105 | dcPathButton.dcButtonCenter = CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height - 25.5f); 106 | } completion:NULL]; 107 | } 108 | 109 | - (void)willPresentDCPathButtonItems:(DCPathButton *)dcPathButton { 110 | NSLog(@"ItemButton will present"); 111 | } 112 | 113 | - (void)pathButton:(DCPathButton *)dcPathButton clickItemButtonAtIndex:(NSUInteger)itemButtonIndex { 114 | NSLog(@"You tap %@ at index : %tu", dcPathButton, itemButtonIndex); 115 | } 116 | 117 | - (void)didPresentDCPathButtonItems:(DCPathButton *)dcPathButton { 118 | NSLog(@"ItemButton did present"); 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /Example/Example/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Example 4 | // 5 | // Created by tang dixi on 12/8/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DCPathButton.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | 23 | [self configureDCPathButton]; 24 | } 25 | 26 | - (void)configureDCPathButton 27 | { 28 | // Configure center button 29 | // 30 | DCPathButton *dcPathButton = [[DCPathButton alloc]initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"] 31 | highlightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]]; 32 | dcPathButton.delegate = self; 33 | 34 | // Configure item buttons 35 | // 36 | DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-music"] 37 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-music-highlighted"] 38 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 39 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 40 | 41 | DCPathItemButton *itemButton_2 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-place"] 42 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-place-highlighted"] 43 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 44 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 45 | 46 | DCPathItemButton *itemButton_3 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-camera"] 47 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-camera-highlighted"] 48 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 49 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 50 | 51 | DCPathItemButton *itemButton_4 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-thought"] 52 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-thought-highlighted"] 53 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 54 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 55 | 56 | DCPathItemButton *itemButton_5 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-sleep"] 57 | highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-sleep-highlighted"] 58 | backgroundImage:[UIImage imageNamed:@"chooser-moment-button"] 59 | backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]]; 60 | 61 | // Add the item button into the center button 62 | // 63 | [dcPathButton addPathItems:@[itemButton_1, 64 | itemButton_2, 65 | itemButton_3, 66 | itemButton_4, 67 | itemButton_5 68 | ]]; 69 | 70 | // Change the bloom radius, default is 105.0f 71 | // 72 | dcPathButton.bloomRadius = 120.0f; 73 | 74 | // Change the DCButton's center 75 | // 76 | dcPathButton.dcButtonCenter = CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height - 25.5f); 77 | 78 | // Setting the DCButton appearance 79 | // 80 | dcPathButton.allowSounds = YES; 81 | dcPathButton.allowCenterButtonRotation = YES; 82 | 83 | dcPathButton.bottomViewColor = [UIColor grayColor]; 84 | 85 | dcPathButton.bloomDirection = kDCPathButtonBloomDirectionTopRight; 86 | dcPathButton.dcButtonCenter = CGPointMake(10 + dcPathButton.frame.size.width/2, self.view.frame.size.height - dcPathButton.frame.size.height/2 - 10); 87 | dcPathButton.bottomViewColor = [UIColor blackColor]; 88 | 89 | [self.view addSubview:dcPathButton]; 90 | 91 | } 92 | 93 | - (void)didReceiveMemoryWarning 94 | { 95 | [super didReceiveMemoryWarning]; 96 | // Dispose of any resources that can be recreated. 97 | } 98 | 99 | #pragma mark - DCPathButton Delegate 100 | 101 | - (void)willPresentDCPathButtonItems:(DCPathButton *)dcPathButton { 102 | 103 | NSLog(@"ItemButton will present"); 104 | 105 | } 106 | 107 | - (void)didPresentDCPathButtonItems:(DCPathButton *)dcPathButton { 108 | 109 | NSLog(@"ItemButton did present"); 110 | 111 | } 112 | 113 | - (void)pathButton:(DCPathButton *)dcPathButton clickItemButtonAtIndex:(NSUInteger)itemButtonIndex { 114 | NSLog(@"You tap %@ at index : %lu", dcPathButton, (unsigned long)itemButtonIndex); 115 | } 116 | 117 | - (void)willDismissDCPathButtonItems:(DCPathButton *)dcPathButton { 118 | 119 | NSLog(@"ItemButton will dismiss"); 120 | } 121 | 122 | - (void)didDismissDCPathButtonItems:(DCPathButton *)dcPathButton { 123 | 124 | NSLog(@"ItemButton did dismiss"); 125 | 126 | } 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /DCPathButton/Classes/DCPathButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathButton.h 3 | // DCPathButton 4 | // 5 | // Created by tang dixi on 30/7/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "DCPathItemButton.h" 10 | 11 | @import UIKit; 12 | @import QuartzCore; 13 | @import AudioToolbox; 14 | 15 | @class DCPathButton; 16 | 17 | /*! 18 | * The device orientation. 19 | */ 20 | typedef NS_ENUM(NSInteger, DCPathButtonOrientation) { 21 | DCPathButtonOrientationUnknown, 22 | DCPathButtonOrientationPortrait, 23 | DCPathButtonOrientationLandscape 24 | }; 25 | 26 | /*! 27 | * The direction of a `DCPathButton` object's bloom animation. 28 | */ 29 | typedef NS_ENUM(NSUInteger, kDCPathButtonBloomDirection) { 30 | /*! 31 | * Bloom animation gose to the top of the `DCPathButton` object. 32 | */ 33 | kDCPathButtonBloomDirectionTop = 1, 34 | /*! 35 | * Bloom animation gose to top left of the `DCPathButton` object. 36 | */ 37 | kDCPathButtonBloomDirectionTopLeft = 2, 38 | /*! 39 | * Bloom animation gose to the left of the `DCPathButton` object. 40 | */ 41 | kDCPathButtonBloomDirectionLeft = 3, 42 | /*! 43 | * Bloom animation gose to bottom left of the `DCPathButton` object. 44 | */ 45 | kDCPathButtonBloomDirectionBottomLeft = 4, 46 | /*! 47 | * Bloom animation gose to the bottom of the `DCPathButton` object. 48 | */ 49 | kDCPathButtonBloomDirectionBottom = 5, 50 | /*! 51 | * Bloom animation gose to bottom right of the `DCPathButton` object. 52 | */ 53 | kDCPathButtonBloomDirectionBottomRight = 6, 54 | /*! 55 | * Bloom animation gose to the right of the `DCPathButton` object. 56 | */ 57 | kDCPathButtonBloomDirectionRight = 7, 58 | /*! 59 | * Bloom animation gose around the `DCPathButton` object. 60 | */ 61 | kDCPathButtonBloomDirectionTopRight = 8, 62 | }; 63 | 64 | /*! 65 | * `DCPathButtonDelegate` protocol defines methods that inform the delegate object the events of item button's selection, presentation and dismissal. 66 | */ 67 | @protocol DCPathButtonDelegate 68 | 69 | /*! 70 | * Tells the delegate that the item button at an index is clicked. 71 | * 72 | * @param dcPathButton A `DCPathButton` object informing the delegate about the button click. 73 | * @param itemButtonIndex The index of the item button being clicked. 74 | */ 75 | - (void)pathButton:(DCPathButton *)dcPathButton clickItemButtonAtIndex:(NSUInteger)itemButtonIndex; 76 | 77 | @optional 78 | 79 | /*! 80 | * Tells the delegate that the `DCPathButton` object will present its items. 81 | * 82 | * @param dcPathButton A `DCPathButton` object that is about to present its items. 83 | */ 84 | - (void)willPresentDCPathButtonItems:(DCPathButton *)dcPathButton; 85 | /*! 86 | * Tells the delegate that the `DCPathButton` object has already presented its items. 87 | * 88 | * @param dcPathButton A `DCPathButton` object that has presented its items. 89 | */ 90 | - (void)didPresentDCPathButtonItems:(DCPathButton *)dcPathButton; 91 | 92 | /*! 93 | * Tells the delegate that the `DCPathButton` object will dismiss its items. 94 | * 95 | * @param dcPathButton A `DCPathButton` object that is about to dismiss its items 96 | */ 97 | - (void)willDismissDCPathButtonItems:(DCPathButton *)dcPathButton; 98 | /*! 99 | * Tells the delegate that the `DCPathButton` object has already dismissed its items. 100 | * 101 | * @param dcPathButton A `DCPathButton` object that has dismissed its items. 102 | */ 103 | - (void)didDismissDCPathButtonItems:(DCPathButton *)dcPathButton; 104 | 105 | /*! 106 | * Tells the delegate the device orientation changed. Use this method to change the path buttons center. 107 | * 108 | * @param dcPathButton A `DCPathButton` object who received a device orientation changed notification. 109 | * @param orientation The updated device orientation. 110 | */ 111 | - (void)pathButton:(DCPathButton *)dcPathButton didUpdateOrientation:(DCPathButtonOrientation)orientation; 112 | 113 | @end 114 | 115 | @interface DCPathButton : UIView 116 | 117 | /*! 118 | * The object that acts as the delegate of the `DCPathButton` object. 119 | */ 120 | @property (weak, nonatomic) id delegate; 121 | 122 | /*! 123 | * `DCPathButton` object's bloom animation's duration. 124 | */ 125 | @property (assign, nonatomic) NSTimeInterval basicDuration; 126 | /*! 127 | * `YES` if allows `DCPathButton` object's sub items to rotate. Otherwise `NO`. 128 | */ 129 | @property (assign, nonatomic) BOOL allowSubItemRotation; 130 | 131 | /*! 132 | * `DCPathButton` object's bloom radius. The default value is 105.0f. 133 | */ 134 | @property (assign, nonatomic) CGFloat bloomRadius; 135 | 136 | /*! 137 | * `DCPathButton` object's bloom angle. 138 | */ 139 | @property (assign, nonatomic) CGFloat bloomAngel; 140 | 141 | /*! 142 | * The center of a `DCPathButton` object's position. The default value positions the `DCPathButton` object in bottom center. 143 | */ 144 | @property (assign, nonatomic) CGPoint dcButtonCenter; 145 | 146 | /*! 147 | * If set to `YES` a sound will be played when the `DCPathButton` object is being interacted. The default value is `YES`. 148 | */ 149 | @property (assign, nonatomic) BOOL allowSounds; 150 | 151 | /*! 152 | * The path to the `DCPathButton` object's bloom effect sound file. 153 | */ 154 | @property (copy, nonatomic) NSString *bloomSoundPath; 155 | 156 | /*! 157 | * The path to the `DCPathButton` object's fold effect sound file. 158 | */ 159 | @property (copy, nonatomic) NSString *foldSoundPath; 160 | 161 | /*! 162 | * The path to the `DCPathButton` object's item action sound file. 163 | */ 164 | @property (copy, nonatomic) NSString *itemSoundPath; 165 | 166 | /*! 167 | * `YES` if allows the `DCPathButton` object's center button to rotate. Otherwise `NO`. 168 | */ 169 | @property (assign, nonatomic) BOOL allowCenterButtonRotation; 170 | 171 | /*! 172 | * Color of the backdrop view when `DCPathButton` object's sub items are shown. 173 | */ 174 | @property (strong, nonatomic) UIColor *bottomViewColor; 175 | 176 | /*! 177 | * Direction of `DCPathButton` object's bloom animation. 178 | */ 179 | @property (assign, nonatomic) kDCPathButtonBloomDirection bloomDirection; 180 | 181 | /*! 182 | * Creates a `DCPathButton` object with a given normal image and highlited images for center button. 183 | * 184 | * @param centerImage The normal image for `DCPathButton` object's center button. 185 | * @param centerHighlightedImage The highlighted image for `DCPathButton` object's center button. 186 | * 187 | * @return A `DCPathButton` object. 188 | */ 189 | - (instancetype)initWithCenterImage:(UIImage *)centerImage 190 | highlightedImage:(UIImage *)centerHighlightedImage; 191 | 192 | /*! 193 | * Creates a `DCPathButton` object with a given frame, normal and highlighted images for its center button. 194 | * 195 | * @param centerButtonFrame The frame of `DCPathButton` object. 196 | * @param centerImage The normal image for `DCPathButton` object's center button. 197 | * @param centerHighlightedImage The highlighted image for `DCPathButton` object's center button. 198 | * 199 | * @return A `DCPathButton` object. 200 | */ 201 | - (instancetype)initWithButtonFrame:(CGRect)centerButtonFrame 202 | centerImage:(UIImage *)centerImage 203 | highlightedImage:(UIImage *)centerHighlightedImage; 204 | 205 | /*! 206 | * Adds item buttons to an existing `DCPathButton` object. 207 | * 208 | * @param pathItemButtons The item buttons to be added. 209 | */ 210 | - (void)addPathItems:(NSArray *)pathItemButtons; 211 | 212 | @end 213 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # DCPathButton 3 | 4 | [![Build Status](https://api.travis-ci.org/Tangdixi/DCPathButton.svg?branch=master)](https://travis-ci.org/Tangdixi/DCPathButton) 5 | 6 | ![Foled](https://raw.githubusercontent.com/Tangdixi/DCPathButton/master/ScreenShot/1.png) 7 | ![Bloom](https://raw.githubusercontent.com/Tangdixi/DCPathButton/master/ScreenShot/2.png) 8 | 9 | **DCPathButton** is a custom menu button for iOS. The original design for this control first appeared in the well-known iOS app, [**Path**](www.path.com). Starting in **Path 4.0**, this beautiful button appeared in the tab bar, with a new design. The **DCPathButton** is a close replication of Path's button, including the **animations**, the **sounds** and the **button's images** (*of course you can use your own images*). 10 | 11 | ## Swift Version 12 | 13 | Working on Swift Version now. It need some times ... 14 | 15 | ## How To Get Started 16 | 17 | - Download [**DCPathButton**](https://codeload.github.com/Tangdixi/DCPathButton/zip/master) 18 | - Clone **DCPathButton** 19 | 20 | ```bash 21 | git clone git@github.com:Tangdixi/DCPathButton.git 22 | ``` 23 | 24 | ## Installation 25 | 26 | You can install **DCPathButton** in a traditional way -- drag the **DCPathButton** folder into your project. However, it is strongly recommended that you install via **CocoaPods**. 27 | 28 | #### Requirements 29 | 30 | - **AudioToolBox.framework** 31 | - **QuartzCore.framework** 32 | 33 | ## Install with CocoaPods 34 | [CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C and Swift, which automates and simplifies the process of using 3rd-party libraries like **DCPathButton** in your projects. 35 | 36 | #### Podfile 37 | ```bash 38 | platform :ios, '7.0' 39 | pod 'DCPathButton', '~> 2.1.3' 40 | ``` 41 | 42 | ## Usage 43 | 44 | #### Create a DCPathButton 45 | 46 | 1.import the "DCPathButton" to your controller 47 | ```objc 48 | import "DCPathButton.h" 49 | ``` 50 | 2.Add the `DCPathButtonDelegate` to your controller 51 | ```objc 52 | @interface ViewController () 53 | ``` 54 | 3.Create a center button and add it into your view 55 | ```objc 56 | DCPathButton *centerButton = [[DCPathButton alloc]initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"] 57 | hilightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]]; 58 | [self.view addSubView:centerButton]; 59 | ``` 60 | 4.Create some item buttons and add them to the center button 61 | 62 | ```objc 63 | DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"image"] 64 | highlightedImage:[UIImage imageNamed:@"highlightedImage"] 65 | backgroundImage:[UIImage imageNamed:@"backgroundImage"] 66 | backgroundHighlightedImage:[UIImage imageNamed:@"backgroundhighlightedImage"]]; 67 | 68 | [centerButton addPathItems:@[itemButton_1]]; 69 | ``` 70 | ------ 71 | 72 | #### DCPathButtonDelegate 73 | 74 | `` handle the action when you fire the item buttons which is similar to the **UITableViewDelegate**, control the items through the **index** 75 | 76 | You can add a minimum of one item or a maximum of five items. The `itemButtonIndex` parameter is Assuming we have five items, so the **itemButtonIndex** is 0 to 4. 77 | 78 | ```objc 79 | - (void)pathButton:(DCPathButton *)dcPathButton clickItemButtonAtIndex:(NSUInteger)itemButtonIndex { 80 | NSLog(@"You tap %@ at index : %lu", dcPathButton, (unsigned long)itemButtonIndex); 81 | } 82 | ``` 83 | 84 | You also can do something before or when the item buttons appear: 85 | 86 | ```objc 87 | - (void)willPresentItemButton { 88 | 89 | NSLog(@"ItemButton will present"); 90 | 91 | } 92 | - (void)didPresentItemButton { 93 | 94 | NSLog(@"ItemButton did present"); 95 | 96 | } 97 | ``` 98 | 99 | ------ 100 | 101 | ## Custom Properties 102 | 103 | ```objc 104 | @property (assign, nonatomic) CGFloat bloomRadius; 105 | ``` 106 | 107 | `bloomRadius` is used to handle the item button bloom radius. The default value is `105.0f`. 108 | 109 | ------ 110 | 111 | ```objc 112 | @property (assign, nonatomic) CGPoint dcButtonCenter; 113 | ``` 114 | 115 | `dcButtonCenter` is used to modify the center button's position. The default value positions the **DCPathButton** in bottom center. 116 | 117 | ------ 118 | 119 | ```objc 120 | @property (assign, nonatomic) BOOL allowSounds; 121 | ``` 122 | 123 | `allowSounds ` is used to enable the button's sound. The default value is `YES`. 124 | 125 | ------ 126 | 127 | ```objc 128 | @property (copy, nonatomic) NSString *bloomSoundPath; 129 | @property (copy, nonatomic) NSString *foldSoundPath; 130 | @property (copy, nonatomic) NSString *itemSoundPath; 131 | ``` 132 | You can change the button's sound by specifying the path of a custom sound file, for instance: 133 | 134 | ```objc 135 | self.bloomSoundPath = [[NSBundle mainBundle] pathForResource:@"bloom" ofType:@"caf"]; 136 | ``` 137 | 138 | ------ 139 | 140 | ```objc 141 | @property (assign, nonatomic) kDCPathButtonBloomDirection bloomDirection; 142 | ``` 143 | There are `9` directions in **DCPathButton**, use the `bloomDirection` property to change the direction. All the directions are defined in the `NS_ENUM` below: 144 | 145 | ```objc 146 | typedef NS_ENUM(NSUInteger, kDCPathButtonBloomDirection) { 147 | 148 | kDCPathButtonBloomDirectionTop = 1, 149 | kDCPathButtonBloomDirectionTopLeft = 2, 150 | kDCPathButtonBloomDirectionLeft = 3, 151 | kDCPathButtonBloomDirectionBottomLeft = 4, 152 | kDCPathButtonBloomDirectionBottom = 5, 153 | kDCPathButtonBloomDirectionBottomRight = 6, 154 | kDCPathButtonBloomDirectionRight = 7, 155 | kDCPathButtonBloomDirectionTopRight = 8, 156 | kDCPathButtonBloomDirectionCenter = 9, 157 | 158 | }; 159 | ``` 160 | ------ 161 | 162 | ```objc 163 | @property (assign, nonatomic) CGFloat bloomAngel; 164 | ``` 165 | `bloomAngel` is used for changing the item button's bloom angle. 166 | 167 | ------ 168 | 169 | ```objc 170 | @property (assign, nonatomic) BOOL allowSubItemRotation; 171 | ``` 172 | `allowSubItemRotation ` is used for handling the rotation of the subItems. 173 | 174 | ------ 175 | 176 | ```objc 177 | @property (assign, nonatomic) NSTimeInterval basicDuration; 178 | ``` 179 | `basicDuration ` is used for changing the bloom animation's duration / speed. 180 | 181 | ## Swift Example 182 | 183 | A Swift version of the project is coming. For now refer to the included Swift example to understand how you might integrate this project into your own Swift app. 184 | 185 | ## Contribution 186 | 187 | Special Thanks for these Pull Requests: 188 | * [AlexJeng's](https://github.com/AlexJeng/DCPathButton/commit/05228d583626f839a17f40613afb30f013cc34f0) 189 | * [wangweiarr's](https://github.com/wangweiarr/DCPathButton/commit/d723afdcd32bcfffadba5e60698b027aa29e95df) 190 | * [thundertrick's](https://github.com/Tangdixi/DCPathButton/pull/33) 191 | * [Ian Hirschfeld's](https://github.com/Tangdixi/DCPathButton/pull/47) 192 | * [skyline75489's](https://github.com/Tangdixi/DCPathButton/pull/49) 193 | * [tdubik's](https://github.com/Tangdixi/DCPathButton/pull/50) 194 | * [Sam Spencer's](https://github.com/Tangdixi/DCPathButton/pull/54) 195 | * [Peng90's](https://github.com/Tangdixi/DCPathButton/pull/56) 196 | * [Kevin](https://github.com/Tangdixi/DCPathButton/pull/64) 197 | 198 | ## Issues, Bugs, Suggestions 199 | 200 | Open an [issue](https://github.com/Tangdixi/DCPathButton/issues) 201 | 202 | ## License 203 | 204 | **DCPathButton** is available under the MIT license. See the LICENSE file for more info. 205 | -------------------------------------------------------------------------------- /Example-Swift/Example-Swift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8167547A1B1CAD4700E1E464 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 816754791B1CAD4700E1E464 /* AppDelegate.swift */; }; 11 | 8167547C1B1CAD4700E1E464 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8167547B1B1CAD4700E1E464 /* ViewController.swift */; }; 12 | 8167547F1B1CAD4700E1E464 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8167547D1B1CAD4700E1E464 /* Main.storyboard */; }; 13 | 816754841B1CAD4700E1E464 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 816754821B1CAD4700E1E464 /* LaunchScreen.xib */; }; 14 | 816754901B1CAD4700E1E464 /* Example_SwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8167548F1B1CAD4700E1E464 /* Example_SwiftTests.swift */; }; 15 | 816754B91B1CAFDE00E1E464 /* DCPathButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 816754B21B1CAFDE00E1E464 /* DCPathButton.m */; }; 16 | 816754BA1B1CAFDE00E1E464 /* DCPathItemButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 816754B41B1CAFDE00E1E464 /* DCPathItemButton.m */; }; 17 | 816754BB1B1CAFDE00E1E464 /* bloom.caf in Resources */ = {isa = PBXBuildFile; fileRef = 816754B61B1CAFDE00E1E464 /* bloom.caf */; }; 18 | 816754BC1B1CAFDE00E1E464 /* fold.caf in Resources */ = {isa = PBXBuildFile; fileRef = 816754B71B1CAFDE00E1E464 /* fold.caf */; }; 19 | 816754BD1B1CAFDE00E1E464 /* selected.caf in Resources */ = {isa = PBXBuildFile; fileRef = 816754B81B1CAFDE00E1E464 /* selected.caf */; }; 20 | 816754C11B1D94C600E1E464 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 816754C01B1D94C600E1E464 /* Images.xcassets */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 8167548A1B1CAD4700E1E464 /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 8167546C1B1CAD4700E1E464 /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 816754731B1CAD4700E1E464; 29 | remoteInfo = "Example-Swift"; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 816754741B1CAD4700E1E464 /* Example-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 816754781B1CAD4700E1E464 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 816754791B1CAD4700E1E464 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 8167547B1B1CAD4700E1E464 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 38 | 8167547E1B1CAD4700E1E464 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | 816754831B1CAD4700E1E464 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 40 | 816754891B1CAD4700E1E464 /* Example-SwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Example-SwiftTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 8167548E1B1CAD4700E1E464 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | 8167548F1B1CAD4700E1E464 /* Example_SwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example_SwiftTests.swift; sourceTree = ""; }; 43 | 816754B11B1CAFDE00E1E464 /* DCPathButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPathButton.h; sourceTree = ""; }; 44 | 816754B21B1CAFDE00E1E464 /* DCPathButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPathButton.m; sourceTree = ""; }; 45 | 816754B31B1CAFDE00E1E464 /* DCPathItemButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPathItemButton.h; sourceTree = ""; }; 46 | 816754B41B1CAFDE00E1E464 /* DCPathItemButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPathItemButton.m; sourceTree = ""; }; 47 | 816754B61B1CAFDE00E1E464 /* bloom.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = bloom.caf; sourceTree = ""; }; 48 | 816754B71B1CAFDE00E1E464 /* fold.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = fold.caf; sourceTree = ""; }; 49 | 816754B81B1CAFDE00E1E464 /* selected.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = selected.caf; sourceTree = ""; }; 50 | 816754BF1B1CB06F00E1E464 /* Example-Swift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Example-Swift-Bridging-Header.h"; sourceTree = ""; }; 51 | 816754C01B1D94C600E1E464 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 816754711B1CAD4700E1E464 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | 816754861B1CAD4700E1E464 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 8167546B1B1CAD4700E1E464 = { 73 | isa = PBXGroup; 74 | children = ( 75 | 816754BF1B1CB06F00E1E464 /* Example-Swift-Bridging-Header.h */, 76 | 816754AF1B1CAFDE00E1E464 /* DCPathButton */, 77 | 816754761B1CAD4700E1E464 /* Example-Swift */, 78 | 8167548C1B1CAD4700E1E464 /* Example-SwiftTests */, 79 | 816754751B1CAD4700E1E464 /* Products */, 80 | ); 81 | sourceTree = ""; 82 | }; 83 | 816754751B1CAD4700E1E464 /* Products */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 816754741B1CAD4700E1E464 /* Example-Swift.app */, 87 | 816754891B1CAD4700E1E464 /* Example-SwiftTests.xctest */, 88 | ); 89 | name = Products; 90 | sourceTree = ""; 91 | }; 92 | 816754761B1CAD4700E1E464 /* Example-Swift */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 816754791B1CAD4700E1E464 /* AppDelegate.swift */, 96 | 8167547B1B1CAD4700E1E464 /* ViewController.swift */, 97 | 8167547D1B1CAD4700E1E464 /* Main.storyboard */, 98 | 816754821B1CAD4700E1E464 /* LaunchScreen.xib */, 99 | 816754C01B1D94C600E1E464 /* Images.xcassets */, 100 | 816754771B1CAD4700E1E464 /* Supporting Files */, 101 | ); 102 | path = "Example-Swift"; 103 | sourceTree = ""; 104 | }; 105 | 816754771B1CAD4700E1E464 /* Supporting Files */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 816754781B1CAD4700E1E464 /* Info.plist */, 109 | ); 110 | name = "Supporting Files"; 111 | sourceTree = ""; 112 | }; 113 | 8167548C1B1CAD4700E1E464 /* Example-SwiftTests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 8167548F1B1CAD4700E1E464 /* Example_SwiftTests.swift */, 117 | 8167548D1B1CAD4700E1E464 /* Supporting Files */, 118 | ); 119 | path = "Example-SwiftTests"; 120 | sourceTree = ""; 121 | }; 122 | 8167548D1B1CAD4700E1E464 /* Supporting Files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 8167548E1B1CAD4700E1E464 /* Info.plist */, 126 | ); 127 | name = "Supporting Files"; 128 | sourceTree = ""; 129 | }; 130 | 816754AF1B1CAFDE00E1E464 /* DCPathButton */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 816754B01B1CAFDE00E1E464 /* Classes */, 134 | 816754B51B1CAFDE00E1E464 /* Sounds */, 135 | ); 136 | path = DCPathButton; 137 | sourceTree = ""; 138 | }; 139 | 816754B01B1CAFDE00E1E464 /* Classes */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 816754B11B1CAFDE00E1E464 /* DCPathButton.h */, 143 | 816754B21B1CAFDE00E1E464 /* DCPathButton.m */, 144 | 816754B31B1CAFDE00E1E464 /* DCPathItemButton.h */, 145 | 816754B41B1CAFDE00E1E464 /* DCPathItemButton.m */, 146 | ); 147 | path = Classes; 148 | sourceTree = ""; 149 | }; 150 | 816754B51B1CAFDE00E1E464 /* Sounds */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 816754B61B1CAFDE00E1E464 /* bloom.caf */, 154 | 816754B71B1CAFDE00E1E464 /* fold.caf */, 155 | 816754B81B1CAFDE00E1E464 /* selected.caf */, 156 | ); 157 | path = Sounds; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | 816754731B1CAD4700E1E464 /* Example-Swift */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = 816754931B1CAD4700E1E464 /* Build configuration list for PBXNativeTarget "Example-Swift" */; 166 | buildPhases = ( 167 | 816754701B1CAD4700E1E464 /* Sources */, 168 | 816754711B1CAD4700E1E464 /* Frameworks */, 169 | 816754721B1CAD4700E1E464 /* Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | ); 175 | name = "Example-Swift"; 176 | productName = "Example-Swift"; 177 | productReference = 816754741B1CAD4700E1E464 /* Example-Swift.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | 816754881B1CAD4700E1E464 /* Example-SwiftTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 816754961B1CAD4700E1E464 /* Build configuration list for PBXNativeTarget "Example-SwiftTests" */; 183 | buildPhases = ( 184 | 816754851B1CAD4700E1E464 /* Sources */, 185 | 816754861B1CAD4700E1E464 /* Frameworks */, 186 | 816754871B1CAD4700E1E464 /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | 8167548B1B1CAD4700E1E464 /* PBXTargetDependency */, 192 | ); 193 | name = "Example-SwiftTests"; 194 | productName = "Example-SwiftTests"; 195 | productReference = 816754891B1CAD4700E1E464 /* Example-SwiftTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | 8167546C1B1CAD4700E1E464 /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | LastUpgradeCheck = 0630; 205 | ORGANIZATIONNAME = DC; 206 | TargetAttributes = { 207 | 816754731B1CAD4700E1E464 = { 208 | CreatedOnToolsVersion = 6.3.1; 209 | }; 210 | 816754881B1CAD4700E1E464 = { 211 | CreatedOnToolsVersion = 6.3.1; 212 | TestTargetID = 816754731B1CAD4700E1E464; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = 8167546F1B1CAD4700E1E464 /* Build configuration list for PBXProject "Example-Swift" */; 217 | compatibilityVersion = "Xcode 3.2"; 218 | developmentRegion = English; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | ); 224 | mainGroup = 8167546B1B1CAD4700E1E464; 225 | productRefGroup = 816754751B1CAD4700E1E464 /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | 816754731B1CAD4700E1E464 /* Example-Swift */, 230 | 816754881B1CAD4700E1E464 /* Example-SwiftTests */, 231 | ); 232 | }; 233 | /* End PBXProject section */ 234 | 235 | /* Begin PBXResourcesBuildPhase section */ 236 | 816754721B1CAD4700E1E464 /* Resources */ = { 237 | isa = PBXResourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | 8167547F1B1CAD4700E1E464 /* Main.storyboard in Resources */, 241 | 816754BD1B1CAFDE00E1E464 /* selected.caf in Resources */, 242 | 816754841B1CAD4700E1E464 /* LaunchScreen.xib in Resources */, 243 | 816754C11B1D94C600E1E464 /* Images.xcassets in Resources */, 244 | 816754BB1B1CAFDE00E1E464 /* bloom.caf in Resources */, 245 | 816754BC1B1CAFDE00E1E464 /* fold.caf in Resources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | 816754871B1CAD4700E1E464 /* Resources */ = { 250 | isa = PBXResourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXResourcesBuildPhase section */ 257 | 258 | /* Begin PBXSourcesBuildPhase section */ 259 | 816754701B1CAD4700E1E464 /* Sources */ = { 260 | isa = PBXSourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | 816754BA1B1CAFDE00E1E464 /* DCPathItemButton.m in Sources */, 264 | 816754B91B1CAFDE00E1E464 /* DCPathButton.m in Sources */, 265 | 8167547C1B1CAD4700E1E464 /* ViewController.swift in Sources */, 266 | 8167547A1B1CAD4700E1E464 /* AppDelegate.swift in Sources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | 816754851B1CAD4700E1E464 /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 816754901B1CAD4700E1E464 /* Example_SwiftTests.swift in Sources */, 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | /* End PBXSourcesBuildPhase section */ 279 | 280 | /* Begin PBXTargetDependency section */ 281 | 8167548B1B1CAD4700E1E464 /* PBXTargetDependency */ = { 282 | isa = PBXTargetDependency; 283 | target = 816754731B1CAD4700E1E464 /* Example-Swift */; 284 | targetProxy = 8167548A1B1CAD4700E1E464 /* PBXContainerItemProxy */; 285 | }; 286 | /* End PBXTargetDependency section */ 287 | 288 | /* Begin PBXVariantGroup section */ 289 | 8167547D1B1CAD4700E1E464 /* Main.storyboard */ = { 290 | isa = PBXVariantGroup; 291 | children = ( 292 | 8167547E1B1CAD4700E1E464 /* Base */, 293 | ); 294 | name = Main.storyboard; 295 | sourceTree = ""; 296 | }; 297 | 816754821B1CAD4700E1E464 /* LaunchScreen.xib */ = { 298 | isa = PBXVariantGroup; 299 | children = ( 300 | 816754831B1CAD4700E1E464 /* Base */, 301 | ); 302 | name = LaunchScreen.xib; 303 | sourceTree = ""; 304 | }; 305 | /* End PBXVariantGroup section */ 306 | 307 | /* Begin XCBuildConfiguration section */ 308 | 816754911B1CAD4700E1E464 /* Debug */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ALWAYS_SEARCH_USER_PATHS = NO; 312 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 313 | CLANG_CXX_LIBRARY = "libc++"; 314 | CLANG_ENABLE_MODULES = YES; 315 | CLANG_ENABLE_OBJC_ARC = YES; 316 | CLANG_WARN_BOOL_CONVERSION = YES; 317 | CLANG_WARN_CONSTANT_CONVERSION = YES; 318 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 319 | CLANG_WARN_EMPTY_BODY = YES; 320 | CLANG_WARN_ENUM_CONVERSION = YES; 321 | CLANG_WARN_INT_CONVERSION = YES; 322 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 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 = NO; 327 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 328 | ENABLE_STRICT_OBJC_MSGSEND = YES; 329 | GCC_C_LANGUAGE_STANDARD = gnu99; 330 | GCC_DYNAMIC_NO_PIC = NO; 331 | GCC_NO_COMMON_BLOCKS = YES; 332 | GCC_OPTIMIZATION_LEVEL = 0; 333 | GCC_PREPROCESSOR_DEFINITIONS = ( 334 | "DEBUG=1", 335 | "$(inherited)", 336 | ); 337 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 338 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 339 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 340 | GCC_WARN_UNDECLARED_SELECTOR = YES; 341 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 342 | GCC_WARN_UNUSED_FUNCTION = YES; 343 | GCC_WARN_UNUSED_VARIABLE = YES; 344 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 345 | MTL_ENABLE_DEBUG_INFO = YES; 346 | ONLY_ACTIVE_ARCH = YES; 347 | SDKROOT = iphoneos; 348 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 349 | }; 350 | name = Debug; 351 | }; 352 | 816754921B1CAD4700E1E464 /* Release */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | ALWAYS_SEARCH_USER_PATHS = NO; 356 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 357 | CLANG_CXX_LIBRARY = "libc++"; 358 | CLANG_ENABLE_MODULES = YES; 359 | CLANG_ENABLE_OBJC_ARC = YES; 360 | CLANG_WARN_BOOL_CONVERSION = YES; 361 | CLANG_WARN_CONSTANT_CONVERSION = YES; 362 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 363 | CLANG_WARN_EMPTY_BODY = YES; 364 | CLANG_WARN_ENUM_CONVERSION = YES; 365 | CLANG_WARN_INT_CONVERSION = YES; 366 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 367 | CLANG_WARN_UNREACHABLE_CODE = YES; 368 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 369 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 370 | COPY_PHASE_STRIP = NO; 371 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 372 | ENABLE_NS_ASSERTIONS = NO; 373 | ENABLE_STRICT_OBJC_MSGSEND = YES; 374 | GCC_C_LANGUAGE_STANDARD = gnu99; 375 | GCC_NO_COMMON_BLOCKS = YES; 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 383 | MTL_ENABLE_DEBUG_INFO = NO; 384 | SDKROOT = iphoneos; 385 | VALIDATE_PRODUCT = YES; 386 | }; 387 | name = Release; 388 | }; 389 | 816754941B1CAD4700E1E464 /* Debug */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 393 | INFOPLIST_FILE = "Example-Swift/Info.plist"; 394 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/Example-Swift-Bridging-Header.h"; 397 | }; 398 | name = Debug; 399 | }; 400 | 816754951B1CAD4700E1E464 /* Release */ = { 401 | isa = XCBuildConfiguration; 402 | buildSettings = { 403 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 404 | INFOPLIST_FILE = "Example-Swift/Info.plist"; 405 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/Example-Swift-Bridging-Header.h"; 408 | }; 409 | name = Release; 410 | }; 411 | 816754971B1CAD4700E1E464 /* Debug */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | BUNDLE_LOADER = "$(TEST_HOST)"; 415 | FRAMEWORK_SEARCH_PATHS = ( 416 | "$(SDKROOT)/Developer/Library/Frameworks", 417 | "$(inherited)", 418 | ); 419 | GCC_PREPROCESSOR_DEFINITIONS = ( 420 | "DEBUG=1", 421 | "$(inherited)", 422 | ); 423 | INFOPLIST_FILE = "Example-SwiftTests/Info.plist"; 424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 425 | PRODUCT_NAME = "$(TARGET_NAME)"; 426 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example-Swift.app/Example-Swift"; 427 | }; 428 | name = Debug; 429 | }; 430 | 816754981B1CAD4700E1E464 /* Release */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | BUNDLE_LOADER = "$(TEST_HOST)"; 434 | FRAMEWORK_SEARCH_PATHS = ( 435 | "$(SDKROOT)/Developer/Library/Frameworks", 436 | "$(inherited)", 437 | ); 438 | INFOPLIST_FILE = "Example-SwiftTests/Info.plist"; 439 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example-Swift.app/Example-Swift"; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 8167546F1B1CAD4700E1E464 /* Build configuration list for PBXProject "Example-Swift" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 816754911B1CAD4700E1E464 /* Debug */, 452 | 816754921B1CAD4700E1E464 /* Release */, 453 | ); 454 | defaultConfigurationIsVisible = 0; 455 | defaultConfigurationName = Release; 456 | }; 457 | 816754931B1CAD4700E1E464 /* Build configuration list for PBXNativeTarget "Example-Swift" */ = { 458 | isa = XCConfigurationList; 459 | buildConfigurations = ( 460 | 816754941B1CAD4700E1E464 /* Debug */, 461 | 816754951B1CAD4700E1E464 /* Release */, 462 | ); 463 | defaultConfigurationIsVisible = 0; 464 | defaultConfigurationName = Release; 465 | }; 466 | 816754961B1CAD4700E1E464 /* Build configuration list for PBXNativeTarget "Example-SwiftTests" */ = { 467 | isa = XCConfigurationList; 468 | buildConfigurations = ( 469 | 816754971B1CAD4700E1E464 /* Debug */, 470 | 816754981B1CAD4700E1E464 /* Release */, 471 | ); 472 | defaultConfigurationIsVisible = 0; 473 | defaultConfigurationName = Release; 474 | }; 475 | /* End XCConfigurationList section */ 476 | }; 477 | rootObject = 8167546C1B1CAD4700E1E464 /* Project object */; 478 | } 479 | -------------------------------------------------------------------------------- /Example-Swift/DCPathButton/Classes/DCPathButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // DCPathButton.m 3 | // DCPathButton 4 | // 5 | // Created by tang dixi on 30/7/14. 6 | // Copyright (c) 2014 Tangdxi. All rights reserved. 7 | // 8 | 9 | #import "DCPathButton.h" 10 | 11 | @interface DCPathButton () 12 | 13 | #pragma mark - Private Property 14 | 15 | @property (strong, nonatomic) NSMutableArray *itemButtonImages; 16 | @property (strong, nonatomic) NSMutableArray *itemButtonHighlightedImages; 17 | 18 | @property (strong, nonatomic) UIImage *centerImage; 19 | @property (strong, nonatomic) UIImage *centerHighlightedImage; 20 | 21 | @property (assign, nonatomic) CGSize bloomSize; 22 | @property (assign, nonatomic) CGSize foldedSize; 23 | 24 | @property (assign, nonatomic) CGPoint foldCenter; 25 | @property (assign, nonatomic) CGPoint bloomCenter; 26 | @property (assign, nonatomic) CGPoint expandCenter; 27 | @property (assign, nonatomic) CGPoint pathCenterButtonBloomCenter; 28 | 29 | @property (strong, nonatomic) UIView *bottomView; 30 | @property (strong, nonatomic) UIButton *pathCenterButton; 31 | @property (strong, nonatomic) NSMutableArray *itemButtons; 32 | 33 | @property (assign, nonatomic) SystemSoundID foldSound; 34 | @property (assign, nonatomic) SystemSoundID bloomSound; 35 | @property (assign, nonatomic) SystemSoundID selectedSound; 36 | 37 | @property (assign, nonatomic, getter = isBloom) BOOL bloom; 38 | 39 | @end 40 | 41 | @implementation DCPathButton 42 | 43 | #pragma mark - Initialization 44 | 45 | - (instancetype)initWithCenterImage:(UIImage *)centerImage 46 | highlightedImage:(UIImage *)centerHighlightedImage { 47 | return [self initWithButtonFrame:CGRectZero 48 | centerImage:centerImage 49 | highlightedImage:centerHighlightedImage]; 50 | } 51 | 52 | - (instancetype)initWithButtonFrame:(CGRect)centerButtonFrame 53 | centerImage:(UIImage *)centerImage 54 | highlightedImage:(UIImage *)centerHighlightedImage { 55 | 56 | if (self = [super init]) { 57 | 58 | // Configure center and high light center image 59 | // 60 | self.centerImage = centerImage; 61 | self.centerHighlightedImage = centerHighlightedImage; 62 | 63 | // Init button and image array 64 | // 65 | self.itemButtonImages = [[NSMutableArray alloc]init]; 66 | self.itemButtonHighlightedImages = [[NSMutableArray alloc]init]; 67 | self.itemButtons = [[NSMutableArray alloc]init]; 68 | 69 | // Configure views layout 70 | // 71 | if (centerButtonFrame.size.width == 0 && centerButtonFrame.size.height == 0) { 72 | [self configureViewsLayoutWithButtonSize:self.centerImage.size]; 73 | } 74 | else { 75 | [self configureViewsLayoutWithButtonSize:centerButtonFrame.size]; 76 | self.dcButtonCenter = centerButtonFrame.origin; 77 | } 78 | 79 | // Configure the bloom direction 80 | // 81 | _bloomDirection = kDCPathButtonBloomDirectionTop; 82 | 83 | // Configure sounds 84 | // 85 | _bloomSoundPath = [[NSBundle mainBundle]pathForResource:@"bloom" ofType:@"caf"]; 86 | _foldSoundPath = [[NSBundle mainBundle]pathForResource:@"fold" ofType:@"caf"]; 87 | _itemSoundPath = [[NSBundle mainBundle]pathForResource:@"selected" ofType:@"caf"]; 88 | 89 | _allowSounds = YES; 90 | 91 | _bottomViewColor = [UIColor blackColor]; 92 | 93 | } 94 | return self; 95 | } 96 | 97 | - (void)configureViewsLayoutWithButtonSize:(CGSize)centerButtonSize { 98 | // Init some property only once 99 | // 100 | self.foldedSize = centerButtonSize; 101 | self.bloomSize = [UIScreen mainScreen].bounds.size; 102 | 103 | self.bloom = NO; 104 | self.bloomRadius = 105.0f; 105 | self.bloomAngel = 120.0f; 106 | 107 | // Configure the view's center, it will change after the frame folded or bloomed 108 | // 109 | self.foldCenter = CGPointMake(self.bloomSize.width / 2, self.bloomSize.height - 25.5f); 110 | self.bloomCenter = CGPointMake(self.bloomSize.width / 2, self.bloomSize.height / 2); 111 | 112 | // Configure the DCPathButton's origin frame 113 | // 114 | self.frame = CGRectMake(0, 0, self.foldedSize.width, self.foldedSize.height); 115 | 116 | // Default set the foldCenter as the DCPathButton's center 117 | // 118 | self.center = self.foldCenter; 119 | 120 | // Configure center button 121 | // 122 | _pathCenterButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.centerImage.size.width, self.centerImage.size.height)]; 123 | [_pathCenterButton setImage:self.centerImage forState:UIControlStateNormal]; 124 | [_pathCenterButton setImage:self.centerHighlightedImage forState:UIControlStateHighlighted]; 125 | [_pathCenterButton addTarget:self action:@selector(centerButtonTapped) forControlEvents:UIControlEventTouchUpInside]; 126 | _pathCenterButton.center = CGPointMake(self.frame.size.width/2, self.frame.size.height/2); 127 | [self addSubview:_pathCenterButton]; 128 | 129 | // Configure bottom view 130 | // 131 | _bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.bloomSize.width * 2, self.bloomSize.height * 2)]; 132 | _bottomView.backgroundColor = self.bottomViewColor; 133 | _bottomView.alpha = 0.0f; 134 | 135 | // Make bottomView's touch can delay superView witch like UIScrollView scrolling 136 | // 137 | _bottomView.userInteractionEnabled = YES; 138 | UIGestureRecognizer* tapGesture = [[UIGestureRecognizer alloc] initWithTarget:nil action:nil]; 139 | tapGesture.delegate = self; 140 | [_bottomView addGestureRecognizer:tapGesture]; 141 | } 142 | 143 | #pragma mark - Configure Bottom View Color 144 | 145 | - (void)setBottomViewColor:(UIColor *)bottomViewColor { 146 | 147 | if (bottomViewColor) { 148 | _bottomView.backgroundColor = bottomViewColor; 149 | } 150 | 151 | } 152 | 153 | #pragma mark - Configure Button Sound 154 | 155 | - (void)setBloomSoundPath:(NSString *)bloomSoundPath { 156 | 157 | _bloomSoundPath = bloomSoundPath; 158 | 159 | [self configureSounds]; 160 | 161 | } 162 | 163 | - (void)setFoldSoundPath:(NSString *)foldSoundPath { 164 | 165 | _foldSoundPath = foldSoundPath; 166 | 167 | [self configureSounds]; 168 | 169 | } 170 | 171 | - (void)setItemSoundPath:(NSString *)itemSoundPath { 172 | 173 | _itemSoundPath = itemSoundPath; 174 | 175 | [self configureSounds]; 176 | 177 | } 178 | 179 | - (void)configureSounds { 180 | 181 | // Configure bloom sound 182 | // 183 | NSURL *bloomSoundURL = [NSURL fileURLWithPath:self.bloomSoundPath]; 184 | 185 | // Configure fold sound 186 | // 187 | NSURL *foldSoundURL = [NSURL fileURLWithPath:self.foldSoundPath]; 188 | 189 | // Configure selected sound 190 | // 191 | NSURL *selectedSoundURL = [NSURL fileURLWithPath:self.itemSoundPath]; 192 | 193 | if (self.allowSounds) { 194 | AudioServicesCreateSystemSoundID((__bridge CFURLRef)bloomSoundURL, &_bloomSound); 195 | AudioServicesCreateSystemSoundID((__bridge CFURLRef)foldSoundURL, &_foldSound); 196 | AudioServicesCreateSystemSoundID((__bridge CFURLRef)selectedSoundURL, &_selectedSound); 197 | } 198 | else { 199 | AudioServicesDisposeSystemSoundID(_bloomSound); 200 | AudioServicesDisposeSystemSoundID(_foldSound); 201 | AudioServicesDisposeSystemSoundID(_selectedSound); 202 | } 203 | } 204 | 205 | #pragma mark - Configure Center Button Images 206 | 207 | - (void)setCenterImage:(UIImage *)centerImage { 208 | 209 | if (!centerImage) { 210 | NSLog(@"Load center image failed ... "); 211 | return ; 212 | } 213 | _centerImage = centerImage; 214 | } 215 | 216 | - (void)setCenterHighlightedImage:(UIImage *)highlightedImage { 217 | 218 | if (!highlightedImage) { 219 | NSLog(@"Load highted image failed ... "); 220 | return ; 221 | } 222 | _centerHighlightedImage = highlightedImage; 223 | } 224 | 225 | #pragma mark - Configure Button's Center 226 | 227 | - (void)setDcButtonCenter:(CGPoint)dcButtonCenter { 228 | 229 | _dcButtonCenter = dcButtonCenter; 230 | 231 | // reset the DCPathButton's center 232 | // 233 | self.center = dcButtonCenter; 234 | } 235 | 236 | #pragma mark - Configure Expand Center Point 237 | 238 | - (void)setPathCenterButtonBloomCenter:(CGPoint)centerButtonBloomCenter { 239 | 240 | // Just set the bloom center once 241 | // 242 | if (_pathCenterButtonBloomCenter.x == 0) { 243 | _pathCenterButtonBloomCenter = centerButtonBloomCenter; 244 | } 245 | return ; 246 | } 247 | 248 | - (void)setAllowSounds:(BOOL)soundsEnable { 249 | _allowSounds = soundsEnable; 250 | 251 | [self configureSounds]; 252 | } 253 | 254 | #pragma mark - Expand Status 255 | 256 | - (BOOL)isBloom { 257 | return _bloom; 258 | } 259 | 260 | #pragma mark - Center Button Delegate 261 | 262 | - (void)centerButtonTapped { 263 | self.isBloom? [self pathCenterButtonFold] : [self pathCenterButtonBloom]; 264 | } 265 | 266 | #pragma mark - Caculate The Item's End Point 267 | 268 | - (CGPoint)createEndPointWithRadius:(CGFloat)itemExpandRadius 269 | andAngel:(CGFloat)angel { 270 | switch (self.bloomDirection) { 271 | 272 | case kDCPathButtonBloomDirectionTop: 273 | 274 | return CGPointMake(self.pathCenterButtonBloomCenter.x + cosf((angel + 1) * M_PI) * itemExpandRadius, 275 | self.pathCenterButtonBloomCenter.y + sinf((angel + 1) * M_PI) * itemExpandRadius); 276 | case kDCPathButtonBloomDirectionBottomLeft: 277 | 278 | return CGPointMake(self.pathCenterButtonBloomCenter.x + cosf((angel + 0.25) * M_PI) * itemExpandRadius, 279 | self.pathCenterButtonBloomCenter.y + sinf((angel + 0.25) * M_PI) * itemExpandRadius); 280 | 281 | case kDCPathButtonBloomDirectionLeft: 282 | 283 | return CGPointMake(self.pathCenterButtonBloomCenter.x + cosf((angel + 0.5) * M_PI) * itemExpandRadius, 284 | self.pathCenterButtonBloomCenter.y + sinf((angel + 0.5) * M_PI) * itemExpandRadius); 285 | 286 | case kDCPathButtonBloomDirectionTopLeft: 287 | 288 | return CGPointMake(self.pathCenterButtonBloomCenter.x + cosf((angel + 0.75) * M_PI) * itemExpandRadius, 289 | self.pathCenterButtonBloomCenter.y + sinf((angel + 0.75) * M_PI) * itemExpandRadius); 290 | 291 | case kDCPathButtonBloomDirectionBottom: 292 | 293 | return CGPointMake(self.pathCenterButtonBloomCenter.x + cosf(angel * M_PI) * itemExpandRadius, 294 | self.pathCenterButtonBloomCenter.y + sinf(angel * M_PI) * itemExpandRadius); 295 | 296 | case kDCPathButtonBloomDirectionBottomRight: 297 | 298 | return CGPointMake(self.pathCenterButtonBloomCenter.x + cosf((angel + 1.75) * M_PI) * itemExpandRadius, 299 | self.pathCenterButtonBloomCenter.y + sinf((angel + 1.75) * M_PI) * itemExpandRadius); 300 | 301 | case kDCPathButtonBloomDirectionRight: 302 | 303 | return CGPointMake(self.pathCenterButtonBloomCenter.x + cosf((angel + 1.5) * M_PI) * itemExpandRadius, 304 | self.pathCenterButtonBloomCenter.y + sinf((angel + 1.5) * M_PI) * itemExpandRadius); 305 | 306 | case kDCPathButtonBloomDirectionTopRight: 307 | 308 | return CGPointMake(self.pathCenterButtonBloomCenter.x + cosf((angel + 1.25) * M_PI) * itemExpandRadius, 309 | self.pathCenterButtonBloomCenter.y + sinf((angel + 1.25) * M_PI) * itemExpandRadius); 310 | 311 | default: 312 | 313 | NSAssert(self.bloomDirection, @"DCPathButtonError: An error occur when you configuring the bloom direction"); 314 | return CGPointZero; 315 | 316 | } 317 | } 318 | 319 | 320 | #pragma mark - Center Button Fold 321 | 322 | - (void)pathCenterButtonFold { 323 | 324 | // DCPathButton Delegate 325 | // 326 | if ([_delegate respondsToSelector:@selector(willDismissDCPathButtonItems:)]) { 327 | [_delegate willDismissDCPathButtonItems:self]; 328 | } 329 | 330 | // Play fold sound 331 | // 332 | if (self.allowSounds) { 333 | AudioServicesPlaySystemSound(self.foldSound); 334 | } 335 | 336 | CGFloat itemGapAngel = self.bloomAngel / (self.itemButtons.count - 1) ; 337 | CGFloat currentAngel = (180.0f - self. bloomAngel)/2.0f; 338 | 339 | // Load item buttons from array 340 | // 341 | for (int i = 0; i < self.itemButtons.count; i++) { 342 | 343 | DCPathItemButton *itemButton = self.itemButtons[i]; 344 | 345 | CGPoint farPoint = [self createEndPointWithRadius:self.bloomRadius + 5.0f andAngel:currentAngel/180.0f]; 346 | 347 | CAAnimationGroup *foldAnimation = [self foldAnimationFromPoint:itemButton.center withFarPoint:farPoint]; 348 | 349 | [itemButton.layer addAnimation:foldAnimation forKey:@"foldAnimation"]; 350 | itemButton.center = self.pathCenterButtonBloomCenter; 351 | 352 | currentAngel += itemGapAngel; 353 | 354 | } 355 | 356 | [self bringSubviewToFront:self.pathCenterButton]; 357 | 358 | // Resize the DCPathButton's frame to the foled frame and remove the item buttons 359 | // 360 | [self resizeToFoldedFrame]; 361 | 362 | // DCPathButton Delegate 363 | // 364 | if ([_delegate respondsToSelector:@selector(didDismissDCPathButtonItems:)]) { 365 | [_delegate didDismissDCPathButtonItems:self]; 366 | } 367 | 368 | } 369 | 370 | - (void)resizeToFoldedFrame { 371 | if (self.allowCenterButtonRotation) { 372 | [UIView animateWithDuration:0.0618f * 3 373 | delay:0.0618f * 2 374 | options:UIViewAnimationOptionCurveEaseIn 375 | animations:^{ 376 | _pathCenterButton.transform = CGAffineTransformMakeRotation(0); 377 | } 378 | completion:nil]; 379 | } 380 | 381 | [UIView animateWithDuration:0.1f 382 | delay:0.35f 383 | options:UIViewAnimationOptionCurveLinear 384 | animations:^{ 385 | _bottomView.alpha = 0.0f; 386 | } 387 | completion:nil]; 388 | 389 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 390 | 391 | // Remove the button items from the superview 392 | // 393 | [self.itemButtons makeObjectsPerformSelector:@selector(removeFromSuperview)]; 394 | 395 | self.frame = CGRectMake(0, 0, self.foldedSize.width, self.foldedSize.height); 396 | self.center = _dcButtonCenter; 397 | 398 | self.pathCenterButton.center = CGPointMake(self.frame.size.width/2, self.frame.size.height/2); 399 | 400 | [self.bottomView removeFromSuperview]; 401 | }); 402 | 403 | _bloom = NO; 404 | } 405 | 406 | - (CAAnimationGroup *)foldAnimationFromPoint:(CGPoint)endPoint 407 | withFarPoint:(CGPoint)farPoint { 408 | // 1.Configure rotation animation 409 | // 410 | CAKeyframeAnimation *rotationAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 411 | rotationAnimation.values = @[@(0), @(M_PI), @(M_PI * 2)]; 412 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 413 | rotationAnimation.duration = 0.35f; 414 | 415 | // 2.Configure moving animation 416 | // 417 | CAKeyframeAnimation *movingAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 418 | 419 | // Create moving path 420 | // 421 | CGMutablePathRef path = CGPathCreateMutable(); 422 | CGPathMoveToPoint(path, NULL, endPoint.x, endPoint.y); 423 | CGPathAddLineToPoint(path, NULL, farPoint.x, farPoint.y); 424 | CGPathAddLineToPoint(path, NULL, self.pathCenterButtonBloomCenter.x, self.pathCenterButtonBloomCenter.y); 425 | 426 | movingAnimation.keyTimes = @[@(0.0f), @(0.75), @(1.0)]; 427 | 428 | movingAnimation.path = path; 429 | movingAnimation.duration = 0.35f; 430 | CGPathRelease(path); 431 | 432 | // 3.Merge animation together 433 | // 434 | CAAnimationGroup *animations = [CAAnimationGroup animation]; 435 | animations.animations = @[rotationAnimation, movingAnimation]; 436 | animations.duration = 0.35f; 437 | 438 | return animations; 439 | } 440 | 441 | #pragma mark - Center Button Bloom 442 | 443 | - (void)setBloomDirection:(kDCPathButtonBloomDirection)bloomDirection { 444 | 445 | _bloomDirection = bloomDirection; 446 | 447 | if (bloomDirection == kDCPathButtonBloomDirectionBottomLeft | 448 | bloomDirection == kDCPathButtonBloomDirectionBottomRight | 449 | bloomDirection == kDCPathButtonBloomDirectionTopLeft | 450 | bloomDirection == kDCPathButtonBloomDirectionTopRight) { 451 | 452 | _bloomAngel = 90.0f; 453 | 454 | } 455 | 456 | } 457 | 458 | - (void)pathCenterButtonBloom { 459 | 460 | // DCPathButton Delegate 461 | // 462 | if ([_delegate respondsToSelector:@selector(willPresentDCPathButtonItems:)]) { 463 | [_delegate willPresentDCPathButtonItems:self]; 464 | } 465 | 466 | // Play bloom sound 467 | // 468 | if (self.allowSounds) { 469 | AudioServicesPlaySystemSound(self.bloomSound); 470 | } 471 | 472 | // Configure center button bloom 473 | // 474 | // 1. Store the current center point to centerButtonBloomCenter 475 | // 476 | self.pathCenterButtonBloomCenter = self.center; 477 | 478 | // 2. Resize the DCPathButton's frame 479 | // 480 | self.frame = CGRectMake(0, 0, self.bloomSize.width, self.bloomSize.height); 481 | self.center = CGPointMake(self.bloomSize.width / 2, self.bloomSize.height / 2); 482 | 483 | [self insertSubview:self.bottomView belowSubview:self.pathCenterButton]; 484 | 485 | // 3. Excute the bottom view alpha animation 486 | // 487 | [UIView animateWithDuration:0.0618f * 3 488 | delay:0.0f 489 | options:UIViewAnimationOptionCurveEaseIn 490 | animations:^{ 491 | _bottomView.alpha = 0.618f; 492 | } 493 | completion:nil]; 494 | 495 | // 4. Excute the center button rotation animation 496 | // 497 | if (self.allowCenterButtonRotation) { 498 | [UIView animateWithDuration:0.1575f 499 | animations:^{ 500 | _pathCenterButton.transform = CGAffineTransformMakeRotation(-0.75f * M_PI); 501 | }]; 502 | } 503 | 504 | self.pathCenterButton.center = self.pathCenterButtonBloomCenter; 505 | 506 | // 5. Excute the bloom animation 507 | // 508 | CGFloat itemGapAngel = self.bloomAngel / (self.itemButtons.count - 1) ; 509 | CGFloat currentAngel = (180.0f - self. bloomAngel)/2.0f; 510 | 511 | for (int i = 0; i < self.itemButtons.count; i++) { 512 | 513 | DCPathItemButton *pathItemButton = self.itemButtons[i]; 514 | 515 | pathItemButton.delegate = self; 516 | pathItemButton.index = i; 517 | pathItemButton.transform = CGAffineTransformMakeTranslation(1, 1); 518 | pathItemButton.alpha = 1.0f; 519 | 520 | // 1. Add pathItem button to the view 521 | // 522 | 523 | pathItemButton.center = self.pathCenterButtonBloomCenter; 524 | 525 | [self insertSubview:pathItemButton belowSubview:self.pathCenterButton]; 526 | 527 | // 2.Excute expand animation 528 | // 529 | CGPoint endPoint = [self createEndPointWithRadius:self.bloomRadius andAngel:currentAngel/180.0f]; 530 | CGPoint farPoint = [self createEndPointWithRadius:self.bloomRadius + 10.0f andAngel:currentAngel/180.0f]; 531 | CGPoint nearPoint = [self createEndPointWithRadius:self.bloomRadius - 5.0f andAngel:currentAngel/180.0f]; 532 | 533 | CAAnimationGroup *bloomAnimation = [self bloomAnimationWithEndPoint:endPoint 534 | andFarPoint:farPoint 535 | andNearPoint:nearPoint]; 536 | 537 | [pathItemButton.layer addAnimation:bloomAnimation 538 | forKey:@"bloomAnimation"]; 539 | 540 | pathItemButton.center = endPoint; 541 | 542 | currentAngel += itemGapAngel; 543 | 544 | } 545 | 546 | // Configure the bloom status 547 | // 548 | _bloom = YES; 549 | 550 | // DCPathButton Delegate 551 | // 552 | if ([_delegate respondsToSelector:@selector(didPresentDCPathButtonItems:)]) { 553 | [_delegate didPresentDCPathButtonItems:self]; 554 | } 555 | 556 | } 557 | 558 | - (CAAnimationGroup *)bloomAnimationWithEndPoint:(CGPoint)endPoint 559 | andFarPoint:(CGPoint)farPoint 560 | andNearPoint:(CGPoint)nearPoint { 561 | 562 | // 1.Configure rotation animation 563 | // 564 | CAKeyframeAnimation *rotationAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 565 | rotationAnimation.values = @[@(0.0), @(- M_PI), @(- M_PI * 1.5), @(- M_PI * 2)]; 566 | rotationAnimation.duration = 0.3f; 567 | rotationAnimation.keyTimes = @[@(0.0), @(0.3), @(0.6), @(1.0)]; 568 | 569 | // 2.Configure moving animation 570 | // 571 | CAKeyframeAnimation *movingAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 572 | 573 | // Create moving path 574 | // 575 | CGMutablePathRef path = CGPathCreateMutable(); 576 | CGPathMoveToPoint(path, NULL, self.pathCenterButtonBloomCenter.x, self.pathCenterButtonBloomCenter.y); 577 | CGPathAddLineToPoint(path, NULL, farPoint.x, farPoint.y); 578 | CGPathAddLineToPoint(path, NULL, nearPoint.x, nearPoint.y); 579 | CGPathAddLineToPoint(path, NULL, endPoint.x, endPoint.y); 580 | 581 | movingAnimation.path = path; 582 | movingAnimation.keyTimes = @[@(0.0), @(0.5), @(0.7), @(1.0)]; 583 | movingAnimation.duration = 0.3f; 584 | CGPathRelease(path); 585 | 586 | // 3.Merge two animation together 587 | // 588 | CAAnimationGroup *animations = [CAAnimationGroup animation]; 589 | animations.animations = @[movingAnimation, rotationAnimation]; 590 | animations.duration = 0.3f; 591 | animations.delegate = self; 592 | 593 | return animations; 594 | } 595 | 596 | #pragma mark - Add PathButton Item 597 | 598 | - (void)addPathItems:(NSArray *)pathItemButtons { 599 | [self.itemButtons addObjectsFromArray:pathItemButtons]; 600 | } 601 | 602 | #pragma mark - DCPathButton Touch Events 603 | 604 | - (void)touchesBegan:(NSSet *)touches 605 | withEvent:(UIEvent *)event { 606 | 607 | // Tap the bottom area, excute the fold animation 608 | [self pathCenterButtonFold]; 609 | } 610 | 611 | #pragma mark - DCPathButton Item Delegate 612 | 613 | - (void)itemButtonTapped:(DCPathItemButton *)itemButton { 614 | 615 | if ([_delegate respondsToSelector:@selector(pathButton:clickItemButtonAtIndex:)]) { 616 | 617 | DCPathItemButton *selectedButton = self.itemButtons[itemButton.index]; 618 | 619 | // Play selected sound 620 | // 621 | if (self.allowSounds) { 622 | AudioServicesPlaySystemSound(self.selectedSound); 623 | } 624 | 625 | // Excute the explode animation when the item is seleted 626 | // 627 | [UIView animateWithDuration:0.0618f * 5 628 | animations:^{ 629 | selectedButton.transform = CGAffineTransformMakeScale(3, 3); 630 | selectedButton.alpha = 0.0f; 631 | }]; 632 | 633 | // Excute the dismiss animation when the item is unselected 634 | // 635 | for (int i = 0; i < self.itemButtons.count; i++) { 636 | if (i == selectedButton.index) { 637 | continue; 638 | } 639 | DCPathItemButton *unselectedButton = self.itemButtons[i]; 640 | [UIView animateWithDuration:0.0618f * 2 641 | animations:^{ 642 | unselectedButton.transform = CGAffineTransformMakeScale(0, 0); 643 | }]; 644 | } 645 | 646 | // Excute the delegate method 647 | // 648 | [_delegate pathButton:self clickItemButtonAtIndex:itemButton.index]; 649 | 650 | // Resize the DCPathButton's frame 651 | // 652 | [self resizeToFoldedFrame]; 653 | } 654 | } 655 | 656 | #pragma mark - UIGestureRecognizer Delegate 657 | 658 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 659 | 660 | return YES; 661 | } 662 | 663 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer NS_AVAILABLE_IOS(7_0) { 664 | return YES; 665 | } 666 | 667 | @end 668 | --------------------------------------------------------------------------------