Post

Replies

Boosts

Views

Activity

Hide characters with TextKit 2
With TextKit 1, I was able to “tag” characters with attribute string keys that flagged them to be invisible, then I would use NSLayoutManager’s layoutManager(_:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:) to strip these characters out, preventing change to the underlying storage. In TextKit 2, I don’t see an opportunity to do this. The best point I think to intercept would be NSTextLayoutFragment, but without being able to see what’s happening, I don’t know if it’s possible to alter the content used to generate the line fragments. My end goal is to be able to hide characters for a Markdown editor, so maybe I’m thinking about this wrong? Any advice would be welcome.
1
0
465
Mar ’25
How to hide NSToolbar background when NSHostingController's ScrollView is at the top
In Monterey, when a user was at the top of a ScrollView implemented inside of a NSHostingController's view (that was itself embedded in a window with a NSToolbar), the window's toolbar background would be hidden until the user scrolled from the top. In Ventura, this behavior is different, with the toolbar's background visible all of the time unless a traditional NSScrollView is used (which means no SwiftUI). Is there the ability to change this behavior within SwiftUI some how now?
1
1
935
Sep ’24
Customize NSCollectionView Drop Indicator in custom NSCollectionViewLayout
I've created a custom NSCollectionView layout that is vertical in design and it supports dragging and dropping. However, the drawn drop indicator only is a vertical line in the middle of the inter gap or drop zones specified. Ideally, I'd like for this line to be horizontal, extending the width of the frame rather than the vertical and extending the height. Basically, I am trying to replicate the drop indicator that's used in NSTableView or NSOutlineView. Is there any way to accomplish this?
Topic: UI Frameworks SubTopic: AppKit Tags:
0
1
611
Jan ’24
isLongLived with configuredWith and async await
Suppose I start a request using the new async await with isLongLived set true: let config = CKOperation.Configuration() config.isLongLived = true let results = try await database.configuredWith(configuration: config) { db in try await db.modifyRecordZones(saving: [...], deleting: [...]) } try await processResults(results) — then assuming my application exits and the requests is continued through by the system: would these operations eventually end up in the container's allLongLivedOperationIDs() like a classic CKOperation? And a follow up question, assuming that the answer above is true: to "finish" these operations, we should we take the fetched long-lived operations, essentially insert our post-async await code into that completion block, and then add it to the database? I think that all makes sense, and I am going to test it out, but figured it'd be worth asking
0
1
1.1k
Jun ’22
targetContentIdentifier on NSUserActivity nil on Handoff
I am using scenes and setting up Handoff between a Mac and iPad/iOS application. Whenever I receive the user activity on the iPad, targetContentIdentifier is always nil. I've confirmed that things like userInfo and persistentIdentifier are coming through by outputting them in func scene(_ scene: UIScene, continue userActivity: NSUserActivity), but without the targetContentIdentifier is always empty. Without it, I can't use the activation condition's and proper scene isn't being selected by iOS... is there something beyond setting it and marking an activity as eligible for handoff that I am missing?
1
0
1.9k
May ’22
Missing UserInfo?
I've noticed that when I try to launch some Shortcuts set with NSUserActivity, they're missing the UserInfo keys. I've made sure to requiredUserInfoKeys and they launch properly from Spotlight and Handoff, but not from Shortcuts - anyone having similar issues?
1
0
1.7k
Sep ’21
Disable QLPreviewController swipe down to dismiss
I've a QLPreviewController in the detail/secondary section of a UISplitViewController and when the user swipes down, it dismisses the entire split view. Is there a way to prevent this?
Replies
1
Boosts
0
Views
317
Activity
Oct ’25
Hide characters with TextKit 2
With TextKit 1, I was able to “tag” characters with attribute string keys that flagged them to be invisible, then I would use NSLayoutManager’s layoutManager(_:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:) to strip these characters out, preventing change to the underlying storage. In TextKit 2, I don’t see an opportunity to do this. The best point I think to intercept would be NSTextLayoutFragment, but without being able to see what’s happening, I don’t know if it’s possible to alter the content used to generate the line fragments. My end goal is to be able to hide characters for a Markdown editor, so maybe I’m thinking about this wrong? Any advice would be welcome.
Replies
1
Boosts
0
Views
465
Activity
Mar ’25
How to hide NSToolbar background when NSHostingController's ScrollView is at the top
In Monterey, when a user was at the top of a ScrollView implemented inside of a NSHostingController's view (that was itself embedded in a window with a NSToolbar), the window's toolbar background would be hidden until the user scrolled from the top. In Ventura, this behavior is different, with the toolbar's background visible all of the time unless a traditional NSScrollView is used (which means no SwiftUI). Is there the ability to change this behavior within SwiftUI some how now?
Replies
1
Boosts
1
Views
935
Activity
Sep ’24
Customize NSCollectionView Drop Indicator in custom NSCollectionViewLayout
I've created a custom NSCollectionView layout that is vertical in design and it supports dragging and dropping. However, the drawn drop indicator only is a vertical line in the middle of the inter gap or drop zones specified. Ideally, I'd like for this line to be horizontal, extending the width of the frame rather than the vertical and extending the height. Basically, I am trying to replicate the drop indicator that's used in NSTableView or NSOutlineView. Is there any way to accomplish this?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
0
Boosts
1
Views
611
Activity
Jan ’24
Updated Navigation Design in TV app
It looks like there's a new tab bar / column style design for tvOS that was introduced with the current TV app. Is there any word on this being a developer available component?
Replies
0
Boosts
0
Views
699
Activity
Jan ’24
Suppress App Intent Dialog when using custom view
In Design App Shortcuts, Lynn shows a slide at 11:54 where a shortcut with a custom view has "suppressed" the dialog. How can we achieve this? I can't find any actual examples.
Replies
2
Boosts
0
Views
1.6k
Activity
Oct ’23
UICloudSharingController for macOS
Is there an equivalent to UICloudSharingController for macOS?
Replies
0
Boosts
2
Views
983
Activity
Aug ’22
isLongLived with configuredWith and async await
Suppose I start a request using the new async await with isLongLived set true: let config = CKOperation.Configuration() config.isLongLived = true let results = try await database.configuredWith(configuration: config) { db in try await db.modifyRecordZones(saving: [...], deleting: [...]) } try await processResults(results) — then assuming my application exits and the requests is continued through by the system: would these operations eventually end up in the container's allLongLivedOperationIDs() like a classic CKOperation? And a follow up question, assuming that the answer above is true: to "finish" these operations, we should we take the fetched long-lived operations, essentially insert our post-async await code into that completion block, and then add it to the database? I think that all makes sense, and I am going to test it out, but figured it'd be worth asking
Replies
0
Boosts
1
Views
1.1k
Activity
Jun ’22
targetContentIdentifier on NSUserActivity nil on Handoff
I am using scenes and setting up Handoff between a Mac and iPad/iOS application. Whenever I receive the user activity on the iPad, targetContentIdentifier is always nil. I've confirmed that things like userInfo and persistentIdentifier are coming through by outputting them in func scene(_ scene: UIScene, continue userActivity: NSUserActivity), but without the targetContentIdentifier is always empty. Without it, I can't use the activation condition's and proper scene isn't being selected by iOS... is there something beyond setting it and marking an activity as eligible for handoff that I am missing?
Replies
1
Boosts
0
Views
1.9k
Activity
May ’22
Missing UserInfo?
I've noticed that when I try to launch some Shortcuts set with NSUserActivity, they're missing the UserInfo keys. I've made sure to requiredUserInfoKeys and they launch properly from Spotlight and Handoff, but not from Shortcuts - anyone having similar issues?
Replies
1
Boosts
0
Views
1.7k
Activity
Sep ’21