This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct UserActivityView: View { | |
@State private(set) var activityType: String? = nil | |
@State private(set) var currentActivity: NSUserActivity? = nil | |
var body: some View { | |
Text(activityType ?? "No activity restored yet") | |
.onContinueUserActivity("userActivity", perform: { userActivity in | |
self.activityType = userActivity.activityType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gist file for Creating Activity Rings in SwiftUI | |
// https://swdevnotes.com/swift/2021/create-activity-rings-in-swiftui/ | |
// | |
// All code in one ContentView.swift file just for sharing | |
// | |
// Created by Eric on 05/09/2021. | |
// | |
import SwiftUI |