Adopt Quick Note

RSS for tag

Discuss the WWDC21 session Adopt Quick Note.

Posts under wwdc21-10264 tag

4 Posts

Post

Replies

Boosts

Views

Activity

How to Use Quick Notes Using SwiftUI
I am trying to implement Quick Notes through SwiftUI, rather than UIKit or AppKit. I am unsure if the behaviour below is expected, or due to a bug. I have already successfully implemented NSUserActivity for Handoff, Spotlight and Siri Reminders, using the .userActivity() view modifier. These NSUserActivity instances use the NSUserActivity.userInfo dictionary to store and correctly restore the content through the .onContinueUserActivity(perform: ) methods. Quick Notes requires using the .persistentIdentifier or .targetContentIdentifier properties, rather than the .userInfo dictionary alone. However, when I set these either of these to unique identifiers using the code below, they are not correctly stored within the useractivity. MyView() .userActivity(ActivityString, updateUserActivity) private func updateUserActivity(_ activity: NSUserActivity) {     activity.isEligibleForSearch = true     activity.isEligibleForHandoff = true     activity.title = "Title"     activity.targetContentIdentifier = myItemUniqueID     activity.persistentIdentifier = myItemUniqueID     activity.userInfo = ["id": myItemUniqueID]     print(activity.targetContentIdentifier) // Correctly prints     print(activity.persistentIdentifier) // Correctly prints     print(activity.userInfo) // Correctly prints     } The identifiers print correctly when setting the user activity above. However, when restoring the user activity (tested through Handoff and Spotlight Search), the targetContentIdentifier and persistentIdentifier strings are empty. MyView()     .onContinueUserActivity(ActivityString, perform: continueUserActivity) private func continueUserActivity(_ activity: NSUserActivity) {     print(activity.persistentIdentifier) // Nil     print(activity.targetContentIdentifier) // Nil     print(activity.userInfo) // Correctly prints     } Is there something else I must do, or is this unexpected behaviour?
1
0
1.7k
Jul ’23
Quick Note does not show "Add Link" for iCloud documents even though persistentIdentifier is set
I'm trying to adopt Quick Note in a document-based app. Has anyone got the "Add Link" button to show up for documents located in iCloud? For local documents, the button works but then userInfo dictionary is missing from the continued NSUserActivity... I have prepared an Xcode project that demonstrates the issue, available here on GitHub with a README describing what I have tried and what's not working in more detail: https://github.com/tomaskraina/feedbackassistant.apple.com/tree/master/QuickNote-UIDocumentVsUserActivity
5
0
2.4k
Oct ’21
Is there a way to control Quick Note's thumbnail if it has a `webpageURL`?
I'm planning to adopt Quick Note inside my application, however, I'm having an issue where by setting an webpageURL property on NSUserActivity, I lose control over how the thumbnail looks. Instead of displaying the content that I used on NSUserActivity's title, it seems to get its title from the web page itself. Is there a way to avoid this behaviour? I'd like to keep the webpageURL property defined because it allows our users to open the content on a web browser if they don't have the application installed.
0
0
611
Aug ’21
How to Use Quick Notes Using SwiftUI
I am trying to implement Quick Notes through SwiftUI, rather than UIKit or AppKit. I am unsure if the behaviour below is expected, or due to a bug. I have already successfully implemented NSUserActivity for Handoff, Spotlight and Siri Reminders, using the .userActivity() view modifier. These NSUserActivity instances use the NSUserActivity.userInfo dictionary to store and correctly restore the content through the .onContinueUserActivity(perform: ) methods. Quick Notes requires using the .persistentIdentifier or .targetContentIdentifier properties, rather than the .userInfo dictionary alone. However, when I set these either of these to unique identifiers using the code below, they are not correctly stored within the useractivity. MyView() .userActivity(ActivityString, updateUserActivity) private func updateUserActivity(_ activity: NSUserActivity) {     activity.isEligibleForSearch = true     activity.isEligibleForHandoff = true     activity.title = "Title"     activity.targetContentIdentifier = myItemUniqueID     activity.persistentIdentifier = myItemUniqueID     activity.userInfo = ["id": myItemUniqueID]     print(activity.targetContentIdentifier) // Correctly prints     print(activity.persistentIdentifier) // Correctly prints     print(activity.userInfo) // Correctly prints     } The identifiers print correctly when setting the user activity above. However, when restoring the user activity (tested through Handoff and Spotlight Search), the targetContentIdentifier and persistentIdentifier strings are empty. MyView()     .onContinueUserActivity(ActivityString, perform: continueUserActivity) private func continueUserActivity(_ activity: NSUserActivity) {     print(activity.persistentIdentifier) // Nil     print(activity.targetContentIdentifier) // Nil     print(activity.userInfo) // Correctly prints     } Is there something else I must do, or is this unexpected behaviour?
Replies
1
Boosts
0
Views
1.7k
Activity
Jul ’23
Is there a way how to trigger Quick Note on Simulator?
e.g. via a keyboard shortcut? That would be really helpful when debugging. Or is it possible to show the Quick Note window only on iPad with Pencil by swiping from the bottom right corner of the screen?
Replies
2
Boosts
0
Views
2.5k
Activity
May ’22
Quick Note does not show "Add Link" for iCloud documents even though persistentIdentifier is set
I'm trying to adopt Quick Note in a document-based app. Has anyone got the "Add Link" button to show up for documents located in iCloud? For local documents, the button works but then userInfo dictionary is missing from the continued NSUserActivity... I have prepared an Xcode project that demonstrates the issue, available here on GitHub with a README describing what I have tried and what's not working in more detail: https://github.com/tomaskraina/feedbackassistant.apple.com/tree/master/QuickNote-UIDocumentVsUserActivity
Replies
5
Boosts
0
Views
2.4k
Activity
Oct ’21
Is there a way to control Quick Note's thumbnail if it has a `webpageURL`?
I'm planning to adopt Quick Note inside my application, however, I'm having an issue where by setting an webpageURL property on NSUserActivity, I lose control over how the thumbnail looks. Instead of displaying the content that I used on NSUserActivity's title, it seems to get its title from the web page itself. Is there a way to avoid this behaviour? I'd like to keep the webpageURL property defined because it allows our users to open the content on a web browser if they don't have the application installed.
Replies
0
Boosts
0
Views
611
Activity
Aug ’21