質問編集履歴
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
ただいまswiftのローカルプッシュ通知を学んでおり、その中でTimerを使う機会がありました。
|
2
|
-
参加書などを参考にし、なんとか下のプログラムを完成させることができ、ビルドも成功しました。
|
2
|
+
参加書などを参考にし、なんとか下のプログラムを完成させることができ、ビルドも成功しました。
|
3
3
|
|
4
|
+
```swift
|
5
|
+
|
4
6
|
import UIKit
|
5
7
|
import UserNotifications
|
6
8
|
|
@@ -73,22 +75,8 @@
|
|
73
75
|
|
74
76
|
let trigger4 = UNTimeIntervalNotificationTrigger(timeInterval: 14, repeats: false)
|
75
77
|
let request4 = UNNotificationRequest(identifier: "ID5", content: content4, trigger: trigger4)
|
76
|
-
UNUserNotificationCenter.current().add(request4,withCompletionHandler:
|
78
|
+
UNUserNotificationCenter.current().add(request4,withCompletionHandler:nil)
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
}
|
81
|
-
|
82
|
-
/*
|
83
|
-
// MARK: - Navigation
|
84
79
|
|
85
|
-
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
86
|
-
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
87
|
-
// Get the new view controller using segue.destination.
|
88
|
-
// Pass the selected object to the new view controller.
|
89
|
-
}
|
90
|
-
*/
|
91
|
-
|
92
80
|
}
|
93
81
|
|
94
82
|
```
|