I've noticed that every SKEmitterNode added to a scene increased the draw call count. Even if the emitter node is used the same texture from a texture atlas. Is there a method for batching mutliple emitter nodes that use the same texture? The use case is that I am attaching an emitter node to bullets.
Post
Replies
Boosts
Views
Activity
Im using a TabView and have noticed that 75% the time when switching tabs that there is at least 1 frame where before the expected view is drawn. That is quite annoying. Its not really noticeable if your views are super lightweight, otherwise you'll see what looks like a flash when switching tabs.Here is a very basic example. I've set the background of the tabview to blue to illustrate the problem. When switching tabs you will see the blue background of the TabView before the expected view is drawn. Nothing more than a form with 5 basic rows.import SwiftUI
struct ContentView: View {
@State private var selection = 0
var body: some View {
TabView(selection: $selection) {
Tab()
.tabItem {
Text("FIRST")
}
.tag(0)
Tab()
.tabItem {
Text("SECOND")
}
.tag(1)
}
.background(Color.blue)
}
}
struct Tab: View {
var body: some View {
List {
HStack {
Image(systemName: "gear")
Text("Advanced")
}
HStack {
Image(systemName: "gear")
Text("Advanced")
}
HStack {
Image(systemName: "gear")
Text("Advanced")
}
HStack {
Image(systemName: "gear")
Text("Advanced")
}
HStack {
Image(systemName: "gear")
Text("Advanced")
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}https://www.youtube.com/watch?v=7uDU2xyz-uc
I am unable to add package dependency. Everything seems to load and resolve fine, but when I get to the bit where you are asked to "Choose package products and targets" The Package product is selected, but the "Finish" button is disabled....
Im on a DTK system and the project is a new project using the App lifecycle.
Ive also tried other adding other dependencies with no luck.
I have a simple widget with a LazyVStack containing a foreach. The preview crashes, but when I run the widget on device it works.
I get the following error when trying to use LazyVStack.
RemoteHumanReadableError: Failed to update preview.
The preview process appears to have crashed.
Error encountered when sending 'fetchTimeline' message to agent.
==================================
| RemoteHumanReadableError: The operation couldn’t be completed. (BSServiceConnectionErrorDomain error 3.)
|
| BSServiceConnectionErrorDomain (3):
| ==BSErrorCodeDescription: OperationFailed
I can simply change the LazyVStack to a VStack and the preview works.
My code looks like this:
struct MediumMarketsWidgetView: View {
let tokenContracts: [TokenContract]
var body: some View {
LazyVStack {
ForEach(tokenContracts) { tokenContract in
HStack {
VStack(alignment: .leading) {
Text(tokenContract.symbol.name)
.font(Font.caption.smallCaps().weight(.bold))
Text(tokenContract.name)
.font(Font.caption2)
}
Spacer()
VStack(alignment: .trailing) {
Text(tokenContract.currencyRateFormatted())
.font(Font.caption.smallCaps().weight(.bold))
Text(tokenContract.priceChangePercentFormatted() ?? "%0.00")
.font(Font.caption2.weight(.bold))
.foregroundColor(Color(tokenContract.priceChangePercent ?? Double.zero < 0 ? "Danger" : "Success"))
}
}
.foregroundColor(.white)
}
}
.padding(16)
}
}