Skip to content

Commit

Permalink
#9 Swift 3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Oct 6, 2016
1 parent d197b11 commit b599bc2
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 113 deletions.
164 changes: 86 additions & 78 deletions Classes/TKRubberPageControl.swift

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

## Requirements

- Swift 3.0
- iOS 8.0+
- Xcode 7.3

Expand Down Expand Up @@ -99,6 +100,9 @@ class ViewController: UIViewController {

## Release History

* 1.3.0
Support Swift 3.0

* 1.0.5
Fix bug, add Cocoapod and Carthage support

Expand Down
6 changes: 6 additions & 0 deletions TKRubberIndicator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
TargetAttributes = {
6A555EC51BDE277B00FC36E6 = {
CreatedOnToolsVersion = 7.1;
DevelopmentTeam = 858CBVXSWP;
LastSwiftMigration = 0800;
};
6A9103F51D539B370009451B = {
CreatedOnToolsVersion = 7.3.1;
Expand Down Expand Up @@ -335,21 +337,25 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 858CBVXSWP;
INFOPLIST_FILE = TKRubberIndicator/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.TBXark.TKRubberIndicator;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
6A555EDA1BDE277B00FC36E6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 858CBVXSWP;
INFOPLIST_FILE = TKRubberIndicator/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.TBXark.TKRubberIndicator;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,4 @@
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "UIApplicationMain"
moduleName = "">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "expr (Class)NSClassFromString(@&quot;IBARevealLoader&quot;) == nil ? (void *)dlopen(&quot;/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib&quot;, 0x2) : ((void*)0)">
</ActionContent>
</BreakpointActionProxy>
</Actions>
<Locations>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
12 changes: 6 additions & 6 deletions TKRubberIndicator/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// 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.
// 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.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// 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.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// 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.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
2 changes: 1 addition & 1 deletion TKRubberIndicator/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.6</string>
<string>1.3.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
8 changes: 4 additions & 4 deletions TKRubberIndicator/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

class ViewController: UIViewController {

let page = TKRubberPageControl(frame: CGRectMake(100, 100, 200, 100), count: 3)
let page = TKRubberPageControl(frame: CGRect(x: 100, y: 100, width: 200, height: 100), count: 3)

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -21,17 +21,17 @@ class ViewController: UIViewController {
page.valueChange = {(num) -> Void in
print("Closure : Page is \(num)")
}
page.addTarget(self, action: #selector(ViewController.targetActionValueChange(_:)), forControlEvents: UIControlEvents.ValueChanged)
page.addTarget(self, action: #selector(ViewController.targetActionValueChange(_:)), for: UIControlEvents.valueChanged)
self.view.addSubview(page)


page.numberOfpage = 3
}

@IBAction func pageCountChange(sender: UISegmentedControl) {
@IBAction func pageCountChange(_ sender: UISegmentedControl) {
page.numberOfpage = sender.selectedSegmentIndex + 3
}
func targetActionValueChange(page:TKRubberPageControl){
func targetActionValueChange(_ page:TKRubberPageControl){
print("Target-Action : Page is \(page.currentIndex)")
}

Expand Down
2 changes: 1 addition & 1 deletion TKRubberPageControl.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "TKRubberPageControl"
s.version = "1.0.6"
s.version = "1.3.0"
s.summary = "A rubber pagec ontrol in Swift."
s.license = { :type => 'MIT License', :file => 'LICENSE' } # 协议
s.homepage = "https://github.com/TBXark/TKRubberIndicator"
Expand Down
2 changes: 1 addition & 1 deletion TKRubberPageControl/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.6</string>
<string>1.3.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit b599bc2

Please sign in to comment.