Post

Replies

Boosts

Views

Activity

Dropping URL itemProvider from app to desktop creates a copy instead of moving it.
I register a file representation on my dragItem's Itemprovider like the following:  provider.registerFileRepresentation(forTypeIdentifier: itemTuple.uti, fileOptions: .openInPlace, visibility: .all, loadHandler: { (completion: ((URL?, Bool, Error?) -> Void)) -> Progress? in                 let fileCoord = NSFileCoordinator(filePresenter: nil)                 var fileError: NSError?                 let progress = Progress(totalUnitCount: 1)                 progress.completedUnitCount = 1                 fileCoord.coordinate(writingItemAt: url, options: [.forMoving], error: &fileError, byAccessor: { [fileError] fileURL in                     if let error = fileError {                         completion(nil, false, error)                         progress.completedUnitCount = 1                     }                     completion(fileURL, true, nil)                     progress.completedUnitCount = 1                 })                 return progress             }) When I drop the thumbnail onto the desktop a breakpoint on line 14 is called, but finder creates a Copy. I've created the fileCoordinator with .forMoving. I've registered the file representation with fileOptions: .openInPlace I'm also responding with true in public func collectionView(_ collectionView: UICollectionView, dragSessionAllowsMoveOperation session: UIDragSession) -> Bool Is there something else I'm missing for finder to consider this a moveable file URL?
0
0
583
Sep ’20
Remove App Clip target on Catalyst builds only?
I'd like to continue catalyst development, but I've added an AppClip target to my project. It appears that Xcode is complaining that the framework being embedded into the AppClip is getting built for Catalyst, when it would prefer "iOS". error: Building for iOS, but the embedded framework 'ViewKit.framework' is building for Mac Catalyst. You may need to configure 'ViewKit.framework' to build for iOS. (in target 'Clip' from project 'overview') Since AppClips can not run on Catalyst is there a configuration spot in Xcode build settings to conditionally remove a target? The clip is already "unchecked" for mac on the general page's deployment info checkboxes.
2
0
1.3k
Sep ’20
Funky State While Debugging - Restart Required?
After several TestFlight / Xcode deploys to my device to debug memory pressure issues I got into a state where my app's WidgetExtension would not launch at all. (It did not appear in the "Attach to process" debug list.) Uninstalling and reinstalling did not fix it. Only rebooting the device was able to shake out the gunk. I'm concerned that there may be a bug here, either in my widget extension or in the framework but I'm not sure what's expected and what's not. Anyone else run into restart-required states when testing on hardware?
0
0
501
Sep ’20
Are Local Experiences Functioning in beta6?
What I've done: Configured a local experience to point to "https:/example.com" (removed a slash to allow post) Configured the local experience with the App Clip's bundle ID Installed my App Clip via test flight, and see it visible in settings. Created a QR Code with the url mentioned in bullet #1. What I encounter: When I scan the QR code, I see that the camera app present a notification to open the URL in safari. What I expect: This should instead show the AppClip or AppClip card, correct? Anyone else get this working? I've seen some blog posts but they're all mentioning beta5. I don't know if there's been a regression or just a behavior change.
21
0
4k
Sep ’20
Multiple AppClips on a single domain?
Can a single domain direct the user to different app clips depending on what page the user is on? Scenario: portfolio.com/OrrangesApp portfolio.com/BananasApp Each of these pages can have separate <meta> tags for displaying different banners for different Apps/AppClips. That part makes sense to me. I'm curious how this would look in the AASA file. The file must state: "appclips": { &#9;&#9;&#9;&#9;"apps": ["ABCED12345.com.example.OrangesApp", "ABCED12345.com.example.BananasApp"] &#9;&#9;} How do I direct the OS to a different clip based on a different URL path? Is that fulfilled through the the AppStoreConnect configuration? I was under the impression we had to match the URL with the AASA, but I'm suspecting that only applies to the domain? Am I on the right track, here?
2
0
1.5k
Sep ’20
URL Bookmark Data no longer resolves after iOS13 -> 14 update.
After updating to iOS14, I notice that security scope bookmarks that I persisted on iOS13 no longer resolve. These bookmarks were pointing to directories in my iCloud Drive. These directories still exist after updating. An example URL on iOS 14 is: file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Pictures/Archive/Digital/ I create bookmarks via: try bookmarkData(options: [], includingResourceValuesForKeys: nil, relativeTo: nil) I resolve these bookmarks via: try URL(resolvingBookmarkData: data, options: [], relativeTo: nil, bookmarkDataIsStale: &bookmarkDataIsStale) Is there a specific technique required to create and resolve bookmarks after an OS upgrade?
3
0
1.7k
Aug ’20
NSToolbarItem's with Dropdown Menus?
I've tried a few things to get dropdown menus working on my Catalyst toolbar. let barButton = UIBarButtonItem(systemItem: .add, primaryAction: UIAction(title: "Add", handler: { [weak self] _ in ... }), menu: menu) let addItem = NSToolbarItem(itemIdentifier: .addItem, barButtonItem: barButton) Even tried adding an itemMenuFormRepresentation, but no dice. addItem.itemMenuFormRepresentation = AppDelegate.newMenu Has anyone got this working on Big Sur?
3
0
1.8k
Aug ’20
Proper way to consume a reorder transaction?
I'm trying to digest the reorder transaction of an outline style collectionViewList where each section includes a header as its first item. After the user performs the reorder I need to apply the transaction information to my data which is stored in core data. (It's an entity that contains a relationship to many instances of the same type - Parent + child) When I reorder rows I see the following: Moving rows within a section: The transaction includes a sectionTransaction with no inserts or deletions. (Odd?) The transaction itself includes a difference which in turn includes the removal and insertion changes of the dragged item. Nice! Problem: The "Offset" included in the Insert change is strange. If I drag an item to the top of my section, the insertion offset is "5", which is unexpected. What is this offset relative to? It does not seem relative to the section's children. Is the section transaction not intended to describe that? Moving Rows Between Sections: I'm getting similar results here. If I take an item form a lower section up to the first section I'll get an offset of "9". Despite expecting an offset of 1 relative to the destination section's top row (because the header is item 0). I guess I'm mostly curious how I should be interpreting this transaction info. I'd prefer not to reconstitute my whole core-data store from the "final snapshot" that's available as part of the transaction.
1
0
512
Jul ’20
overrideUserInterfaceStyle not effecting Toolbar in Catalyst?
I'm giving my users a way to configure the dark mode style of an application. I achieve this by setting the overrideUserInterfaceStyle property of the windows on every WindowScene of the application. This works on iPad and iPhone, but on Catalyst the toolbar area of the window does not change style. It's always the same as the system. Is there a different technique required to change the interface style of a Catalyst application?
3
0
1k
Jul ’20
Drag-and-Drop Between Finder and App - Copy Only?
AppKit Observations When I drag files (like images) from Finder into an AppKit app I receive a URL and can perform "Move" operations with the file. Likewise when items are dragged from my AppKit app, Finder proceeds to "move" them. I've rewritten the app in iOS to support iPad and iPhone and Mac and this behavior seems very different with Catalyst apps. Catalyst Observations Items dragged include a URL Itemprovider. They don't seem to be getting "moved" when dropped into Finder or the desktop. Instead they are being copied. I believe I'm specifying "allows move". This works as expected with an AppKit App dropping URL ItemProviders into Finder/Desktop. When I drag an image file into the app, I do not receive a URL for the image. Just an "image.jpeg" Item provider. My App acts as an organizational tool, so the ability to move files between folders on disk is inherent to the application and a pretty important feature. Is this possible in Catalyst? If not, what's the best way to file a serious feature request for this?
0
0
813
Jul ’20
Drop file from Finder -> "com.apple.finder.node" identifier?
I'm dropping an image file from Finder into my catalyst application on 10.15. "Allows move" is set to true on the drag session, but when I inspect the item providers there are no file URLs present to perform a move operation. I see an item provider with an identifier of type "com.apple.finder.node", but I'm not sure what object I can decode that into. Are move operations for files into catalyst apps not supported? This works in appkit.
0
0
440
Jul ’20
Replace ViewControllers in Column?
I've got a doubleColumn UISplitViewController and I'd like to retain the automatic behavior of the Collapse/Expand Primary Column button. To this end, I'm not specifying my own UINavigationController for the .secondary column position. There are moments in my app's run time that I would like to replace all of the view controllers in the .secondary column. setViewController appears to push an additional controller onto the nav stack. Is there an API available to replace the controllers with a new set?
1
0
462
Jul ’20