Running an existing Xcode project in an iPad OS 18 simulator is automatically using the newly introduced tab bar view, moved from the bottom to the top.
Unfortunately, the isEnabled property on a tar bar item is no longer honored.
In Xcode's Storyboard builder, some tab bar items are initially disabled. (can't add a screenshot here, I will try to do that after posting)
The iPad OS 17 simulator shows them correctly as disabled and any user interaction is suppressed as expected.
The iPad OS 18 simulator shows them as active and they can be selected. Also setting them to disabled inside of the UITabBarViewController doesn't work:
for item in self.tabBar.items! {
if item.tag != 99 {
item.isEnabled = false
}
}
They stay enabled and selectable.
As a workaround, I implemented the UITabBarViewControllerDelegate and overrode this method:
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
if Global.shared.accessToken == nil {
if viewController is LoginViewController || viewController is SettingsViewController {
return true
} else {
return false
}
}
return true
}
The user can no longer select the tabs, however, there is no visual indicator that they are not selectable.
I cannot find any indication in the release notes or documentation, that this behavior is intentional. So I assume this is a bug.
Post
Replies
Boosts
Views
Activity
To secure a login page, we want to ask users for either an OTP code sent via SMS to their registered cell phone or a Timed-OTP validation code paired with their account.
On the form, we would tag the input field for the SMS OTP with "autocomplete=one-time-code" and it should be filled with the token received via SMS.
The other input field for the Timed-OTP code would also need to be tagged with the same attribute (according to the newly introduced method to embed TOTP inside of the KeyChain).
Now if the user clicks in any of those fields, the SMS OTP value or TOTP value is available as a selection, leading to a confusion which to enter where.
Normally, the user would only have one method chosen, so only one field would appear, however, this is not enforced.
Is it somehow possible to only show the SMS codes in one field and the Timed-OTP codes in the other?