zoukankan      html  css  js  c++  java
  • SCLButton

    import UIKit

    let kSuccessTitle = "Congratulations"

    let kErrorTitle = "Connection error"

    let kNoticeTitle = "Notice"

    let kWarningTitle = "Warning"

    let kInfoTitle = "Info"

    let kSubtitle = "You've just displayed this awesome Pop up View"

    let kDefaultAnimationDuration = 2.0

    class ViewController:UIViewController {

      override func viewDidLoad() {

        super.viewDidLoad()

      }

      override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()

      }

      @IBAction func showSuccess(sender:AnyObject) {

        let alert = SCAlertView()

        alert.addButton("First Button" target:self, selector:Selector("firstButton"))

        alert.addButton("Second Button") {

          printIn("Second button tapped")

        }

        alert.showSuccess(self,title:kSuccessTitle, subTitle:kSubtitle)

        

      }

      func firstButton() {

        println("First button tapped")

      }

    }

    import Foundation

    import UIKit

    enum SCLAlertViewStyle {

      case Success, Error,Notice,Waring,Info,Edit

    }

    enum SCLActionType {

      case None, Selector, Closure

    }

    class SCLButton:UIButton {

      var actionType = SCLActionType.None

      var target:AnyObject!

      var selector:Selector!

      var action:(()->Void)!

      override init() {

        super.init()

      }

      required init(coder aDecoder:NSCoder) {

        super.init(coder:aDecoder)

      }

      override init(frame:CGRect) {

        super.init(frame:frame)

      }

    }

    class SCLAlertViewResponder {

      let alertview:SCLAlertView

      init(alertview:SCLAlertView) {

        self.alertView = alertView

      }

      func setTitle(title:String) {

        self.alertview.labelTitle.text = title

      }

      func setSubTitle(subTitle:String) {

        self.alertview.viewText.Text = subTitle

      }

      func close() {

        self.alertview.hideview()

      }

    }

  • 相关阅读:
    每日日报7月15日
    每日日报7月14日
    ecplise下 java问题处理
    Visual Studio Code for .Net Framework
    Go语言操作MySQL数据库
    Go语言Gin-4中间件
    Go语言Gin-2.数据传输
    Go语言Gin-1.路由
    13.Go语言-并发编程
    12.Go语言-网络编程
  • 原文地址:https://www.cnblogs.com/yushunwu/p/4003329.html
Copyright © 2011-2022 走看看