When loading screen, I scan for tips:
private lazy var scanAreaTipTask = Task { @MainActor in
for await shouldDisplay in scanAreaTip.statusUpdates {
if shouldDisplay == .available {
onSetBeacon.send(.scanArea(scanAreaTip, .show))
} else {
onSetBeacon.send(.scanArea(scanAreaTip, .hide))
scanAreaTipFinished = true
}
}
}
Task is called in ViewDidAppear of the UIViewController.
First time I load this view controller, the scanAreaTip.statusUpdates always comes back as pending.
If I quit this view controller and open it again, the scanAreaTip.statusUpdates will come back as available.
Why does it always come back as pending on the first opening where it should come back as available?
This is the tip that I am using.
As shown, there aren't any rules or options used. Just a plain tip that should show straight away.
public struct ScanAreaTip: Tip {
public init() {}
public var title: Text {
Text("Scan area around you")
.brandFont(style: .regular(.headline))
.foregroundStyle(Color.accentColor)
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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