Is it possible to use Swift extensions in Obj-C?
I'm extending the UIView
class with some fade animation like this:
import Foundation
import UIKit
extension UIView {
func fadeOut(duration: NSTimeInterval) {
UIView.animateWithDuration(duration, delay: 0.0, options: UIViewAnimationOptions.CurveEaseOut, animations: {
self.alpha = 0.0
}, completion: nil)
}
}
I unsuccessfully tried to call it in my Obj-C class like
[someView fadeOut(1.0)]