Skip to content

Commit c8334fa

Browse files
author
TBXark
committed
add carthage support
1 parent 0601a6c commit c8334fa

File tree

13 files changed

+322
-61
lines changed

13 files changed

+322
-61
lines changed

Example/exchange.gif

51.7 KB
Loading

Example/liquid.gif

72.1 KB
Loading

Example/simple.gif

118 KB
Loading

Example/simple2.gif

194 KB
Loading

Example/smile.gif

113 KB
Loading

README.md

Lines changed: 55 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,80 @@
11
# TKSwitcherCollection
2+
> A segment with dot animation
3+
4+
[![Swift Version][swift-image]][swift-url]
25
[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/TBXark/TKSwitcherCollection/master/LICENSE)
3-
[![CocoaPods](http://img.shields.io/cocoapods/v/TKSwitcherCollection.svg?style=flat)](http://cocoapods.org/?q= TKRubberPageControl)
4-
[![CocoaPods](http://img.shields.io/cocoapods/p/TKSwitcherCollection.svg?style=flat)](http://cocoapods.org/?q= TKRubberPageControl)
6+
[![CocoaPods](http://img.shields.io/cocoapods/v/TKSwitcherCollection.svg?style=flat)](http://cocoapods.org/?q= TKSwitcherCollection)
7+
[![CocoaPods](http://img.shields.io/cocoapods/p/TKSwitcherCollection.svg?style=flat)](http://cocoapods.org/?q= TKSwitcherCollection)
8+
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
59
[![Support](https://img.shields.io/badge/support-iOS%208%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)
610

7-
---
8-
9-
### 这是一个 动画Switch 的集合
10-
11-
![img](https://github.com/TBXark/TKSwitcherCollection/blob/master/SwitcherCollection/gif.gif)
12-
13-
---
14-
15-
### 在 dribbble 上面看到一系列不错的 Switch 于是就用最近学的 Swift 把它们实现了
16-
这个是dribbble 的链接 : [系列链接](https://dribbble.com/search?q=Switcher+Oleg+Frolov)
17-
18-
19-
#### TKSimpleSwitch 分别对应下面两个动画效果
20-
![img](https://d13yacurqjgara.cloudfront.net/users/108183/screenshots/1990516/switch.gif)
21-
[原文链接](https://dribbble.com/shots/1990516-Switcher)
22-
![img](https://d13yacurqjgara.cloudfront.net/users/108183/screenshots/2165675/switcher-v.gif)
23-
[原文链接](https://dribbble.com/shots/2165675-Switcher-V)
24-
25-
#### TKExchangeSwitch
26-
![img](https://d13yacurqjgara.cloudfront.net/users/108183/screenshots/2238916/switcher6.gif)
27-
[原文链接](https://dribbble.com/shots/2238916-Switcher-VI)
28-
29-
#### TKSmileSwitch
30-
![img](https://d13yacurqjgara.cloudfront.net/users/108183/screenshots/2011284/switcher-ll.gif)
31-
[原文链接](https://dribbble.com/shots/2011284-Switcher-ll)
32-
33-
#### TKLiquidSwitch
34-
![img](https://d13yacurqjgara.cloudfront.net/users/108183/screenshots/2028065/switcher-lll.gif)
35-
[原文链接](https://dribbble.com/shots/2028065-Switcher-lll)
36-
3711

38-
---
12+
![](demo.gif)
3913

40-
## 使用
41-
### 1. Cocoapod
42-
> pod 'TKSwitcherCollection', '~> 1.0.2'
14+
## Requirements
4315

44-
### 2. 直接引用
45-
将 SwitcherCollection/Classes 中所有文件拖进项目中即可
16+
- iOS 8.0+
17+
- Xcode 7.3
4618

19+
## Installation
4720

48-
---
49-
## 最后
21+
#### CocoaPods
22+
You can use [CocoaPods](http://cocoapods.org/) to install `TKSwitcherCollection` by adding it to your `Podfile`:
5023

51-
这个只是我这个 OCer 在学 Swift 的练手项目,写的时候只考虑实现效果,没有怎么的想封装和其他的.
52-
然后就是有点小心得: 以前在用 OC 的时候画贝塞尔曲线,改完参数完全不知道曲线的效果是什么,但是到了 Swift 之后就可以用 playground 实时修改 贝塞尔曲线,然后做出满意的曲线之后就可以放到工程里面用了.
24+
```ruby
25+
platform :ios, '8.0'
26+
use_frameworks!
27+
pod 'TKSwitcherCollection'
28+
```
5329

30+
To get the full benefits import `TKSwitcherCollection` wherever you import UIKit
5431

32+
``` swift
33+
import UIKit
34+
import TKSwitcherCollection
35+
```
36+
#### Carthage
37+
Create a `Cartfile` that lists the framework and run `carthage update`. Follow the [instructions](https://github.com/Carthage/Carthage#if-youre-building-for-ios) to add `$(SRCROOT)/Carthage/Build/iOS/TKSwitcherCollection.framework` to an iOS project.
5538

56-
## 协议
39+
```
40+
github "tbxark/TKSwitcherCollection"
41+
```
42+
#### Manually
43+
1. Download and drop ```SwitchCollection/Classes``` in your project.
44+
2. Congratulations!
5745

58-
The MIT License (MIT)
46+
## Usage example
5947

60-
Copyright (c) 2015 TBXark
48+
|Class|Example|
49+
|---|---|
50+
|TKSimpleSwitch|<img src="Example/simple.gif" style="height:200;width:auto">|
51+
|TKSimpleSwitch|<img src="Example/simple2.gif" style="height:200;width:auto">|
52+
|TKSmileSwitch|<img src="Example/smile.gif" style="height:200;width:auto">|
53+
|TKLiquidSwitch|<img src="Example/liquid.gif" style="height:200;width:auto">|
6154

62-
Permission is hereby granted, free of charge, to any person obtaining a copy
63-
of this software and associated documentation files (the "Software"), to deal
64-
in the Software without restriction, including without limitation the rights
65-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66-
copies of the Software, and to permit persons to whom the Software is
67-
furnished to do so, subject to the following conditions:
6855

69-
The above copyright notice and this permission notice shall be included in all
70-
copies or substantial portions of the Software.
56+
## Release History
7157

72-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
78-
SOFTWARE.
58+
* 1.0.3
59+
Complete basic functions, add Cocoapod and Carthage support
7960

61+
## Contribute
8062

63+
We would love for you to contribute to **TKSwitcherCollection**, check the ``LICENSE`` file for more info.
8164

65+
## Meta
8266

67+
TBXark – [@vfanx](https://twitter.com/vfanx)[email protected]
8368

69+
Distributed under the MIT license. See ``LICENSE`` for more information.
8470

71+
[https://github.com/TBXark](https://github.com/TBXark)
8572

73+
[swift-image]:https://img.shields.io/badge/swift-3.0-orange.svg
74+
[swift-url]: https://swift.org/
75+
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
76+
[license-url]: LICENSE
77+
[travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-square
78+
[travis-url]: https://travis-ci.org/dbader/node-datadog-metrics
79+
[codebeat-image]: https://codebeat.co/badges/c19b47ea-2f9d-45df-8458-b2d952fe9dad
80+
[codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com

SwitcherCollection.xcodeproj/project.pbxproj

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
6A555EA21BDCA58700FC36E6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A555EA11BDCA58700FC36E6 /* Assets.xcassets */; };
1919
6A555EA51BDCA58700FC36E6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6A555EA31BDCA58700FC36E6 /* LaunchScreen.storyboard */; };
2020
6A555EBC1BDE1DF800FC36E6 /* gif.gif in Resources */ = {isa = PBXBuildFile; fileRef = 6A555EBB1BDE1DF800FC36E6 /* gif.gif */; };
21+
6A9104151D53A8740009451B /* TKSwitcherCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A9104141D53A8740009451B /* TKSwitcherCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
22+
6A91041A1D53A8900009451B /* TKExchangeSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A3D16EE1BE99A020018C0C4 /* TKExchangeSwitch.swift */; };
23+
6A91041B1D53A8900009451B /* TKLiquidSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A3D16EF1BE99A020018C0C4 /* TKLiquidSwitch.swift */; };
24+
6A91041C1D53A8900009451B /* TKBaseSwitcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A3D16F01BE99A020018C0C4 /* TKBaseSwitcher.swift */; };
25+
6A91041D1D53A8900009451B /* TKSimpleSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A3D16F11BE99A020018C0C4 /* TKSimpleSwitch.swift */; };
26+
6A91041E1D53A8900009451B /* TKSmileSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A3D16F21BE99A020018C0C4 /* TKSmileSwitch.swift */; };
2127
/* End PBXBuildFile section */
2228

2329
/* Begin PBXFileReference section */
@@ -34,6 +40,9 @@
3440
6A555EA41BDCA58700FC36E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
3541
6A555EA61BDCA58700FC36E6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3642
6A555EBB1BDE1DF800FC36E6 /* gif.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = gif.gif; sourceTree = "<group>"; };
43+
6A9104121D53A8740009451B /* TKSwitcherCollection.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TKSwitcherCollection.framework; sourceTree = BUILT_PRODUCTS_DIR; };
44+
6A9104141D53A8740009451B /* TKSwitcherCollection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TKSwitcherCollection.h; sourceTree = "<group>"; };
45+
6A9104161D53A8740009451B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3746
/* End PBXFileReference section */
3847

3948
/* Begin PBXFrameworksBuildPhase section */
@@ -44,6 +53,13 @@
4453
);
4554
runOnlyForDeploymentPostprocessing = 0;
4655
};
56+
6A91040E1D53A8740009451B /* Frameworks */ = {
57+
isa = PBXFrameworksBuildPhase;
58+
buildActionMask = 2147483647;
59+
files = (
60+
);
61+
runOnlyForDeploymentPostprocessing = 0;
62+
};
4763
/* End PBXFrameworksBuildPhase section */
4864

4965
/* Begin PBXGroup section */
@@ -63,6 +79,7 @@
6379
isa = PBXGroup;
6480
children = (
6581
6A555E991BDCA58700FC36E6 /* SwitcherCollection */,
82+
6A9104131D53A8740009451B /* TKSwitcherCollection */,
6683
6A555E981BDCA58700FC36E6 /* Products */,
6784
);
6885
sourceTree = "<group>";
@@ -71,6 +88,7 @@
7188
isa = PBXGroup;
7289
children = (
7390
6A555E971BDCA58700FC36E6 /* SwitcherCollection.app */,
91+
6A9104121D53A8740009451B /* TKSwitcherCollection.framework */,
7492
);
7593
name = Products;
7694
sourceTree = "<group>";
@@ -90,8 +108,28 @@
90108
path = SwitcherCollection;
91109
sourceTree = "<group>";
92110
};
111+
6A9104131D53A8740009451B /* TKSwitcherCollection */ = {
112+
isa = PBXGroup;
113+
children = (
114+
6A9104141D53A8740009451B /* TKSwitcherCollection.h */,
115+
6A9104161D53A8740009451B /* Info.plist */,
116+
);
117+
path = TKSwitcherCollection;
118+
sourceTree = "<group>";
119+
};
93120
/* End PBXGroup section */
94121

122+
/* Begin PBXHeadersBuildPhase section */
123+
6A91040F1D53A8740009451B /* Headers */ = {
124+
isa = PBXHeadersBuildPhase;
125+
buildActionMask = 2147483647;
126+
files = (
127+
6A9104151D53A8740009451B /* TKSwitcherCollection.h in Headers */,
128+
);
129+
runOnlyForDeploymentPostprocessing = 0;
130+
};
131+
/* End PBXHeadersBuildPhase section */
132+
95133
/* Begin PBXNativeTarget section */
96134
6A555E961BDCA58700FC36E6 /* SwitcherCollection */ = {
97135
isa = PBXNativeTarget;
@@ -110,6 +148,24 @@
110148
productReference = 6A555E971BDCA58700FC36E6 /* SwitcherCollection.app */;
111149
productType = "com.apple.product-type.application";
112150
};
151+
6A9104111D53A8740009451B /* TKSwitcherCollection */ = {
152+
isa = PBXNativeTarget;
153+
buildConfigurationList = 6A9104191D53A8740009451B /* Build configuration list for PBXNativeTarget "TKSwitcherCollection" */;
154+
buildPhases = (
155+
6A91040D1D53A8740009451B /* Sources */,
156+
6A91040E1D53A8740009451B /* Frameworks */,
157+
6A91040F1D53A8740009451B /* Headers */,
158+
6A9104101D53A8740009451B /* Resources */,
159+
);
160+
buildRules = (
161+
);
162+
dependencies = (
163+
);
164+
name = TKSwitcherCollection;
165+
productName = TKSwitcherCollection;
166+
productReference = 6A9104121D53A8740009451B /* TKSwitcherCollection.framework */;
167+
productType = "com.apple.product-type.framework";
168+
};
113169
/* End PBXNativeTarget section */
114170

115171
/* Begin PBXProject section */
@@ -124,6 +180,9 @@
124180
6A555E961BDCA58700FC36E6 = {
125181
CreatedOnToolsVersion = 7.1;
126182
};
183+
6A9104111D53A8740009451B = {
184+
CreatedOnToolsVersion = 7.3.1;
185+
};
127186
};
128187
};
129188
buildConfigurationList = 6A555E921BDCA58700FC36E6 /* Build configuration list for PBXProject "SwitcherCollection" */;
@@ -140,6 +199,7 @@
140199
projectRoot = "";
141200
targets = (
142201
6A555E961BDCA58700FC36E6 /* SwitcherCollection */,
202+
6A9104111D53A8740009451B /* TKSwitcherCollection */,
143203
);
144204
};
145205
/* End PBXProject section */
@@ -156,6 +216,13 @@
156216
);
157217
runOnlyForDeploymentPostprocessing = 0;
158218
};
219+
6A9104101D53A8740009451B /* Resources */ = {
220+
isa = PBXResourcesBuildPhase;
221+
buildActionMask = 2147483647;
222+
files = (
223+
);
224+
runOnlyForDeploymentPostprocessing = 0;
225+
};
159226
/* End PBXResourcesBuildPhase section */
160227

161228
/* Begin PBXSourcesBuildPhase section */
@@ -173,6 +240,18 @@
173240
);
174241
runOnlyForDeploymentPostprocessing = 0;
175242
};
243+
6A91040D1D53A8740009451B /* Sources */ = {
244+
isa = PBXSourcesBuildPhase;
245+
buildActionMask = 2147483647;
246+
files = (
247+
6A91041A1D53A8900009451B /* TKExchangeSwitch.swift in Sources */,
248+
6A91041B1D53A8900009451B /* TKLiquidSwitch.swift in Sources */,
249+
6A91041C1D53A8900009451B /* TKBaseSwitcher.swift in Sources */,
250+
6A91041D1D53A8900009451B /* TKSimpleSwitch.swift in Sources */,
251+
6A91041E1D53A8900009451B /* TKSmileSwitch.swift in Sources */,
252+
);
253+
runOnlyForDeploymentPostprocessing = 0;
254+
};
176255
/* End PBXSourcesBuildPhase section */
177256

178257
/* Begin PBXVariantGroup section */
@@ -298,6 +377,50 @@
298377
};
299378
name = Release;
300379
};
380+
6A9104171D53A8740009451B /* Debug */ = {
381+
isa = XCBuildConfiguration;
382+
buildSettings = {
383+
CLANG_ANALYZER_NONNULL = YES;
384+
CURRENT_PROJECT_VERSION = 1;
385+
DEFINES_MODULE = YES;
386+
DYLIB_COMPATIBILITY_VERSION = 1;
387+
DYLIB_CURRENT_VERSION = 1;
388+
DYLIB_INSTALL_NAME_BASE = "@rpath";
389+
INFOPLIST_FILE = TKSwitcherCollection/Info.plist;
390+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
391+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
392+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
393+
PRODUCT_BUNDLE_IDENTIFIER = TBXark.TKSwitcherCollection;
394+
PRODUCT_NAME = "$(TARGET_NAME)";
395+
SKIP_INSTALL = YES;
396+
TARGETED_DEVICE_FAMILY = "1,2";
397+
VERSIONING_SYSTEM = "apple-generic";
398+
VERSION_INFO_PREFIX = "";
399+
};
400+
name = Debug;
401+
};
402+
6A9104181D53A8740009451B /* Release */ = {
403+
isa = XCBuildConfiguration;
404+
buildSettings = {
405+
CLANG_ANALYZER_NONNULL = YES;
406+
CURRENT_PROJECT_VERSION = 1;
407+
DEFINES_MODULE = YES;
408+
DYLIB_COMPATIBILITY_VERSION = 1;
409+
DYLIB_CURRENT_VERSION = 1;
410+
DYLIB_INSTALL_NAME_BASE = "@rpath";
411+
INFOPLIST_FILE = TKSwitcherCollection/Info.plist;
412+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
413+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
414+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
415+
PRODUCT_BUNDLE_IDENTIFIER = TBXark.TKSwitcherCollection;
416+
PRODUCT_NAME = "$(TARGET_NAME)";
417+
SKIP_INSTALL = YES;
418+
TARGETED_DEVICE_FAMILY = "1,2";
419+
VERSIONING_SYSTEM = "apple-generic";
420+
VERSION_INFO_PREFIX = "";
421+
};
422+
name = Release;
423+
};
301424
/* End XCBuildConfiguration section */
302425

303426
/* Begin XCConfigurationList section */
@@ -319,6 +442,14 @@
319442
defaultConfigurationIsVisible = 0;
320443
defaultConfigurationName = Release;
321444
};
445+
6A9104191D53A8740009451B /* Build configuration list for PBXNativeTarget "TKSwitcherCollection" */ = {
446+
isa = XCConfigurationList;
447+
buildConfigurations = (
448+
6A9104171D53A8740009451B /* Debug */,
449+
6A9104181D53A8740009451B /* Release */,
450+
);
451+
defaultConfigurationIsVisible = 0;
452+
};
322453
/* End XCConfigurationList section */
323454
};
324455
rootObject = 6A555E8F1BDCA58700FC36E6 /* Project object */;
1.93 KB
Binary file not shown.

0 commit comments

Comments
 (0)