Skip to main content

All Questions

Tagged with
0 votes
1 answer
37 views

NSWindow with SwiftUI content has zero frame on macOS 15

As title says. I create a window as such: onboardWindow?.setFrame(.init(x: 0, y: 0, width: 600, height: 400), display: false) Then, when it's time to show: let contentView = WelcomeView() let ...
Vojta Böhm's user avatar
1 vote
1 answer
310 views

Simulating Fn + Control + arrow key events ignores Fn

I want to simulate the pressing of Fn (Globe)+Control+Right Arrow, but I’m encountering an issue where the Fn modifier seems to be ignored, and the system behaves as if only Control+Right Arrow is ...
Tzar's user avatar
  • 4,779
0 votes
0 answers
42 views

NSHostingView inside table cell view isn't automatically updating row height

When adding a constraint NSHostingController view to a table cell view, the row height isn't automatically adjusted to fit the SwiftUI views content thought I activated usesAutomaticRowHeights on my ...
Florian Karimkhan-Zand's user avatar
0 votes
0 answers
93 views

macos background app SwiftUI TextField copy paste not working

I have this Form with two TextField's. When I attempt to use the copy paste shortcuts (CMD + C, CMD + V) within each TextField, I hear the typical macOS system interrupt sound, with no changes to the ...
N.K.'s user avatar
  • 482
-1 votes
1 answer
58 views

NSWindow is super tiny

I have a simple SwiftUI code to start a small NSWindow, like given below. However when the window appears, it's super small and ignores the minsize. ... Button("Test Window") { let window ...
Karl Ehrlich's user avatar
1 vote
1 answer
39 views

`NSTask.run()` fails with `The operation couldn’t be completed. Permission denied`

I am trying to open a text document from within my SwiftUI app on macOS. Unfortunately, I get the error The operation couldn’t be completed. Permission denied. How can I work around this? I tried with ...
appfrosch's user avatar
  • 1,346
0 votes
0 answers
59 views

SwiftUI Window not draggable

I made a custom AppDelegate which should remove the window toolbar and add a corner radius of 10px which all works very well hoeever now, you can't drag the window around. I am also very new to AppKit ...
Karl Ehrlich's user avatar
0 votes
0 answers
51 views

`NSWorkspace.open` fails with error `The application “TextEdit.app” could not be launched because a miscellaneous error occurred.`

I am trying to use NSWorkspace.open(_:withApplicationAt:configuration:completionHandler:) to open the currently open document in my document based SwiftUI app. Clicking on the button shown in the ...
appfrosch's user avatar
  • 1,346
2 votes
1 answer
43 views

NSPanGesture not working on AppKit but UIPanGesture works on iOS (Multiplatform App)

I found an old SwiftUI library that I've attempted to port to MacOS. You can find the full repo here: https://github.com/cyrilzakka/SlidingRuler. Essentially it's a sliding ruler with ticker ...
cyril's user avatar
  • 2,985
2 votes
1 answer
130 views

SwiftUI TextEditor bound to $[Note].content — slow performance?

I'm building simple text editor, which can handle several opened files. I have NotesManager, which stores all opened documents, and I pass binding to each of these notes to views using NavigationLink. ...
f1nn's user avatar
  • 7,037
0 votes
0 answers
75 views

Enabling Scrolling And Zooming in View

I have a SwiftUI view with a grid of squares. I'm able to zoom in and out of the squares by holding the command key down and using my mouse scroll view. I can't currently, however, scroll vertically ...
narner's user avatar
  • 3,221
0 votes
1 answer
78 views

Find bar is not working when using NSTextView in SwiftUI

I'm attempting to add a Find bar to an NSTextView within a SwiftUI view, but despite setting the necessary properties (usesFindBar, usesFindPanel, isIncrementalSearchingEnabled), the Find bar doesn't ...
rizwana desai's user avatar
1 vote
1 answer
313 views

How to create a full screen overlay cover on macos using swift?

does anyone know how can I make this view cover the full screen without entering full screen mode? Essentially I just need to get this window to cover the top area where the menu bar is. I have tried ...
N.K.'s user avatar
  • 482
1 vote
0 answers
232 views

How to open Settings from menu bar app and show app icon in dock?

I'm creating macOS menu bar app in SwiftUI and I want to add settings. Currently I have two problems: SettingsLink does open settings app, but if it's already open then it won't bring it to front ...
graduationchampion's user avatar
2 votes
1 answer
182 views

Is there a way to determine if any text input was active in a MacOS app after the app was backgrounded?

MacOS specific but maybe iOS related responses could get me on the right track as well: I need to determine wether there was any text input (swiftUI text field, NSTextField) active app wide when the ...
Tudor Andreescu's user avatar

15 30 50 per page
1
2 3 4 5
10