Post

Replies

Boosts

Views

Activity

RealityKit, move(to:) methods works only without duration parameter
Using move(to:) method to update Entity's position works only if I don't use the the initialiser with duration parameter. sphere.move(to: newTransform, relativeTo: nil, duration: 0.75) // Absolutely no effect sphere.move(to: newTransform, relativeTo: nil) // Instant effect Both called from the Main thread. I don't understand what may cause this strange behaviour.
0
0
902
Oct ’22
SwiftUI, iOS 26.2, ToolbarItem .largeTitle and .title, overlap issue
I built this very simple example to demonstrate the issue im facing on iOS 26 when trying to use custom ToolbarItem element for .largeTitle. Code: struct ContentView: View { var body: some View { NavigationStack { Screen() .navigationTitle("First") .toolbar { ToolbarItem(placement: .largeTitle) { Text("First") .font(.largeTitle) .border(Color.black) } } .navigationDestination(for: Int.self) { integer in DestinationScreen(integer: integer) } } } } struct Screen: View { var body: some View { List { ForEach(1..<50) { index in NavigationLink(value: index) { Text(index.description) .font(.largeTitle) } } } } } struct DestinationScreen: View { let integer: Int var body: some View { HStack { Text(integer.description) .font(.largeTitle) Spacer() } .padding() .navigationTitle(integer.description) .toolbar { ToolbarItem(placement: .largeTitle) { Text(integer.description) .font(.largeTitle) .border(Color.black) } } } } As shown on the gif, when navigating between pages, titles are going to overlap for a short while. Other questions: Why is it required for .navigationTitle() to exist (empty string wouldn't work!) so that the ToolbarItem .largeTitle can render at all? If none is added, this ToolbarItem simply won't appear Why isn't the large title naturally aligning to the leading side? Apple doc. doesn't mention any of this behaviour as far as I know but in general these placement should replicate known established behaviours, and .largeTitle should be leading aligned. Another issue is shown on the image below. When using both .largeTitle and .title (to simulate the same behaviour of transition between large and inline title when scrolling), both will appear at the same time. The large title will disappear as you scroll down which is fine.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
104
3w