Questions tagged [focus-engine]

30 questions
10
votes
1 answer

how to animate section header of collectionview in tvOS app?

Need to animate the section header title when the collection cell below the header is focused. Just like if you go to "movies itunes" app on apple tv and go to top movies tab, if you look at the playlists below, when you scroll through items, the…
ck8414
  • 191
  • 1
  • 1
  • 6
7
votes
3 answers

How to make a UIView focusable using the focus engine on Apple TV

Is it possible to make a UIView focusable? Or should I just use a custom UIButton for all possible views? I tried to override canBecomeFocused but nothing happened.
Pavel Smejkal
  • 3,600
  • 6
  • 27
  • 45
4
votes
3 answers

tvOS how to check if the UITabBar is focused

I'm looking for a way to make a custom transition when changing the focus from or to the UITabBar. I'm currently trying this by overriding the didUpdateFocus method but I seem to be unable to check if the the tabBar is focused. The tabBar itself…
Mario
  • 3,339
  • 2
  • 22
  • 41
4
votes
1 answer

tvos How to let the user move focus more freely?

I am constructing a card-game (for tvos) where the user should be able to remove cards from a board. At the end of the game only a few cards may be left at the board, and they might e.g. be arranged as the buttons in the picture below. How can I…
ragnarius
  • 5,642
  • 10
  • 47
  • 68
3
votes
1 answer

tvOS - Reset CollectionView's focus at one point of time with remembersLastFocusedIndexPath = true [swift]

I have a setup a collection view with remembersLastFocusedIndexPath set to true. CollectionView is designed such a way that it has nested collection views, CollectionView -> Section 1 --->Header --->Cell nested with collectionview ->…
cgeek
  • 558
  • 5
  • 18
3
votes
1 answer

Getting onFocusChange callback for Buttons in SwiftUI (tvOS)

The onFocusChange closure in the focusable(_:onFocusChange:) modifier allows me to set properties for the parent view when child views are focused, like this: struct ContentView: View { @State var text: String var body: some View { …
c_booth
  • 2,185
  • 1
  • 13
  • 22
3
votes
2 answers

tvos How to always focus specific tableViewCell

I've creating tvOs app and had stucked with focus engine. I have tableview, and set remembersLastFocusedIndexPath true. And I have to override indexPathForPreferredFocusedView. When I focus first time, indexPathForPreferredFocusedView get called,…
Dmitry
  • 125
  • 2
  • 9
3
votes
3 answers

How to setup a constraint to a tvOS focused element

I have a UICollectionView in my tvOS app that has a image and a caption text. I've setup a constraint to pin the caption text just under the image. When the cell is focused and the images grows, the text does not move and stays over the image. Is…
Jan
  • 7,444
  • 9
  • 50
  • 74
3
votes
1 answer

How to override focus engine update sound in tvOS

I am trying to override the sound that plays when a focus change is made on tvOS, but I cannot seem to find anything indicating if this is possible. I have looked through the Apple documentation a bit, and looked at some of the sound API's but none…
Bryce Meyer
  • 249
  • 5
  • 9
2
votes
1 answer

Button is not focusable because it is out of reach - tvOS Swift

I am creating a tvOS movie browser. This view holds the movie description and displays 4 things: the movie cover image, the movie description text, a watch button, and a collection view of the movie's cast (blue boxes). The preferredFocusView is set…
iOess
  • 21
  • 3
2
votes
3 answers

How can I disable the default tvOS focus animations?

I need to create a UI which is a mix of UITableView, UITextField, and some custom UIView's and I also need to provide a custom focus animation. How can I get the UITableView/UITableViewCell and UITextField to not render the default focus…
pstoppani
  • 2,531
  • 1
  • 20
  • 20
2
votes
1 answer

Display focus effects for UITextView on tvOS?

When focus changes to a UITextView in any of the media apps on Apple TV - App Store, Movies, TV Shows etc. - it highlights with an effect that looks like this: It pops out, a shadow appears, and rolling your thumb across the trackpad gives it that…
Andrew
  • 7,693
  • 11
  • 43
  • 81
1
vote
0 answers

In tvOS how to actually put an SCNNode in a focus container? Scene nodes now have focus behavior, but how to include in the focus container?

You have a scene kit scene in your tvOS app. As usual the scene kit is part of a normal view controllert. Nowdays you can in fact do this: someNode.focusBehavior = .focusable reference -…
Fattie
  • 27,874
  • 70
  • 431
  • 719
1
vote
0 answers

tvOS SwiftUI Focus Engine

I am facing a decision regarding use SwiftUI in our new tvOS app but I found problem with foucs. I know that exist something like: func focusable(_ isFocusable: Bool = true, onFocusChange: @escaping (Bool) -> Void = { _ in }) -> some View but I…
Laxsion12
  • 67
  • 1
  • 8
1
vote
2 answers

How do I use the focus-engine of tvOS with SwiftUI?

I have some focus-engine issues with tvOS and SwiftUI. When I use buttons in SwiftUI, the focus engine handles it perfectly (the button is automatically focusable and it pops to the front with the fun animations when it is focussed). When I use…
Waxyen Flax
  • 101
  • 3
  • 9
1
2