Skip to content

Instantly share code, notes, and snippets.

@sergiomtzlosa
Created August 26, 2014 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergiomtzlosa/556adbdf68097f55f413 to your computer and use it in GitHub Desktop.
Save sergiomtzlosa/556adbdf68097f55f413 to your computer and use it in GitHub Desktop.
swift-infix-uiappearance
/*
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