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()
}
}
SCLButton的更多相关文章
随机推荐
- idea mac 快键键
alt + 花 + 左右 上一步下一步 shift + 花 + F 全文检索 花 + O 类查找 alt + 花 ...
- c语言:蜗牛的爬行。
main() { printf("hello,word!,第一次的c语言输出"); }
- Java里的IO流里的 ObjectInputStream 的读取\写入!
各位好!!我又来了!!今天遇见了一个小问题!! IO流里的对象读取总是出错!各种报错!!神烦啊!!百思不得其解啊!然后就上网百度!找了好久终于让我找到了!下面就让我来说一说! 当你用IO流里的对象流写 ...
- [Angular 2] Passing data to components with 'properties'
Besides @Input(), we can also use properties on the @Component, to pass the data. import {Component, ...
- Oracle EBS 入门
Oracle EBS 入门Oracle EBS全称是Oracle 电子商务套件(E-Business Suit),是在原来Application(ERP)基础上的扩展,包含ERP(企业资源计划管理). ...
- Delpoyment assembly
遇见异常: java.lang.ClassNotFoundException: 原因:没有对tomcat进行依赖说明 解决: properties - Delpoyment assembly 将tom ...
- SPOJ 181 - Scuba diver 二维背包
潜水员要潜水,给出n个气缸(1<=n<=1000),每个气缸中有氧气量为ti,氮气量为ai,气缸重量为wi(1<=ti<=21,1<=ai<=79,1<=wi ...
- POJ 3162 Walking Race(树的直径+单调队列)
题目大意:对一棵树,求出从每个结点出发能到走的最长距离(每个结点最多只能经过一次),将这些距离按排成一个数组得到dis[1],dis[2],dis[3]……dis[n] ,在数列的dis中求一个最长的 ...
- android SDK开发 -- TitleBar封装(一)
假设app的title 统一的都是这种左中右结构的 代码如下 <LinearLayout xmlns:android="http://schemas.android.com/apk/r ...
- 分享一个导出数据到 Excel 的类库
起源: 之前在做一个项目时,客户提出了许多的导出数据的需求: 导出用户信息 导出业务实体信息 各种查询都要能导出 导出的数据要和界面上看到的一致 可以分页导出 ... 为了应对用户的这些需求,我决定先 ...