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.
Post
Replies
Boosts
Views
Activity
There is no embedded.provisionprofile or anything similar anywhere in the app bundle. I even looked for hidden files.
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.
I want to duplicate this in my app.
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.
Thanks, the NSSplitViewController was what was missing. I notice from the help documentation (and the NS in the name) that this is part of AppKit. Am I correct in assuming that there is no native SwiftUI to accomplish this? Also, is there a similar way to show and hide a sidebar on the right side of the main window (i.e. an inspector panel)?
Thanks
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.
Thanks for the reply, but I am concerned about minimizing CPU usage.
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
Thanks, that worked for me.
Thanks
Thanks
This worked for me. Thanks
I like it as it gets rid of the optional. However, but that still requires that the property 'callback' in ModelDemo and the property 'modelDemo' need to be var's. If there was a way to do everything in the init(), they could be let's.