tvOS 10. PreferredFocusView is deprecated. How do I change to preferredFocusEnvironment?

谁说我不能喝 提交于 2019-12-06 03:57:33

You need to pass an array of views as a result of preferredFocusEnvironments call instead of just one view as it was before. This views must be ordered by the focus priority. So, if you have 3 UIButton items on your UIViewController the preferredFocusEnvironments property can be implemented the following:

- (NSArray<id<UIFocusEnvironment>> *)preferredFocusEnvironments {

    return @[self.b3, self.b2, self.b1];
}

In your case you just need to return a @[newView] as a result.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!