Skip to content

Commit dbd5f23

Browse files
committed
Upgrade to Swift 1.2.
1 parent 5129f96 commit dbd5f23

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

LTBouncyPlaceholder/UITextField+LTBouncyPlaceholder.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class LTBouncyTextField : UITextField {
6262
get {
6363
var _placeholderLabelObject: AnyObject? = objc_getAssociatedObject(self, &kPlaceholderLabelPointer)
6464
if let _placeholderLabel : AnyObject = _placeholderLabelObject {
65-
return _placeholderLabel as UILabel
65+
return _placeholderLabel as! UILabel
6666
}
6767
var _placeholderLabel = UILabel(frame: placeholderRectForBounds(bounds))
6868
_placeholderLabel.font = font
@@ -81,7 +81,7 @@ public class LTBouncyTextField : UITextField {
8181
get {
8282
var _rightPlaceholderLabelObject: AnyObject? = objc_getAssociatedObject(self, &kRightPlaceholderLabelPointer)
8383
if let _rightPlaceholderLabel: AnyObject = _rightPlaceholderLabelObject {
84-
return _rightPlaceholderLabel as UILabel
84+
return _rightPlaceholderLabel as! UILabel
8585
}
8686
var _rightPlaceholderLabel = UILabel(frame: placeholderRectForBounds(bounds))
8787
_rightPlaceholderLabel.font = font
@@ -193,7 +193,7 @@ public class LTBouncyTextField : UITextField {
193193
let bounceToRight = CAKeyframeAnimation(keyPath: "position.x")
194194
bounceToRight.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
195195
bounceToRight.duration = kAnimationDuration
196-
bounceToRight.values = _bounceKeyframes(toRight: true)
196+
bounceToRight.values = _bounceKeyframes(toRight: true) as [AnyObject]
197197
bounceToRight.fillMode = kCAFillModeForwards
198198
bounceToRight.additive = true
199199
bounceToRight.removedOnCompletion = false
@@ -225,7 +225,7 @@ public class LTBouncyTextField : UITextField {
225225
let bounceToLeft = CAKeyframeAnimation(keyPath: "position.x")
226226
bounceToLeft.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
227227
bounceToLeft.duration = kAnimationDuration
228-
bounceToLeft.values = _bounceKeyframes(toRight: false)
228+
bounceToLeft.values = _bounceKeyframes(toRight: false) as [AnyObject]
229229
bounceToLeft.fillMode = kCAFillModeForwards
230230
bounceToLeft.additive = true
231231
bounceToLeft.removedOnCompletion = false
@@ -256,7 +256,7 @@ public class LTBouncyTextField : UITextField {
256256
let bounceToRight = CAKeyframeAnimation(keyPath: "position.x")
257257
bounceToRight.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
258258
bounceToRight.duration = kAnimationDuration
259-
bounceToRight.values = _bounceKeyframes(toRight: true)
259+
bounceToRight.values = _bounceKeyframes(toRight: true) as [AnyObject]
260260
bounceToRight.fillMode = kCAFillModeForwards
261261
bounceToRight.additive = true
262262
bounceToRight.removedOnCompletion = false
@@ -265,7 +265,7 @@ public class LTBouncyTextField : UITextField {
265265
let bounceToLeft = CAKeyframeAnimation(keyPath: "position.x")
266266
bounceToLeft.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
267267
bounceToLeft.duration = kAnimationDuration
268-
bounceToLeft.values = _bounceKeyframes(toRight: false)
268+
bounceToLeft.values = _bounceKeyframes(toRight: false) as [AnyObject]
269269
bounceToLeft.fillMode = kCAFillModeForwards
270270
bounceToLeft.additive = true
271271
bounceToLeft.removedOnCompletion = false

LTBouncyPlaceholderDemo/AppDelegate.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
17-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
16+
17+
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
1818
self.window!.backgroundColor = UIColor.whiteColor()
1919
return true
2020
}
2121

22-
2322
}
2423

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
It's my first Swift extension demonstrates singleton/<del>swizzling</del>/association in Swift.
66

7-
Xcode 6.1.1 is required to compile this project.
7+
Xcode 6.3 is required to compile this project.
88

99
It also comes with a QuartzComposer file on my <a href="https://dribbble.com/shots/1571790-Bouncy-placeholder">Dribbble</a>.
1010

0 commit comments

Comments
 (0)