Focus on iPad keyboard navigation

RSS for tag

Discuss the WWDC21 session Focus on iPad keyboard navigation.

View Session

Posts under wwdc21-10260 tag

12 Posts
Sort by:
Post marked as solved
1 Replies
488 Views
I'm encountering problems in an existing app from the addition of the UIFocus engine in iPadOS 15, which I'm not able to address at this time. Is it possible to disable UIFocus for the entire app?
Posted
by
Post not yet marked as solved
0 Replies
175 Views
I'm building a MacCatalyst app, where the Tab key is used for a special functionality within the app. For that, I inserted a UIKeyCommand in the main menu for "\t". When I press Tab, the default functionality takes over, and the focus moves to a button in the toolbar and stays there, which I don't want. As a result, the action of my key command is not called. I set tabKeyCommand.wantsPriorityOverSystemBehavior = true, but it makes no difference. The root view controller of my app is an UISplitViewController. I overloaded 'shouldUpdateFocus(in:)' and always return false hoping that this will disable moving the focus for the whole app, but it's not working. It looks like it's more difficult then needed. How can I instruct the system to not interfere with the Tab key?
Posted
by
Post not yet marked as solved
1 Replies
228 Views
Hey, Want to move the title from left to right struct HomeView: View {   var body: some View {     NavigationView {       ZStack {         LinearGradient(gradient: /*@START_MENU_TOKEN@*/Gradient(colors: [Color.red, Color.blue])/*@END_MENU_TOKEN@*/, startPoint: /*@START_MENU_TOKEN@*/.leading/*@END_MENU_TOKEN@*/, endPoint: /*@START_MENU_TOKEN@*/.trailing/*@END_MENU_TOKEN@*/)       }       .navigationTitle("בית")       .edgesIgnoringSafeArea(.all)       .opacity(0.3)     }   } } Thanks in advance for the answers!
Posted
by
Post not yet marked as solved
0 Replies
222 Views
Based on documentation, I would assume item scanning in Accessibility mode's Switch Control utilizes the underlying API - Focus-based Navigation from UI Kit (please correct me if I'm wrong). Where is the documentation for the other type of scanning it shows in the above link, point scanning? Thanks.
Posted
by
Post not yet marked as solved
0 Replies
197 Views
Hi Support, Recently I have upgraded my laptop to MacOS Monterey and after upgrading the laptop to Monterrey, keyboard typing two or more letters at once. It just happen on login screen and all the keys work fine post login. This issue stops me to login into my laptop and everyone I have to use Safemode option check the keyboard behavior. Thank you. Regards, Anuj Kumar
Posted
by
Post not yet marked as solved
0 Replies
222 Views
An app store reviewer has rejected my build. With his message he posted a screenshot with a floating keyboard on an iPhone. I know this feature only from iPad OS. How can I enable a floating keyboard on an iPhone? Background: In this case I have implemented a MFMailComposeViewController as described in the documentation. No big deal, it works perfectly on all of my devices. The reviewer claims that it will not work / not dismiss on his device, posting this weird screenshot.
Posted
by
Post not yet marked as solved
0 Replies
289 Views
With iOS 15 there are changes to keyboard handling. Besides usual overriding of keyCommands a programmer has to assign own commands higher priority than system commands. So, the following code works for me: final class MyViewController: UIViewController { override var keyCommands: [UIKeyCommand]? { let action = UIKeyCommand(input: UIKeyCommand.inputUpArrow, modifierFlags: [], action: #selector(myAction)) if #available(iOS 15, *) { action.wantsPriorityOverSystemBehavior = true } return [action] } // rest of the code } On the other hand, almost the same code but with inheriting from QLPreviewController doesn't work: final class PreviewViewController: QLPreviewController { // same internals as above } In view hierarchy I spotted that there is actually some kind of extra navigation, maybe that is stealing my keyboard presses, maybe that's why above code isn't working. Does anyone have an idea how to fix or workaround this issue? Obviously, the extra navigation is from Apple and I don't have access to these extra presented controllers. I was trying to print the following details, but neither helps: print(presentedViewController ?? "none") // output: none print(topMostViewController) // output: <MyApp.PreviewViewController: 0x7fbe44156203> print(inputViewController ?? "none") // output: none It's worth to add I've also tried to add method override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { print("test?") super.pressesBegan(presses, with: event) } And test never appears in the console, whatever button I press. So clearly something else steals the key presses. This did not happen before iOS 15. I conclude it, thinking it may be a bug in the API. Probably just no one thought of this scenario when adding the new keys..?
Post not yet marked as solved
1 Replies
552 Views
Hi I've set up a list UICollectionView with focus (without selectionFollowsFocus as I must distinguish between focus and selection by tap) Everything is working correctly, except I'm trying to setup the first cell as focused on startup, without the user having to use tab/down key initially. I've tried: calling setNeedsFocusUpdate() and updateFocusIfNeeded() setting 1st cell in preferredFocusEnvironments and indexPathForPreferredFocusedView setting focusGroupPriority to different values (even Int.max) directly on the cell But initial focus is not set. Enabling focus loop debugger correctly shows the 1st cell as the 'next' focused element, but I cannot figure out how to actually trigger it without external keyboard. Thanks
Posted
by
Post not yet marked as solved
1 Replies
345 Views
hello , I had a idea I wanted to share with someone from apple ! My idea was to make a app on iPhones where parents could control there kids iPads or iPhones and connect it via a app to change videos or certain items , for instance I travel a lot and my 9 month old daughter gets FaceTime calls from family members on her iPad , if I would be able to answer those calls or change certain videos without actually having to grab her iPad from the back seat it would make it sooooo much better !! Endless ideas I have !! Please reach out so I can explain more !!
Posted
by
Post not yet marked as solved
0 Replies
306 Views
The trackpad and keyboard don't work properly on the 12.9-inch iPad Pro when you upgrade the iPados15
Posted
by
Post not yet marked as solved
0 Replies
404 Views
When a focus is turned on with my iPhone, I still received blocked notifications on my watch. My watch is on ios8 beta and the mirror notifications setting is turned on both with the iPhone focus settings and Apple Watch focus settings.
Posted
by
Post not yet marked as solved
1 Replies
501 Views
WWDC21 Session Focus on iPad keyboard navigation says that we can use UIFocusHaloEffect to change the appearance of focused items. On iPadOS, we can use this effect by assigning a UIFocusHaloEffect to the focusEffect property like so: self.focusEffect = UIFocusHaloEffect() What wasn't very clear is where should we put this code when working with UICollectionViewCell. I am doing it in the collectionView(_:canFocusItemAt:) method: func collectionView(_ collectionView: UICollectionView, canFocusItemAt indexPath: IndexPath) -> Bool { guard #available(iOS 15.0, *) else { return false } guard let cell = collectionView.cellForItem(at: indexPath) as? FeedCollectionViewCell else { return false } if cell.focusEffect == nil { cell.focusEffect = UIFocusHaloEffect(roundedRect: cell.artworkImageView.frame, cornerRadius: cell.cornerRadius, curve: .continuous) } return true } Is this the best way to implement it?
Posted
by