Same issue here. Regenerated package.resolved, updated package versions, reset cache, reset schemes, added another dependency still having this issue. Don't have this issue with another application using Xcode Cloud.
Post
Replies
Boosts
Views
Activity
I was able to do this NOT in SwiftUI but with AppKit finally haha. My issue was that isNavigational was enabled which cancels the functionality to have it be in the sidebar. Just use sidebarTrackingSeparatorItemIdentifier
Unable to do this with MacOS alone it seems
Alrighty, I think I've got a temp fix. I think the problem is that when initiated a view somewhere in the hierarchy of SwiftUI with LazyVGrid doesn't recognize those AppKit elements but then does once refreshed. So to refresh, flipping the view helps, but it has to be done 2 times to get it back to normal 😆. Not sure if the have to be positioned on a specific view but add the following extension.
extension View {
public func flip() -> some View {
return self
.rotationEffect(.radians(.pi))
.scaleEffect(x: -1, y: 1, anchor: .center)
}
}
Here is my view implementation
VStack(alignment: .trailing, spacing: 0) {
ScrollView {
ScrollViewReader { reader in
ZStack {
Rectangle().foregroundColor(.blue)
ListView()
}
}
}.flip()
.flip()
}
And cross your fingers it works.
To my knowledge AppDelegate is the only way for now, place it in you App file as a var like so
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
Settings {
}
}
Then have your window class
class AppWindow: NSWindow {
init() {
super.init(contentRect: NSRect(x: 0, y: 0, width: 480, height: 300), styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], backing: .buffered, defer: false)
makeKeyAndOrderFront(nil)
isReleasedWhenClosed = false
styleMask.insert(NSWindow.StyleMask.fullSizeContentView)
title = "title placeholder"
contentView = NSHostingView(rootView: ContentView())
}
}
SwiftUI is a Framework as stated here - https://developer.apple.com/documentation/swiftui. And also everything Jake said. You'll need the new Xcode for these things.
Apple documentation includes this information with version support noted. Look at this example: https://developer.apple.com/documentation/swiftui/lazyhgrid The information is on the right-hand side.
You need to be running macOS. Download Xcode from the Mac App Store. It's the IDE Apple uses. Once you get that done run it and start a new project. There's numerous resources just from a google search, search something like "make swift apps". Fair enough?