Skip to content

Commit

Permalink
Swift 2.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Cee committed Oct 8, 2016
1 parent c1ed891 commit 8bec4e8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion PFStepper.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PFStepper"
s.version = "0.0.1"
s.version = "1.0.0"
s.summary = "It may be the most elegant stepper you have ever had!"
s.homepage = "https://github.com/PerfectFreeze/PFStepper"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
18 changes: 9 additions & 9 deletions PFStepperDemo/Class/PFStepper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public class PFStepper: UIControl {
// button.contentHorizontalAlignment = .Left
// button.contentVerticalAlignment = .Top
// button.titleEdgeInsets = UIEdgeInsetsMake(10.0, 10.0, 0.0, 0.0)
button.addTarget(self, action: "topButtonTouchDown:", forControlEvents: .TouchDown)
button.addTarget(self, action: "buttonTouchUp:", forControlEvents: UIControlEvents.TouchUpInside)
button.addTarget(self, action: "buttonTouchUp:", forControlEvents: UIControlEvents.TouchUpOutside)
button.addTarget(self, action: #selector(PFStepper.topButtonTouchDown(_:)), forControlEvents: .TouchDown)
button.addTarget(self, action: #selector(PFStepper.buttonTouchUp(_:)), forControlEvents: UIControlEvents.TouchUpInside)
button.addTarget(self, action: #selector(PFStepper.buttonTouchUp(_:)), forControlEvents: UIControlEvents.TouchUpOutside)
return button
}()
lazy var bottomButton: UIButton = {
Expand All @@ -69,9 +69,9 @@ public class PFStepper: UIControl {
button.setTitleColor(self.buttonsTextColor, forState: .Normal)
button.backgroundColor = self.buttonsBackgroundColor
button.titleLabel?.font = self.buttonsFont
button.addTarget(self, action: "bottomButtonTouchDown:", forControlEvents: .TouchDown)
button.addTarget(self, action: "buttonTouchUp:", forControlEvents: UIControlEvents.TouchUpInside)
button.addTarget(self, action: "buttonTouchUp:", forControlEvents: UIControlEvents.TouchUpOutside)
button.addTarget(self, action: #selector(PFStepper.bottomButtonTouchDown(_:)), forControlEvents: .TouchDown)
button.addTarget(self, action: #selector(PFStepper.buttonTouchUp(_:)), forControlEvents: UIControlEvents.TouchUpInside)
button.addTarget(self, action: #selector(PFStepper.buttonTouchUp(_:)), forControlEvents: UIControlEvents.TouchUpOutside)
return button
}()

Expand Down Expand Up @@ -128,7 +128,7 @@ public class PFStepper: UIControl {
addSubview(bottomButton)

backgroundColor = buttonsBackgroundColor
NSNotificationCenter.defaultCenter().addObserver(self, selector: "reset", name: UIApplicationWillResignActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(PFStepper.reset), name: UIApplicationWillResignActiveNotification, object: nil)
}

public override func layoutSubviews() {
Expand Down Expand Up @@ -201,7 +201,7 @@ extension PFStepper {
}

func scheduleTimer() {
timer = NSTimer.scheduledTimerWithTimeInterval(timerInterval, target: self, selector: "handleTimerFire:", userInfo: nil, repeats: true)
timer = NSTimer.scheduledTimerWithTimeInterval(timerInterval, target: self, selector: #selector(PFStepper.handleTimerFire(_:)), userInfo: nil, repeats: true)
}

func resetTimer() {
Expand All @@ -211,4 +211,4 @@ extension PFStepper {
timerFireCount = 0
}
}
}
}
9 changes: 9 additions & 0 deletions PFStepperDemo/PFStepperDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,16 @@
TargetAttributes = {
92165C8E1C2A67A500274852 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
};
92165CA21C2A67A500274852 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
TestTargetID = 92165C8E1C2A67A500274852;
};
92165CAD1C2A67A500274852 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
TestTargetID = 92165C8E1C2A67A500274852;
};
};
Expand Down Expand Up @@ -413,6 +416,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.Cee.PFStepperDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -424,6 +428,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.Cee.PFStepperDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand All @@ -435,6 +440,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.Cee.PFStepperDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PFStepperDemo.app/PFStepperDemo";
};
name = Debug;
Expand All @@ -447,6 +453,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.Cee.PFStepperDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PFStepperDemo.app/PFStepperDemo";
};
name = Release;
Expand All @@ -458,6 +465,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.Cee.PFStepperDemoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_TARGET_NAME = PFStepperDemo;
USES_XCTRUNNER = YES;
};
Expand All @@ -470,6 +478,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.Cee.PFStepperDemoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_TARGET_NAME = PFStepperDemo;
USES_XCTRUNNER = YES;
};
Expand Down

0 comments on commit 8bec4e8

Please sign in to comment.