You can use the toolbar(_:for:) modifier on your sidebar view like this: .toolbar(.hidden, for: .navigationBar). You can find details in the documentation here.
Here's the resulting view:
struct SomeView: View {
var body: some View {
NavigationSplitView(
columnVisibility: .constant(.all),
sidebar: {
Text("sidebar")
.toolbar(.hidden, for: .navigationBar)
},
detail: { Text("detail") }
)
.navigationSplitViewStyle(.balanced)
}
}
The first argument sets the visibility, and the second arguments specifies which bar to hide (which in your case is .navigationBar).
Post
Replies
Boosts
Views
Activity
Try .scrollContentBackground(.hidden) in combination with .background(.black).
scrollContentBackground(_:) is a new modifier introduced last year. You can find the documentation here.
There is a Metal TensorFlow Plugin available, which accelerates model training using your Mac's GPU.
@Claude31
Equivalent closure:
{ newvalue in
if newValue == true {
self.isOn = .myTrue
} else {
self.isOn = .myFalse
}
}
If it helps, think of everything that comes after the equal sign as a separate expression, like { newValue in self.isOn = (newValue ? .myTrue : .myFalse) }
Hello,
Just want to add that forward slashes are also affected by this (they look HTML encoded), in case this wasn't known already.
/ is transformed into / when placed inside inline code
here's an example: /
Maybe an iPad with Swift Playgrounds would help, if there's any available.
I think I found a hint to the issue. It seems that I can't reply on any thread with the WWDC20 tag. Maybe threads with this tag are "locked" for non Apple-person accounts, since WWDC20 ended...
That's interesting! Perhaps the email system doesn't use the same method to replace certain characters with HTML entities.
I guess that shouldn't be a concern from a security point of view, unless tags like these do anything to the email (they obviously shouldn't).
I think we need more details about this issue. Code snippets might help. To me, the diagnostics log says it may be related with your View's previews...
Try to trace the issue and find what part of your code is causing it. You can undo each modification you made until you reach the state in which it works.
Ok! Is your issue fixed now?
If your issue is fixed, maybe you can place this info in a new reply and mark it as correct, so others who have similar issues find this thread.
Good luck with your submission!
The Resources folder should be automatically created when you add a resource file such as a sound file, or a CoreML model, and you don't need to modify the Package.swift file. To add files to your Resources folder, you can drag and drop them or go to File > Add File, and select your resource.
If your question is how to add another folder that works as a resource folder, you can add it in the resources part of Package.swift like this:
targets: [
.executableTarget(
name: "AppModule",
path: ".",
resources: [
.process("Resources"), /* don't forget the comma */
.process("OtherFolder") // the folder you want to add as a resources folder (replace OtherFolder with the desired name)
]
)
]
If you're asking how to edit the Package.swift file, I'm not sure if you can open it in Playgrounds. On macOS, you can right click on the App Playground > Show In Finder to get to its location, and then right click > show contents on the app to see the its files, including the Package.swift file.
To use your resource files, you need to use something like let url = Bundle.main.url(forResource: "ResourceFile", withExtension: "txt") in combination with something else, depending on what you want to use it for.
This is yet another test reply per the same thread mentioned by eskimo and justkwin.
For me, it works now. I successfully replied to the thread.
Hi! It seems that App Playgrounds require support for iOS 16.0 on this version of Xcode (not sure if this is a bug or intended for compatibility reasons). Even though you want to run your app on an iOS 17.0 device, the App Playground is set to build for iOS 16 devices too, and this is why your build fails (remember, to run a code it must first be built, and building requires your code to work on all devices it is configured for, not just on the one you use to test it).
You should've received some relevant error messages and fixes that mention the if #available version check or the @available(iOS 17.0, *) attribute. These may be useful If you want to maintain the iOS 16 compatibility. This is analogous to changing the minimum iOS deployment version in an .xcodeproj.
You could use the if #available version check like this:
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
if #available(iOS 17.0, *) {
ScrollView {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("iOS 17.0")
}
.defaultScrollAnchor(.bottom)
} else {
ScrollView {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("iOS 16.0")
}
}
}
}
}
Or you could add the @available(iOS 17.0, *) attribute to the enclosing View like this:
import SwiftUI
@available(iOS 17.0, *)
struct ContentView: View {
var body: some View {
VStack {
ScrollView {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
}
.defaultScrollAnchor(.bottom)
}
}
}
And then, in the App struct, use the if #available version check:
import SwiftUI
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
if #available(iOS 17.0, *) {
ContentView()
} else {
// Fallback on earlier versions
Text("This feature requires iOS 17.0.")
}
}
}
}
Now, if you want a "hacky" method, you could edit the package files of your App Playground. To do this, go to File > Show in Finder, and then open the Package.swift file. After that, you can change the .iOS("16.0") line to 17.0.
Also, I recommend you to use the latest Xcode version & macOS (they bring bug fixes and security improvements 😁).
Good luck and Happy New Year!
Hi and happy new year!
The error indicates that the file wasn't found - the app usually searches the file inside the Resources folder.
I am not sure if moving it inside the Resources folder inside GamePlayground would work. If it doesn't, try adding the scene again so that a "global" Resources folder is created (either drag & drop the scene or click the plus button in the bottom left.