回答編集履歴

2

s

2016/10/16 08:35

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -52,6 +52,8 @@
52
52
 
53
53
  ```swift
54
54
 
55
+
56
+
55
57
  override func viewDidAppear(animated: Bool) {
56
58
 
57
59
  super.viewDidAppear(animated)
@@ -94,4 +96,4 @@
94
96
 
95
97
  }
96
98
 
97
- ``
99
+ ```

1

修正

2016/10/16 08:35

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -43,3 +43,55 @@
43
43
  }
44
44
 
45
45
  ```
46
+
47
+
48
+
49
+ 画面遷移を遅延で実行させる場合
50
+
51
+
52
+
53
+ ```swift
54
+
55
+ override func viewDidAppear(animated: Bool) {
56
+
57
+ super.viewDidAppear(animated)
58
+
59
+
60
+
61
+ let titleac = "title"
62
+
63
+ let messageac = "message"
64
+
65
+
66
+
67
+ let alert = UIAlertController(title: titleac, message: messageac , preferredStyle: UIAlertControllerStyle.Alert)
68
+
69
+
70
+
71
+ let action1 = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {
72
+
73
+ (action: UIAlertAction!) in
74
+
75
+
76
+
77
+ let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(0.3 * Double(NSEC_PER_SEC)))
78
+
79
+ dispatch_after(delayTime, dispatch_get_main_queue()) {
80
+
81
+ self.performSegueWithIdentifier("Next", sender: nil)
82
+
83
+ }
84
+
85
+ })
86
+
87
+
88
+
89
+ alert.addAction(action1)
90
+
91
+
92
+
93
+ self.presentViewController(alert, animated: true, completion: nil)
94
+
95
+ }
96
+
97
+ ``