Posts

Post marked as solved
1 Replies
891 Views
Does anyone know how to have the Undo command in the menu bar enable when CoreData UndoManager has items to undo? Here’s what I’ve done: At app init I’m setting the Core Data PersistanceController UndoManager() persistenceController.container.viewContext.undoManager = UndoManager() I can confirm the CoreData undoManager is set because I can programmatically call undo and it works (for instance after deletion) HOWEVER the Undo command in the menuBar remains disabled. As a side-note, the Undo command in the menuBar works correctly when I’m writing text in a TextField (it does automatically enable to undo text changes). Huge thanks in advance, been trying things for a while and can’t find anything online
Posted
by MarcMV.
Last updated
.
Post not yet marked as solved
1 Replies
686 Views
By default, on a macOS app using SwiftUI the window size is not restored after the window is closed. Is there a way to keep whatever size & position the user gave before closing the app. Essentially I'd like close & open to behave in the same way to when the user quits & opens the app? Is there something that should be added here? import SwiftUI @main struct testApp: App { var body: some Scene { WindowGroup { ContentView() } } } Thanks in advance!
Posted
by MarcMV.
Last updated
.
Post not yet marked as solved
0 Replies
1.2k Views
When trying to add search to my app I get the warning "Return from initializer without initializing all stored properties" due to my Binding. But seems to me I'm doing exactly what the video is doing:     @Binding var searchableText: String Thoughts?
Posted
by MarcMV.
Last updated
.
Post not yet marked as solved
1 Replies
694 Views
I have an application that processes certain types of files (like xml, opml, etc.). To make the "Copy to [myApp]" option appear in the Open in menu I've added the following in Info.plist:<key>CFBundleDocumentTypes</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.xml</string> </array> <key>UTTypeDescription</key> <string>OPML</string> <key>UTTypeIconFiles</key> <array/> <key>UTTypeIdentifier</key> <string>org.opml.opml</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>opml</string> </array> </dict> </dict> <dict> <key>CFBundleTypeName</key> <string>XML</string> <key>LSHandlerRank</key> <string>Alternate</string> <key>LSItemContentTypes</key> <array> <string>public.xml</string> </array> </dict> </array>This works like a charm and I'm able to process the files normally.Now I'm trying to show the same option when clicking the "Open In" option in Safari, the idea is than when you click my app I'll get the URL from Safari. I've tried many options, including adding code in the plist saying the app can open all file types with no luck.Really appreciate your help.MarcReference:https://stackoverflow.com/questions/45067210/ios-app-which-handles-urls-is-not-showing-up-in-open-in-menu-eg-in-safarihttps://www.reddit.com/r/iOSProgramming/comments/6mxlgd/app_not_showing_up_in_open_in_menu_eg_in_safari/https://stackoverflow.com/questions/9266079/why-is-my-ios-app-not-showing-up-in-other-apps-open-in-dialog
Posted
by MarcMV.
Last updated
.