質問編集履歴

1

コード追加

2016/05/29 04:12

投稿

ra-men
ra-men

スコア98

test CHANGED
File without changes
test CHANGED
@@ -73,3 +73,63 @@
73
73
  }
74
74
 
75
75
  ```
76
+
77
+ ###こう書きなおしてみました
78
+
79
+ ```Swift
80
+
81
+ import UIKit
82
+
83
+ import FlatUIKit
84
+
85
+
86
+
87
+ class ViewController: UIViewController,FUIAlertViewDelegate {
88
+
89
+
90
+
91
+ .........
92
+
93
+
94
+
95
+ @IBAction func pushAction(sender: UIBarButtonItem) {
96
+
97
+ let alertView = FUIAlertView()
98
+
99
+ alertView.title = "Title"
100
+
101
+ alertView.delegate = self
102
+
103
+ alertView.message = "Message"
104
+
105
+ alertView.addButtonWithTitle("Cancel")
106
+
107
+ alertView.hasCancelButton = true
108
+
109
+ // キャンセルボタンを押下時のイベント(ブロックの中が呼ばれます)
110
+
111
+ alertView.onCancelAction = {
112
+
113
+ print("Push Cancel!")
114
+
115
+ }
116
+
117
+ // 更にボタンを追加する場合は以下
118
+
119
+ alertView.addButtonWithTitle("OK")
120
+
121
+ alertView.onOkAction = {
122
+
123
+ print("Push OK!")
124
+
125
+ }
126
+
127
+ alertView.show()
128
+
129
+ print("push")//ここは反応する
130
+
131
+ }
132
+
133
+
134
+
135
+ ```