Skip to content

Instantly share code, notes, and snippets.

View EvolvingParty's full-sized avatar

Kurt EvolvingParty

View GitHub Profile
brunow / ContentView.swift
Created August 26, 2020 15:43
Donate a NSUserActivity and restore it with SwiftUI
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
// gist file for Creating Activity Rings in SwiftUI
// All code in one ContentView.swift file just for sharing
// Created by Eric on 05/09/2021.
import SwiftUI