Swift宏定义
1.新建文件, 选择iOS -> Source -> Swift File
名字你自己随心意
生成的会是一个.swift空文件, 默认应该会是Foundation框架, 自己修改为UIKit即可
import UIKit
let SCREEN_WIDTH = UIScreen.main.bounds.size.width
let SCREEN_HEIGHT = UIScreen.main.bounds.size.height
func RGBCOLOR(r:CGFloat,_ g:CGFloat,_ b:CGFloat) -> UIColor
{
return UIColor(red: (r)/255.0, green: (g)/255.0, blue: (b)/255.0, alpha: 1.0)
}