質問編集履歴
1
コードを伝わりやすく書き直し
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
-
広告
|
21
|
+
ダイアログの質問回答後、広告も表示されず画面遷移もしません。
|
22
22
|
|
23
23
|
|
24
24
|
|
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
|
81
|
-
|
81
|
+
|
82
82
|
|
83
83
|
if interstitial.isReady {
|
84
84
|
|
@@ -109,6 +109,28 @@
|
|
109
109
|
if let answer = alert.textFields?.first?.text {
|
110
110
|
|
111
111
|
if answer == "(self.a + self.b)" {
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
//広告
|
116
|
+
|
117
|
+
self.interstitial = createAndLoadInterstitial()
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
func createAndLoadInterstitial() -> GADInterstitial {
|
122
|
+
|
123
|
+
let interstitial = GADInterstitial(adUnitID: "ca-app-pub-2929539065928288/6968941950")
|
124
|
+
|
125
|
+
interstitial.delegate = self
|
126
|
+
|
127
|
+
interstitial.load(GADRequest())
|
128
|
+
|
129
|
+
return interstitial
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
}
|
112
134
|
|
113
135
|
let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "second") as! nextViewController
|
114
136
|
|