Post

Replies

Boosts

Views

Activity

SwiftUI: Menu icon will missing if increase preferred text size
iOS simulator version 18.0+ I have a demo like this: Menu { Button { } label: { Text("Option 1") Image(systemName: "star") } Button { } label: { Text("Option 2") Image(systemName: "star") } } label: { Text("Menu") } And I used the tool Accessibility Inspector to modify the text size. Case 1: We could see the option title and the star icon. Case 2: But we could not see the icon, only the option title here Is this by design from Apple? Or does this need to be fixed? Does anyone know about my question?
0
0
61
2w
Swift: popToRootViewController with animation bug
Recently, when I was working on my project, I would like to get the current displayed viewController by observing the navigationController delegate: func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) { print("Will show: \(viewController)") } Then, I noticed it was not the expected top viewController after calling popToRootViewController(animated: true). There are steps to reproduce: Create a new Xcode project and create viewControllers A,B,C(more than two viewControllers) Push A to B to C In ViewController C, trigger a button to pop to root viewController which function named "navigationController?.popToRootViewController(animated: true)" Before step 3, the navigation stack is like [A, B, C], but After step 3 , the navigation stack is like [C, A] not as expected result that just remain the top viewController [A]. But if I disable the pop animation as "false", it would be only top viewController [A]. I think it's mostly like an Apple internal bug?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
3
580
Mar ’22