Post

Replies

Boosts

Views

Activity

Comment on Is there a way to Show Hide a sidebar with a button?
Thanks for the reply. I did manage to get a right side sidebar sort of working using a Split View. but I was unable to get it to animate opening and closing. Even with a .withAnimation on the toggle of the @State var, the view just popped in and out. Also, if the user resized the right side view once it was hidden and re-shown, it reverted to it's original width. It really seems to me that SwiftUI is designed for iOS apps and support for the things needed by MacOS apps was an afterthought.
May ’22
Comment on Is there a good reference for SwiftUI?
Thanks for the reply, but neither reference is what I'm seeking. For example, I navigated the Apple reference documentation down to Button, but there was no list of the valid view modifiers (such as .borderless) and how to use them. Tutorials are great, but you have to wade through a lot of stuff to get to the one code snippet that shows you what you need.
May ’22
Comment on Do I have to be a paid developer to develop MacOS programs for personal use?
Thanks for the reply. I'm guessing the culprit may be Gatekeeper, but unlike what it says on the support page, when I get the dialog "This program could harm your Mac," I haven't found any way to run the app other than recompiling it. It's especially a pain because I also run my apps on my MacBook Air and if an app fails to run when I'm away from my desktop, I can't recompile it right away.
May ’22
Comment on Are there application classes where UIKit is a better choice than SwiftUI?
I likely don't understand how SwiftUI works, but If I have several views (as separate structs) placed in a VStack in a superview and the data for one view forces it to change, SwiftUI will redraw that view, then it will redraw the superview. Won't redrawing the super view trigger rebuilding of all the sibling views? As for performance, I wrote an app that displays a map using MapKit and I notice that the map view seems to be constantly redrawing even when there are no changes. In some cases you can see the pin vibrating and the CPU usage was over 10% according to the Xcode monitor. A similar AppKit app copied from an online example showed no CPU usage once the map and pin are drawn.
Apr ’22
Comment on How does Swift's #if tag work?
Thanks for the link. One of the posts stated that Swift does not have a pre-processor. I had just assumed that #if was like #ifdef in C/C++ where the compiler never saw the code. One other thing. Many other IDE's allow you to display code that is #ifdef'ed out differently so you can tell which code will be compiled. It doesn't look like XCode does that with Swift's #if
Apr ’22