Skip to content

Commit 3f0e9c5

Browse files
Bharat Medirattaps2
authored andcommitted
Cosmetic cleanup (#744)
* Remove boilerplate comments * Remove boilerplate comments and methods
1 parent 28cd441 commit 3f0e9c5

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

WatchApp Extension/Controllers/NotificationController.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,14 @@ import UserNotifications
1414
final class NotificationController: WKUserNotificationInterfaceController {
1515

1616
override init() {
17-
// Initialize variables here.
1817
super.init()
19-
20-
// Configure interface objects here.
2118
}
2219

2320
override func willActivate() {
24-
// This method is called when watch view controller is about to be visible to user
2521
super.willActivate()
2622
}
2723

2824
override func didDeactivate() {
29-
// This method is called when watch view controller is no longer visible
3025
super.didDeactivate()
3126
}
3227

WatchApp Extension/ExtensionDelegate.swift

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,55 +41,29 @@ final class ExtensionDelegate: NSObject, WKExtensionDelegate {
4141
}
4242

4343
func applicationDidFinishLaunching() {
44-
// Perform any final initialization of your application.
4544
UNUserNotificationCenter.current().delegate = self
4645
}
4746

4847
func applicationDidBecomeActive() {
49-
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
50-
5148
if WCSession.default.activationState != .activated {
5249
WCSession.default.activate()
5350
}
5451
}
5552

56-
func applicationWillResignActive() {
57-
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
58-
// Use this method to pause ongoing tasks, disable timers, etc.
59-
}
60-
61-
func handleUserActivity(_ userInfo: [AnyHashable : Any]?) {
62-
// Use it to respond to Handoff–related activity. WatchKit calls this method when your app is launched as a result of a Handoff action. Use the information in the provided userInfo dictionary to determine how you want to respond to the action. For example, you might decide to display a specific interface controller.
63-
}
64-
6553
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
6654
for task in backgroundTasks {
6755
switch task {
6856
case is WKApplicationRefreshBackgroundTask:
6957
os_log("Processing WKApplicationRefreshBackgroundTask")
70-
// Use the WKApplicationRefreshBackgroundTask class to update your app’s state in the background.
71-
// You often use a background app refresh task to drive other tasks. For example, you could use a background app refresh task to start an URLSession background transfer, or to schedule a background snapshot refresh task.
72-
// Your app must schedule background app refresh tasks by calling your extension’s scheduleBackgroundRefresh(withPreferredDate:userInfo:scheduledCompletion:) method. The system never schedules these tasks.
73-
// WKExtension.shared().scheduleBackgroundRefresh(withPreferredDate:userInfo: scheduledCompletion:)
74-
// For more information, see [WKApplicationRefreshBackgroundTask] https://developer.apple.com/reference/watchkit/wkapplicationrefreshbackgroundtask
75-
// Background app refresh tasks are budgeted. In general, the system performs approximately one task per hour for each app in the dock (including the most recently used app). This budget is shared among all apps on the dock. The system performs multiple tasks an hour for each app with a complication on the active watch face. This budget is shared among all complications on the watch face. After you exhaust the budget, the system delays your requests until more time becomes available.
7658
break
7759
case let task as WKSnapshotRefreshBackgroundTask:
7860
os_log("Processing WKSnapshotRefreshBackgroundTask")
79-
// Use the WKSnapshotRefreshBackgroundTask class to update your app’s user interface. You can push, pop, or present other interface controllers, and then update the content of the desired interface controller. The system automatically takes a snapshot of your user interface as soon as this task completes.
80-
// Your app can invalidate its current snapshot and schedule a background snapshot refresh tasks by calling your extension’s scheduleSnapshotRefresh(withPreferredDate:userInfo:scheduledCompletion:) method. The system will also schedule background snapshot refresh tasks to periodically update your snapshot.
81-
// For more information, see WKSnapshotRefreshBackgroundTask.
82-
// For more information about snapshots, see Snapshots.
83-
8461
task.setTaskCompleted(restoredDefaultState: false, estimatedSnapshotExpiration: Date(timeIntervalSinceNow: TimeInterval(minutes: 5)), userInfo: nil)
8562
return // Don't call the standard setTaskCompleted handler
8663
case is WKURLSessionRefreshBackgroundTask:
87-
// Use the WKURLSessionRefreshBackgroundTask class to respond to URLSession background transfers.
8864
break
8965
case let task as WKWatchConnectivityRefreshBackgroundTask:
9066
os_log("Processing WKWatchConnectivityRefreshBackgroundTask")
91-
// Use the WKWatchConnectivityRefreshBackgroundTask class to receive background updates from the WatchConnectivity framework.
92-
// For more information, see WKWatchConnectivityRefreshBackgroundTask.
9367

9468
pendingConnectivityTasks.append(task)
9569

0 commit comments

Comments
 (0)