Post

Replies

Boosts

Views

Created

SwiftUI TextEditor on Mac, spell check weirdness
I think I'm misunderstanding something here, maybe someone could point me in the right direction. In System Settings, "Correct spelling automatically" is DISABLED, along with all the other options that ruin what you're typing. In TextEdit, it continues to highlight spelling and grammar mistakes, so does Mail, Safari and others. Yet SwiftUI made apps, don't. I can right-click, enable "Check Spelling while typing", but after typing a few characters, words, it becomes disabled again. I've busted through the view hierarchy to get the hosted NSTextView and overridden "isContinuousSpellCheckingEnabled" but something frequently reverts this to false. Is my only option to have a large TextEditor with spell checking (but not auto correction) to create my own version of TextEditor by hosting the NSTextView myself. That's a lot of work for something which seems wrong, when I'm hoping that I'm simply missing something here. Xcode 15.2 on macOS 13.5.
1
1
719
Jan ’24
SwiftUI on Mac, Deficiencies with Text Editing
SwiftUI on macOS does so many things in way that I really love it, but it feels like I've run into an area that no-one at Apple seems to care about. Text Editing In order to get a TextEditor that could use the built-in Spelling & Grammar checking (without enabling Autocorrect), I had to host a NSTextView, which was an interesting experience for someone with only a few months of SwiftUI experience. The default menu items "TextEditingCommands()" don't reflect the fields settings. The menu items do change the settings, but consistently show all the options as being unsellected. I'd like to know if there's a secret sauce I'm missing that would enable these menuitems to reflect the settings of the focused field, or if like the TextEditor, these items need to be recreated and replaced to work as expected. I understand that saving and reloading the settings per field is up to the individual developer, but it would be great if there is an over writable template that could handle this by default.
0
0
464
Jan ’24
SwiftUI macOS, Multiple DocumentGroups is missing something.
Adding a second "DocumentGroup" to a document based SwiftUI auto converts the "New" menu item into a submenu, with one item "New Document". I'd like to add a second item to that submenu, to create a new instance of my second doc type. Googling around finds one solution, but that doesn't work as I'd expect it to with Ventura 13.6.5 and Xcode 15.2. The solution linked to below, adds a menuitem under the "Open Recent" menu, not in the "New" submenu. https://github.com/Asperi-Demo/4SwiftUI/blob/master/Answers/Handle_different_document_types.md Changing the position to "before", also doesn't add it to the menu, and if you replace ".newItem", you then have to manually handle the Open dialog and the Open Recent menu. So what am I missing?
1
2
600
Mar ’24
macOS 14.4.1 borked or locked system log --stream
To help with debugging on a customers machine, this terminal command records log entries for my app and writes 'em to disk. log stream --predicate 'process=="Sleep Aid"' --style compact > ~/Desktop/Sleep\ Aid.log In my app I have a function that does something similar to the above with a NSTask, and then I ask the customer to repeat the action that causes the problem. However for one customer, the file is created, but apart from it saying it's being filter by process, nothing else is written. Is there some new security setting that can prevent an app from getting its own logging data, or in this case even prevent the customer from using terminal and the above command to get the log data? This is similar also. https://forums.developer.apple.com/forums/thread/743803 Or should I be filing a radar about a potential bug?
2
0
761
Apr ’24