Post

Replies

Boosts

Views

Activity

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?
0
0
422
Jan ’24
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
622
May ’23
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
959
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.6k
Jul ’21
Problems running Mac application that imports dynamic libraries via SPM
I have been working on a Mac app that until recently didn't have a hardened runtime, but was enabled since it needs iCloud/CloudKit support and that's required for the entitlement. Now though, I can't run the application (even in debug) unless I have "Disable Library Validation" checked. I don't believe the disable library validation is allowed for submission to the MAS (which is how I plan to distribute), but without that, building and running my application locally impossible since crashes on launch with a code signature invalid error. This also is causing my SwiftUI previews to go insane and die (the same error below pops up in the canvas regardless of the library validation setting). I suspect it has to do with SPM, but I dunno.. maybe it's something that I've done... this is what I am getting: dyld: Library not loaded: @rpath/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct.framework/Versions/A/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct Referenced from: /(super/long/path)/Build/Products/Debug/MyApplication.app/Contents/MacOS/MyApplication Reason: no suitable image found. Did find: /(super/long/path)/Build/Products/Debug/PackageFrameworks/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct.framework/Versions/A/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct: code signature in (/(super/long/path)/Build/Products/Debug/PackageFrameworks/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct.framework/Versions/A/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. /(super/long/path)/Build/Products/Debug/MyApplication.app/Contents/MacOS/../Frameworks/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct.framework/Versions/A/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct: code signature invalid for '/(super/long/path)/Build/Products/Debug/MyApplication.app/Contents/MacOS/../Frameworks/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct.framework/Versions/A/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct' /(super/long/path)/Build/Products/Debug/MyApplication.app/Contents/MacOS/../Frameworks/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct.framework/Versions/A/3rdPartyFramework_38E624E3CA89CFDE_PackageProduct: stat() failed with errno=1 (lldb) I have an app dependency structure that works somewhat like this: // ┌───┐ // ┌─────┤app├───────┐ // │ └─┬─┘ │ // │ │ │ // │ │ │ // ┌────▼────┐ │ ┌──────▼──────┐ // │internal │ │ │SPM 1st party│ // │framework│ │ │framework │ // └────────┬┘ │ └─┬───────────┘ // │ │ │ // │ │ │ // │ │ │ // ┌▼───▼────▼┐ // │SPM │ // │3rd party │ // │framework │ // │dependency│ // └──────────┘ There's my app, a framework embedded into the project, and two frameworks imported via SPM and all depend on and import 3rdPartyFramework (except that, of course). I think it is a binary framework I read something about bugs with SPM and signing here? Unsure if actually related. And the framework is RxSwift, if curious. From what I understand, I'd need to manually sign these frameworks to myself if I were to distribute the application (either myself or through the app store) but at this point, I am just trying to get it to run while working on it again - is this something I'd need to do each time I launch the app from Xcode...? Along with that, when I do try to go in and code sign the frameworks manually (either myself with Terminal or through a run script), I am getting an error along the lines of "code object is not signed at all (SPM 1st Party Framework Path) In subcomponent (SPM 3rd Party Framework Path)". So I clearly don't know what I am doing — any help would be appreciated.
1
0
1.3k
Jun ’21
UINavigationBarAppearance and Navigation Bar TintColor
Is there a way to use UINavigationBarAppearance to change the color of icons in bar button items in a Navigation Bar (and change them between standardAppearance and scrollEdgeAppearance)? Previously this was handled with the tintColor, but this is now considered legacy and doesn't give you the flexibility between the different appearances. Accessing this property on UINavigationBar also doesn't seem to be working consistently for me now that accentColor has been introduced which makes this even more problematic. At the moment, I seem to be only able to change the title and button text colors, but there's no way to change the image tints so you get some really bizarre combos — the texts will gain the color set in UINavigationBarAppearance but icons, including the back indicator, continue using the accentColor. In the worst case, they become impossible to see (white icons on white background). If it is not possible to use UINavigationBarAppearance, is there another recommended way (or literally anything that works at all) to change the tint of images/symbols in bar button items between the scroll edge and standard appearances? Thanks, friends! :D
0
0
744
Sep ’20
iOS 14 Beta: SwiftUI List Selection: Does it work?
For the life of me, I cannot get List selection working in SwiftUI. From what I found, there are at least three different methods to handling this: Using tags, IDs, or NavigationLink Tag/Selection... though none of these are actively working as far as I can tell. Even in Apple's Fruta app: Selecting something from the List sidebar, hiding the sidebar, and then bringing it back will cause the selection to lose the highlight. What is worse is that under the hood the selection publisher is being fired in all kinds of random in the different scenarios. I made a sample project demoing the three different types of selection and they all fail in different ways: When using a List with both tags or an Identifiable object, the binding will only ever fire the first row's identifier (even when selecting other rows) and only a few times before only ever firing nil thereafter. When using NavigationLink(destination:tag:selection:), the proper selection is fired, but is always followed by two nil selections which clear the value from the source tracking selections. Here is a link to that GitHub project: https://github.com/Nemesisprime/Apple-Feedback-Projects/tree/main/BrokenSwiftUIListSelection I submitted some feedback about two weeks ago but haven't heard anything. :( Super bummed! Bugs like this are absolutely crushing because I can't really work around them. Is it me? I might be just using the selection stuff incorrectly because I can't find any great first party documentation either so any help would be appreciated.
2
0
1.7k
Jul ’20
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.5k
Jul ’18