zoukankan      html  css  js  c++  java
  • swift开发笔记09

    // 类的扩展

    public extension UIColor {

        convenience init(r: Int, g:Int, b:Int, a:CGFloat) {

            self.init(red: CGFloat(r)/255, green:CGFloat(g)/255, blue: CGFloat(b)/255, alpha: a)

            

        }

        

        convenience init(hex: Int) {

            self.init(r: (hex & 0xff0000) >> 16, g: (hex & 0xff00)  >> 8, b: (hex & 0xff), a: 1)

        }

    }

     

    // 参数,带有默认值

        init(name: String, avatarName: String = "bayMax", education: String)

        {

            self.name = name

            self.avatarName = avatarName

            self.education = education

        }

     

    // 参数的get方法

        fileprivate var user: FBMeUser {

            get {

                return FBMeUser.init(name: "BayMax", education: "CMU")

            }

        }

    //参数的初始化,cell的注册

        private let myTableView: UITableView = {

            let view = UITableView.init(frame: .zero, style: .grouped)

            view.register(CellOne.self,forCellReuseIdentifier: CellOne.indentifier)

            return view

        }()

     

        public static var color: Color{

            return Color()

        }

     

     

     

     

     

     

  • 相关阅读:
    Delphi 通过Access Violation地址错误找到错误的哪行代码
    GitHub 转载:github删除repository
    GitHub 转载:github的高级搜索
    SVN 转载:svn报错:privious operation has not finshed;run 'cleanup' if it was interrupted
    GitHub 转载:github新手使用
    Delphi 对应JAVA的MD5加密处理
    Delphi 对应JAVA的BASE64位加密处理
    Delphi 对应JAVA的URL编码处理
    python基础(五)
    DataFrame
  • 原文地址:https://www.cnblogs.com/dengchaojie/p/7340038.html
Copyright © 2011-2022 走看看