[message deleted]
Post
Replies
Boosts
Views
Activity
Rewrote it to use a struct passed instead of referencing class properties, now massive fast. Still be nice to know for sure if my conjecture about runtime is true.
This would make sense if the objective-C runtime (or ARC) is still running on Intel, thus requiring a switch to Rosetta. If so, people should be made aware that any capture of self could cause a slowdown on M1. Odd if true, but I can't see how Apple could otherwise code such a simple concept so badly if it's native ARM.
I don't understand why Apple Engineers keep preferring Objective-C for sample code. I presume they think most people are still using it, but at my employer we converted to Swift years ago. Translating things mentally from Obj-C to Swift is now difficult because I haven't used it in years, and Swift is where most of the iOS/MacOS market is today. Back when I worked at Apple in the mid 90's we still had some sample code in Pascal, which made just as much sense, i.e. none.
Maybe things will improve in WWDC 21.
I would suggest to Apple that it rewrite all the Metal examples in Swift instead of Objective-C which hardly anyone uses any more.
This works for the whole label, but still can't get the animation:
, label:
{
		HStack
		{
				Text("Guests")
				.padding(EdgeInsets(top: 0, leading: 8, bottom: 0, trailing: 8))
				.font(.headline)
		}
		.frame(maxWidth: .infinity, alignment: .leading)
		.contentShape(Rectangle())
		.onTapGesture { guestsExpanded = !guestsExpanded }
}
I used an @State var enum and used that with a ternary to pick one array or the other. Not sure that's the best idea. Doesn't scale well beyond 2 choices.
I will be showing two Views, one for each of the published arrays, but its the same View definition. How do I initialize the View to tell it which of the two arrays to show but still have it be bound?
Apparently if you include a definition elsewhere called Environment then @Environment will not compile. Yet there is not compile error or warning at the definition site. Seems like a bug to me.