zoukankan      html  css  js  c++  java
  • switf重载

    import UIKit

    import Foundation

    class MyView: UIView {

     //   var acolor :UIColor

        

        /*

        // Only override draw() if you perform custom drawing.

        // An empty implementation adversely affects performance during animation.

        override func draw(_ rect: CGRect) {

            // Drawing code

        }

        */

    //    private var cancelButtonTitle: String!;

    //    private var destructiveButtonTitle: String!;

    //    private var otherButtonTitles: [String]!;

    //

        

        override init(frame: CGRect) {

    //        cancelButtonTitle = String()

    //        destructiveButtonTitle = String()

    //        otherButtonTitles=[String]()

            super.init(frame:frame)

        }

        

        required init?(coder aDecoder: NSCoder) {

            super.init(coder: aDecoder)!;

        }

            //convenience可选够造初始

        convenience init(acolor:UIColor) {

           self.init(frame: CGRect.zero)

    //        self.cancelButtonTitle = cancelButtonTitle;

    //        self.destructiveButtonTitle = destructiveButtonTitle;

    //        self.otherButtonTitles = otherButtonTitles;

            self.backgroundColor = acolor

           // prepareUI();

        }

        

    }

    一天一章
  • 相关阅读:
    python学习笔记(7)
    python学习笔记(6)
    python学习笔记(5)
    python学习笔记(4)
    python学习笔记(3)
    python学习笔记(2)
    软件工程结对编程第二次作业
    软件工程结对编程第一次作业
    软件工程第三次作业
    答编辑问
  • 原文地址:https://www.cnblogs.com/hangman/p/8403813.html
Copyright © 2011-2022 走看看