Created
August 26, 2014 15:55
-
-
Save sergiomtzlosa/556adbdf68097f55f413 to your computer and use it in GitHub Desktop.
swift-infix-uiappearance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
let imageColor : UIImage! = UIImage.imageWithColor(UIColor.redColor()) | |
"UINavigationBar" => imageColor | |
*/ | |
import Foundation | |
import UIKit | |
infix operator => {} | |
func => (className: String!, image: UIImage!) | |
{ | |
var name : AnyClass = NSClassFromString(className) | |
name.appearance().setBackgroundImage(image, forBarMetrics: .Default) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment