So is there any updated way to do this in iOS 15? baseColor and tintColor are deprecated so you can't set the baseColor to the image texture and the tint to a slightly transparent white anymore. I've gotten it to work to some extent with this code, but it's still not right.
...
let colorTexture = MaterialParameters.Texture(imageTexture)
var imageMaterial = UnlitMaterial()
imageMaterial.color = .init(tint: tint.withAlphaComponent(0.9999), texture: colorTexture)
It renders correctly with just the opaque parts of the image until you move and then it shows the transparent plane behind it, which would be fine if there wasn't any content behind it, but that's not very flexible. Here's what it looks like:
Using a SimpleMaterial doesn't help and leaves the image darker than it should be. Placing the icons in front of the background plane by 0.02-0.1 reduces the frequency of the effect but it can still happen. Additionally, 0.1 is way too far forward for many applications. What's the best way to fix this iOS 15? Do I just need to wait for iOS 16? Thanks.
Post
Replies
Boosts
Views
Activity
I'm having the same problem. My app would just freeze on a black screen on launch and would do absolutely nothing until I commented out all the .navigationDestination() calls.
I was able to hack around it by elevating the .navigationDestination() calls closer to the NavigationStack they're in. This obviously isn't ideal and doesn't allow for as easily passing data nested in a view, but it's working for me for now.
Maybe it was just my misunderstanding of the API in the first place and the navigationDestinations aren't supposed to depend on any data in the view presenting them other than what's passed in explicitly in the call. Most of my calls were just passing in the data for the View plus a binding to the NavigationPath, so it wasn't a problem to elevate them.
Hope this helps someone.
Very late reply, but I just had the font size as way too big so I couldn't tell I was walking around something so large. Font size for this function is hundreds of times bigger than a normal 2D font in SwiftUI or UIKit. So the answer is to use a font size like 0.1.
Yeah same problem. Mine is a continuous animation when enabled, so I just added a trigger and this method to make it work. Otherwise the app would just stall out and do nothing.
.onAppear {
trigger.toggle()
}
Same here. What may have caused it on my end is I had to update the app bundle ID of my app so I renamed the original app to a different name and created a new app on App Store Connect with the original name but a new app bundle ID. Not sure if it's related, but thought it might be.
I'm still seeing this issue. I'm already using an SSH key for GitHub auth so I don't think that was it. Looks like if I just wait, Apple might resolve it though.
Update: It's working now