Posts

Post marked as solved
13 Replies
11k Views
I would like to create a macOS app without using Interface Builder.How must the Xcode macOS app template be modified after deleting Main.storyboard and its corresponding Info.plist lineto show a single simple window at startup?
Posted Last updated
.
Post marked as solved
2 Replies
1.3k Views
Hi, in my app the user can choose between a light and a dark appearance. This is done by setting the overrideUserInterfaceStyle of the window. On macOS (Catalyst) the app uses an NSToolbar, which always appears in the mode set for the system, regardless what ist set for the overrideUserInterfaceStyle of the window (see screenshot). Since this is not a good visual impression, I would like to know how I can set light/dark mode for the NSToolbar too.
Posted Last updated
.
Post not yet marked as solved
0 Replies
1.6k Views
Hi everybody,in my app I would like to provide the ability to copy files stored inside the app to the Files app or the Finder in macOS using Catalyst.On iOS, everything works fine with the following code: if let provider = NSItemProvider(contentsOf: url) { provider.suggestedName = pdfFilename UIPasteboard.general.url = url UIPasteboard.general.itemProviders = [provider] }But on macOS this doesn't work, if I execute this code I get the messages:[sandbox] CreateSandboxExtensionData failed: url null[general] Sandbox extension data required immediately for flavor public.file-url, but failed to obtain.Does anyone have an idea what I have to do here?
Posted Last updated
.
Post not yet marked as solved
0 Replies
866 Views
I am using SF Symbols as images for the tabs in my app, but they aren't positioned correctly.If I useself.tabBarItem.image = UIImage(systemName: "ellipsis")the ellipsis image is top-aligned in the tab.What do I have to do to get a vertically centered image?
Posted Last updated
.
Post marked as solved
2 Replies
1.4k Views
I have a problem with using UIAlertController in my apps built for UIKitForMac: If I press the "OK" button in the box displaying the message, the app crashes with an "-[__NSArrayM objectAtIndexedSubscript:]: index 0 beyond bounds for empty array"exception like this:2019-06-09 18:47:35.613479+0200 macalerts[3018:179110] [General] *** -[__NSArrayM objectAtIndexedSubscript:]: index 0 beyond bounds for empty array2019-06-09 18:47:35.613566+0200 macalerts[3018:179110] [General] ( 0 CoreFoundation 0x00007fff3a56fc63 __exceptionPreprocess + 250 1 libobjc.A.dylib 0x00007fff6fa3806b objc_exception_throw + 48 2 CoreFoundation 0x00007fff3a62f12a _CFThrowFormattedException + 202 3 CoreFoundation 0x00007fff3a504f4a -[__NSArrayM objectAtIndexedSubscript:] + 142 4 UIKitCore 0x00007fff768389d9 __48-[UIAlertController(iOSMac) _createBridgedAlert]_block_invoke_2 + 75 5 libdispatch.dylib 0x00000001003849b3 _dispatch_call_block_and_release + 12 6 libdispatch.dylib 0x000000010038598f _dispatch_client_callout + 8 7 libdispatch.dylib 0x000000010039583a _dispatch_main_queue_callback_4CF + 1865 8 CoreFoundation 0x00007fff3a4becaa __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 9 CoreFoundation 0x00007fff3a4be3e8 __CFRunLoopRun + 2370 10 CoreFoundation 0x00007fff3a4bd821 CFRunLoopRunSpecific + 499 11 HIToolbox 0x00007fff3919d7fd RunCurrentEventLoopInMode + 292 12 HIToolbox 0x00007fff3919d53d ReceiveNextEventCommon + 600 13 HIToolbox 0x00007fff3919d2c7 _BlockUntilNextEventMatchingListInModeWithFilter + 64 14 AppKit 0x00007fff3784ccf8 _DPSNextEvent + 990 15 AppKit 0x00007fff3784ba6b -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352 16 AppKit 0x00007fff378461b7 -[NSApplication run] + 658 17 AppKit 0x00007fff3783804b NSApplicationMain + 777 18 AppKit 0x00007fff37cbc022 _NSApplicationMainWithInfoDictionary + 16 19 UIKitMacHelper 0x00007fff6a599ef9 UINSApplicationMain + 424 20 UIKitCore 0x00007fff765bea91 UIApplicationMain + 2206 21 macalerts 0x0000000100002b6b main + 75 22 libdyld.dylib 0x00007fff70d967a9 start + 1)This even happens when I "isolate" the problem in a simple single view app where I bring up a UIAlertController in viewDidAppear like this: override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) let ac = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) self.present(ac, animated: true) }Does anybody know ho to solve this?
Posted Last updated
.
Post not yet marked as solved
1 Replies
4.2k Views
I'm writing an app which provides several different color themes.It would be great to change the app icon and the launch image according to the active theme.I know an app may have several alternate app icons - but what about launch storyboards?Is it possible to use different storyboards, or is it possible to dynamically modify the launch storyboard in some way,for example changing the tint color of some of its views?
Posted Last updated
.
Post not yet marked as solved
1 Replies
954 Views
I would like to share entries from my diary app including their timestamps.I tried to use a Date object as an item in UIActivityViewController, but this seems to have no effect.Does anybody know how to do this?
Posted Last updated
.