Last active
September 25, 2016 00:45
-
-
Save mono0926/9fcae6f1bd9755a74242e73ce0d22fca to your computer and use it in GitHub Desktop.
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
import UIKit | |
extension UIColor { | |
class var theme: UIColor { return #colorLiteral(red: 0.4274509804, green: 0.7568627451, blue: 0.6196078431, alpha: 1) } | |
// 別解1(推奨) | |
struct MyApp { | |
static var theme: UIColor { return #colorLiteral(red: 0.4274509804, green: 0.7568627451, blue: 0.6196078431, alpha: 1) } | |
} | |
// 別解2(Objective-Cチック) | |
class var myapp_theme: UIColor { return #colorLiteral(red: 0.4274509804, green: 0.7568627451, blue: 0.6196078431, alpha: 1) } | |
} | |
// 別解1の利用例 | |
let c = UIColor.MyApp.theme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment