let ParseApplicationId = "xxx"
let ParseClientKey = "xxx"
let AppGreenColor = UIColor(red: 0.2, green: 0.7, blue: 0.3 alpha: 1.0)
@objc class Constant: NSObject {
private init() {}
class func parseApplicationId() -> String { return ParseApplicationId }
class func parseClientKey() -> String { return ParseClientKey }
class func appGreenColor() -> UIColor { return AppGreenColor }
}
在Objective-C中,您可以使用它们:
NSString *appklicationId = [Constant parseApplicationId];
NSString *clientKey = [Constant parseClientKey];
UIColor *greenColor = [Constant appGreenColor];
标签:Constant,无法访问,UIColor,let,Objective,return,Swift,class
From: https://www.cnblogs.com/huangzs/p/17547587.html