tvos

Can I mix UIKit and TVMLKit within one app?

左心房为你撑大大i 提交于 2019-11-27 11:50:40
I'm exploring tvOS and I found that Apple offers nice set of templates written using TVML . I'd like to know if a tvOS app that utilises TVML templates can also use UIKit . Can I mix UIKit and TVMLKit within one app? I found a thread on Apple Developer Forum but it does not fully answer this question and I am going through documentation to find an answer. Yes, you can. Displaying TVML templates requires you to use an object that controls the JavaScript Context: TVApplicationController . var appController: TVApplicationController? This object has a UINavigationController property associated

How to extend iOS app to tvOS

狂风中的少年 提交于 2019-11-27 09:24:51
问题 I have an iOS app that I need to extend to tvOS. All the information that I found are explaining how to start from scratch! Is there any way to extend my app to tvOS or I should start a new project with it? Update1: My question is: How to extend my existing project to support tvOS without building it from scratch? Update2: Jess Bower point on Apple's website: Empower customers to enjoy their favorite apps on both iOS and the new Apple TV with a single purchase by enabling universal purchase

How can I receive touches using tvOS?

☆樱花仙子☆ 提交于 2019-11-27 03:33:19
问题 How can I receive touches using tvOS with the simulator? We need know touch position. UIPress - have no it! -(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event { // Never called } -(void)pressesEnded:(NSSet<UIPress *> *)presses withEvent:(nullable UIPressesEvent *)event { // Works fine! } 回答1: Presses are related to physical buttons, like the Menu button. A press begins when you start holding down such a button, and it ends when you stop holding down the button

How to bridge TVML/JavaScriptCore to UIKit/Objective-C (Swift)?

旧城冷巷雨未停 提交于 2019-11-27 03:09:32
问题 So far tvOS supports two ways to make tv apps, TVML and UIKit, and there is no official mentions about how to mix up things to make a TVML (that is basically XML) User Interface with the native counter part for the app logic and I/O (like playback, streaming, iCloud persistence, etc). So, which is the best solution to mix TVML and UIKit in a new tvOS app? In the following I have tried a solution following code snippets adapted from Apple Forums and related questions about JavaScriptCore to

Looping AVPlayer seamlessly

浪尽此生 提交于 2019-11-26 22:55:53
There has been some discussion before about how to loop an AVPlayer 's video item, but no 'solution' is seamless enough to provide lag-less looping of a video . I am developing a tvOS app that has a high-quality 10 second clip of 'scenery' in the background of one of its views, and simply restarting its AVPlayer the 'standard' way (subscribing to NSNotification to catch it) is too jumpy not to notice and detract from user experience. It seems as though the only way to achieve a truly seamless loop is to manually manage frames, at a lower-level (in OpenGL)... Despite best efforts to read up on

Web app in tvOS

徘徊边缘 提交于 2019-11-26 20:26:36
Apple has released it's SDK for apple tv yesterday. Most apps for TVs are web based (html, javascript and css) and I would like to port an existing tv web app to the tvOS. The SDK in Xcode shows no Webview implementation like in iOS for creating apps based in html, javascript and css, however, according to the docs, it is possible to use javascript using tvjs framework , but instead of html, apple has it's own markup language for TVs called TVML . My question is: Is it possible to port an existing web app to tvOS (how?), or does it need to be reimplemented from scratch? Thanks for your help.

UICollectionView sticky header in swift

亡梦爱人 提交于 2019-11-26 19:19:40
问题 I'm trying to create a sticky supplementary header, which stays on top all the time and won't response to scrolling events. The solutions I found so far still react on bounch scrolling and are fixed using a custom flowLayout, which will probably be the fix for mine issue as well. The reason I want it this way is that the header is used on other places and should be reusable. I'm hoping this could be solved this way and I don't have to create a separated view. As I'm doing this in Swift, it