iOSのライブラリ「SCLAlertView.swift」をカスタマイズ
しています。
下記のコードは、サンプルですが、
3つのボタンが表示されます。
--- viewController からの呼び出し ---
@IBAction func showSuccess(sender: AnyObject) {
let alert = SCLAlertView()
alert.addButton("First Button", target:self, selector:Selector("firstButton"))
alert.addButton("Second Button") {
println("Second button tapped")
}
alert.showSuccess(kSuccessTitle, subTitle: kSubtitle)
}
3つ目のボタンは、SCLAlertView.swiftに書かれていると思われます。
--- SCLAlertViewから抜粋 ---
public func showTitle(title: String, subTitle: String, duration: NSTimeInterval?, completeText: String?, style: SCLAlertViewStyle) -> SCLAlertViewResponder {
<前略>
// Done button
let txt = completeText != nil ? completeText! : "Done"
addButton(txt, target:self, selector:Selector("hideView"))
<後略>
ーーーーーーーーーーーーーーー
このボタンは閉じるだけの機能しかないので、無効化して
ボタン2つだけにしたいと思っているのですが、
上記のコードをコメントアウトすると、表示は問題ないのですが、
ボタンを押すと、落ちます。
どうしてなのでしょうか?
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。