Carien van Zyl Carien van Zyl - 1 month ago 23
Swift Question

What is focusStyle used for inside UITableViewCell?

What is

focusStyle
used for inside
UITableViewCell
and how do one go about customising it? I tried setting the focusStyle to Custom and implementing
didUpdateFocus(in:with:)
as suggested in the Apple Documentation, but the method was never called and there was no visual clue as to what focusStyle does.

The documentation states that focusStyle is used to set the appearance of the cell when focused.

Answer

First of all, you need to realize what focus is. Focus is used to control apps on tvOS, therefore it has no meaning on iOS.

Start by reading Working with the apple TV Remote. Then note that the base interface is declared on UIView (UIFocusItem protocol).

UITableView and UITableViewCell just have some additional API that you can use to update your cells when they are focused.