Skip to content

Instantly share code, notes, and snippets.

View EvolvingParty's full-sized avatar

Kurt EvolvingParty

View GitHub Profile
// 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
@brunow
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