Tôi đang cố gắng để animate giới hạn của một UIButton sử dụng POPSpringAnimation pop Facebook, nhưng tôi không thể tìm thấy những gì tôi nên sử dụng trong nhanh chóng trong thay thế của NSValue.valueWithCGRectSwift NSValue.valueWithCGRect
Đây là những gì tôi m cố gắng để làm:
@IBAction func buttonTapped(sender : UIButton) {
var springAnimation = POPSpringAnimation()
springAnimation.property = POPAnimatableProperty.propertyWithName(kPOPLayerBounds) as POPAnimatableProperty
springAnimation.springBounciness = 12.0
springAnimation.springSpeed = 10.0
springAnimation.toValue = NSValue.valueWithCGRect(newBounds)
shutterButton.pop_addAnimation(springAnimation, forKey: "size")
}
đâu tài liệu này? Tôi không nhận được kết quả cho việc này với tự động hoàn tất hoặc – rounak
Cảm ơn, điều đó đã hiệu quả. –
@rounak: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html#//apple_ref/doc/uid/TP40014216-CH4-XID_27 – newacct