Thanks for filing a radar, the docs missing definitely seems like a bug. I wouldn't expect the new SwiftUI tutorials, but I think Button.onTapGesture, etc., should be there.I use the Xcode Developer Documentation sometimes too, since it can be faster to look things up. I probably ran into this and just thought the docs didn't exist 😮.
Post
Replies
Boosts
Views
Activity
SelectionShapeStyle (macOS only) is not usable, since it has no public initializers.Bug Report: FB7511755
I think it's just your brackets.You should have one more on the `var body` block, and one less on the `PreviewProvider` block.
No problem, happy to help!
Sorry, the issue is the icons will not show up, no matter the order of the Image/Text, or format of the Image() in the .tabItem{}. I've tried using .PNG files of size 32x32px, per the macOS Human Interface Guidelines (https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/custom-icons/).I'm looking to create a TabView with the "Freestanding Toolbar Icons" like you would get using NSTabViewController.TabStyle.toolbarIs this a known limitation or a SwiftUI bug? If it's a limitation, and a "text segmented control style" is the only possibility on macOS, I think .tabItem{} should only accept Text on that platform.
This appears to be fixed in Xcode 11.4.1. The release notes in feedback assistant say:Swift PackagesResolved IssuesFixed an issue where an error like "Swift package product A is linked as a static library by B and C. This will result in duplication of library code." was incorrectly emitted if an app and an embedded app extension or helper tool statically linked the same package product. If you previously set the DISABLE_DIAMOND_PROBLEM_DIAGNOSTIC build setting to work around this issue, you can delete this setting now. (59310009, 61227255)
I wish the communication from Apple was better about things like this. Do I ask about this bug in the SPM section of the Swift.org forums? Probably not, I'd be told that Xcode issues should be posted here. But then nothing really happens. I wish we could just tag teams like @Xcode @SPM to get their attention about issues like this.Another gripe is that the Xcode 11.4.1 release notes inside the Mac App Store just say "Bug fixes and stability improvements". Why don't they at least mention to check the Feedback Assistant for the full release notes? Since the release notes in the App Store were empty, and the new iPhone SE was released that day, I figured Xcode 11.4.1 was just to add the iPhone SE simulator. It was luck that I tried compiling the project again - and dug deeper looking for actual release notes.I just feel like this could have easily been resolved before Xcode 11.4 was even released if we had a better way to communicate with people working on these tools.Anyway, thank you to everyone who offered workarounds.
Incase someone stumbles upon this, there are now design resources for all of the platforms: https://developer.apple.com/design/resources/
The macOS 11 beta UI appears to be macOS 10.15 (Catalina) UI though. Hopefully it's updated soon.
After looking more closely at https://developer.apple.com/forums/thread/651547 I realized I didn't rename or delete the default struct {Package Name} created by Xcode. After doing that, previews work on iOS/tvOS. Unfortunately they are still broken on macOS. I also tested macOS 11, with the same results.
The error is still the same, something about how it can't attach to the process:
HumanReadableNSError: connectToPreviewHost: Failed to connect to 4083: Error Domain=com.apple.dt.ProcessAttachUtilities Code=0 "Failed to get task for pid 4083: 0" UserInfo={NSLocalizedDescription=Failed to get task for pid 4083: 0}
com.apple.dt.xcodepreviews.service (17):
The video materials look pretty interesting, but they look a lot more effort to create (for a developer anyway) than shaders, and less powerful. I'm happy it's something dynamic though.
I really wish RealityKit had shaders and a particle system. The Entity-Component (and other APIs) are so nice, I'd love to use it for non-AR and possibly AR. But without those features, it doesn't quite match what SceneKit can do.
I'll file feedback requesting the features, and hopefully others will too.
Stumbled upon this question, but I've noticed other stuff is using 10.16. Just wanted to mention in case this is blocking you.
I'm still having this issue with macOS SwiftUI previews in Swift Packages. Running Xcode 12 Beta 2, macOS 11 Beta 2.
I'm also waiting for this functionality. It's a little worrisome we're at Beta 5 and this hasn't appeared though. I don't see the example you mention in the headers, which makes me worry they removed it?
The release notes say this is fixed now.
Claude31, thanks for that idea. It does seem that I can use the following code to hide the New Window menu item:
.commands {
CommandGroup(replacing: CommandGroupPlacement.newItem) {
}
}
Unfortunately this affects my other scenes/windows, one of which is using DocumentGroups, and needs that menu option. I've also noticed that I can't seem to customize commands per-scene/window. The last .commands block I supply is used regardless of what Scene I apply it to.
This was fixed in Xcode 12 beta 5.