質問編集履歴
11
タグを編集
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
10
反映が適応されないので変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
[alarm-ios-swift](https://github.com/natsu1211/Alarm-ios-swift)を使ってアラームアプリを作成しています。
|
3
3
|
ios13へのアップグレードを計画していますが、let notifications = UIApplication.shared.scheduledLocalNotificationsの行がios13対応のiphoneではエラーを起こしてしまいます。
|
4
|
-
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications)でUNUserNotificationCenterを使ってください、ということは分かりましたが[
|
4
|
+
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications)でUNUserNotificationCenterを使ってください、ということは分かりましたが[UNUserNotificationCenterのDocumentation](https://developer.apple.com/documentation/usernotifications/unusernotificationcenter)
|
5
5
|
|
6
6
|
を調べても上記に変わる値が見つかりません。
|
7
7
|
|
9
反映が適応されないので変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
[alarm-ios-swift](https://github.com/natsu1211/Alarm-ios-swift)を使ってアラームアプリを作成しています。
|
3
3
|
ios13へのアップグレードを計画していますが、let notifications = UIApplication.shared.scheduledLocalNotificationsの行がios13対応のiphoneではエラーを起こしてしまいます。
|
4
|
-
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications)でUNUserNotificationCenterを使ってください、ということは分かりましたが[
|
4
|
+
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications)でUNUserNotificationCenterを使ってください、ということは分かりましたが[UNUserNotificationCenteのDocumentation](https://developer.apple.com/documentation/usernotifications/unusernotificationcenter)
|
5
5
|
|
6
6
|
を調べても上記に変わる値が見つかりません。
|
7
7
|
|
8
前提・実現したいことを変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
[alarm-ios-swift](https://github.com/natsu1211/Alarm-ios-swift)を使ってアラームアプリを作成しています。
|
3
3
|
ios13へのアップグレードを計画していますが、let notifications = UIApplication.shared.scheduledLocalNotificationsの行がios13対応のiphoneではエラーを起こしてしまいます。
|
4
|
-
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications)でUNUserNotificationCenterを使ってください、ということは分かりましたが[
|
4
|
+
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications)でUNUserNotificationCenterを使ってください、ということは分かりましたが[UNUserNotificationCenterのDocumentation](https://developer.apple.com/documentation/usernotifications/unusernotificationcenter)
|
5
5
|
|
6
6
|
を調べても上記に変わる値が見つかりません。
|
7
7
|
|
7
発生している問題・エラーメッセージを変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,14 +6,15 @@
|
|
6
6
|
を調べても上記に変わる値が見つかりません。
|
7
7
|
|
8
8
|
### 発生している問題・エラーメッセージ
|
9
|
-
|
9
|
+
Scheduler.swift
|
10
10
|
```Scheduler.swift
|
11
11
|
let notifications = UIApplication.shared.scheduledLocalNotifications
|
12
12
|
'scheduledLocalNotifications' was deprecated in iOS 10.0: Use UserNotifications Framework's -[UNUserNotificationCenter getPendingNotificationRequestsWithCompletionHandler:]
|
13
13
|
```
|
14
14
|
|
15
15
|
```
|
16
|
+
if notifications!.isEmpty {
|
16
|
-
|
17
|
+
'Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value:]
|
17
18
|
```
|
18
19
|
|
19
20
|
|
6
リンク切れを編集
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
[alarm-ios-swift](https://github.com/natsu1211/Alarm-ios-swift)を使ってアラームアプリを作成しています。
|
3
3
|
ios13へのアップグレードを計画していますが、let notifications = UIApplication.shared.scheduledLocalNotificationsの行がios13対応のiphoneではエラーを起こしてしまいます。
|
4
|
-
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications
|
4
|
+
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications)でUNUserNotificationCenterを使ってください、ということは分かりましたが[usernotificationsのDocumentation](https://developer.apple.com/documentation/usernotifications/unusernotificationcenter)
|
5
5
|
|
6
6
|
を調べても上記に変わる値が見つかりません。
|
7
7
|
|
5
ファイルのタイトルを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
### 発生している問題・エラーメッセージ
|
9
9
|
|
10
|
-
```
|
10
|
+
```Scheduler.swift
|
11
11
|
let notifications = UIApplication.shared.scheduledLocalNotifications
|
12
12
|
'scheduledLocalNotifications' was deprecated in iOS 10.0: Use UserNotifications Framework's -[UNUserNotificationCenter getPendingNotificationRequestsWithCompletionHandler:]
|
13
13
|
```
|
@@ -19,8 +19,8 @@
|
|
19
19
|
|
20
20
|
### 該当のソースコード
|
21
21
|
...
|
22
|
-
|
23
|
-
|
22
|
+
Scheduler.swift
|
23
|
+
```
|
24
24
|
func checkNotification() {
|
25
25
|
alarmModel = Alarms()
|
26
26
|
let notifications = UIApplication.shared.scheduledLocalNotifications
|
@@ -47,7 +47,8 @@
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
```
|
50
|
-
|
50
|
+
変更後
|
51
|
+
```
|
51
52
|
func checkNotification() {
|
52
53
|
alarmModel = Alarms()
|
53
54
|
let notifications = **UNUserNotificationCenter.何らかの値?**
|
4
タイトルを追記
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
scheduledLocalNotificationsのios13へのアップグレード
|
1
|
+
UIApplication.shared.scheduledLocalNotificationsのios13へのアップグレード
|
body
CHANGED
File without changes
|
3
変更後のソースコードを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -46,4 +46,31 @@
|
|
46
46
|
}
|
47
47
|
}
|
48
48
|
}
|
49
|
+
```
|
50
|
+
```変更後
|
51
|
+
func checkNotification() {
|
52
|
+
alarmModel = Alarms()
|
53
|
+
let notifications = **UNUserNotificationCenter.何らかの値?**
|
54
|
+
if notifications!.isEmpty {
|
55
|
+
for i in 0..<alarmModel.count {
|
56
|
+
alarmModel.alarms[i].enabled = false
|
57
|
+
}
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
for (i, alarm) in alarmModel.alarms.enumerated() {
|
61
|
+
var isOutDated = true
|
62
|
+
if alarm.onSnooze {
|
63
|
+
isOutDated = false
|
64
|
+
}
|
65
|
+
for n in notifications! {
|
66
|
+
if alarm.date >= n.fireDate! {
|
67
|
+
isOutDated = false
|
68
|
+
}
|
69
|
+
}
|
70
|
+
if isOutDated {
|
71
|
+
alarmModel.alarms[i].enabled = false
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
49
76
|
```
|
2
リンクの作成
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
|
-
アラームアプリを作成しています。
|
2
|
+
[alarm-ios-swift](https://github.com/natsu1211/Alarm-ios-swift)を使ってアラームアプリを作成しています。
|
3
3
|
ios13へのアップグレードを計画していますが、let notifications = UIApplication.shared.scheduledLocalNotificationsの行がios13対応のiphoneではエラーを起こしてしまいます。
|
4
4
|
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications )でUNUserNotificationCenterを使ってください、ということは分かりましたが[usernotificationsのDocumentation](https://developer.apple.com/documentation/usernotifications/unusernotificationcenter)
|
5
5
|
|
1
リンクを編集
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
scheduledLocalNotificationsのアップグレード
|
1
|
+
scheduledLocalNotificationsのios13へのアップグレード
|
body
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
アラームアプリを作成しています。
|
3
3
|
ios13へのアップグレードを計画していますが、let notifications = UIApplication.shared.scheduledLocalNotificationsの行がios13対応のiphoneではエラーを起こしてしまいます。
|
4
|
-
https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications でUNUserNotificationCenterを使ってください、ということは分かりましたがDocumentation
|
4
|
+
[scheduledLocalNotificationsのdocumentation](https://developer.apple.com/documentation/uikit/uiapplication/1622993-scheduledlocalnotifications )でUNUserNotificationCenterを使ってください、ということは分かりましたが[usernotificationsのDocumentation](https://developer.apple.com/documentation/usernotifications/unusernotificationcenter)
|
5
5
|
|
6
|
-
|
6
|
+
を調べても上記に変わる値が見つかりません。
|
7
7
|
|
8
8
|
### 発生している問題・エラーメッセージ
|
9
9
|
|