tvos

TVML vs Custom App for Apple TVOS

大憨熊 提交于 2019-11-29 07:34:07
问题 Are there any advantage of using TVML over custom App (media based App not a game) for Apple TVOS? From what I read from Apple's documentation I could not figure out any such advantage (though it mostly talks about TVML/TVJs). For iOS (Swift, Objective C) developers, using custom seems like easier, faster and with more possibilities. I think whatever templates are provided by Apple can be build using UIKit because internally it is UIKit. Right? [Update] Let me rephrase my original question as

Can I use NSUserDefaults with tvOS?

倖福魔咒の 提交于 2019-11-29 01:21:39
The App Programming Guide for tvOS briefly states that There is no persistent local storage for apps on Apple TV. This means that every app developed for the new Apple TV must be able to store data in iCloud and retrieve it in a way that provides a great customer experience. Does this mean NSUserDefaults is unavailable? What mechanisms are available for data storage? According to an Apple Staff member on the devforums, you can use NSUserDefaults on tvOS for up to 500 kb of data: https://forums.developer.apple.com/message/50696#50696 Usama You can use NSUserDefaults for TVOS as per

UICollectionViewCell to UIButton Focus in tvOS

最后都变了- 提交于 2019-11-28 23:35:30
I have a UICollectionView which contains 12-13 UICollectionViewCells. I can easily focus on the UICollectionViewCells and everything works. There is a UIButton outside the UICollectionView. If I am on the first cell or the second cell and I swipe up then I can easily focus on the UIButton. When I am on the third cell then I am not able to move the focus to the UIButton. Any ideas what is going on? You should use a UIFocusGuide that encompasses the UIButton you want to focus. Make the UIFocusGuide as wide as the collectionView and tall enough to cover the button. Make the preferredFocusView the

Opening the Apple TV App Store

一笑奈何 提交于 2019-11-28 19:46:48
Trying to build a tvOS app and one of the use cases I have is to be able to link off and open another app in the Apple TV App Store directly on a button click. Can someone please share a code snippet to enable this? kambala I have figured this out by examining the device console output. The trick is to use the com.apple.TVAppStore scheme instead of itms-apps . Example (Swiss App Store): com.apple.TVAppStore://itunes.apple.com/ch/app/youtube/id544007664?mt=8 In fact, the https scheme is also working, but it's then transformed into com.apple.TVAppStore anyway. hufkens Just tested this on tvOS:

Use iPhone as a game controller in a tvOS app?

为君一笑 提交于 2019-11-28 17:34:57
问题 During the Apple TV announcement, the developers of Crossy Road demonstrated using an iPhone as a 2nd controller for an Apple tv game: http://www.macrumors.com/2015/09/09/cooperative-play-for-crossy-road/ My first thought was to implement this using the Multipeer Connectivity Framework. However, it's not supported on tvOS. Is there a good way to connect an iPhone to an Apple TV without Multipeer Connectivity? Update: It doesn't appear that I can use GameKit because GKPeerPickerController has

How to extend iOS app to tvOS

人走茶凉 提交于 2019-11-28 15:52:37
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 for your app on the App Store. Which means that we need to create a new bundle on our existing project

How to retrieve iPhone IDFA from API?

こ雲淡風輕ζ 提交于 2019-11-28 15:52:20
I would like to get the device IDFA . How to get this info from iOS official API ? Zachary Drake First of all: #import <AdSupport/ASIdentifierManager.h> If you would like to get it as an NSString, use: [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString] So your code might look like this: NSString *idfaString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; You first have to check if user user has decided to opt out from ad tracking . Only if he allowed it you can use the IDFA . You can check it by calling isAdvertisingTrackingEnabled method of

AVPlayer with playback controls of avplayerviewcontroller

橙三吉。 提交于 2019-11-28 09:56:18
I am putting n avplayer inside of a view controller to customize some other elements of the view controller but I still want the playback and scrubbing controls used in AVPlayerViewController. Is there a way to enable these controls for the Avplayer when I am not using AvPlayerViewcontroller? No. The usual solution (explicitly advised by Apple) is to use the AVPlayerViewController as an embedded view controller - i.e., make your view controller a custom parent view controller and the AVPlayerViewController its child, and now you can place its view (the movie and the controls) inside your view

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

允我心安 提交于 2019-11-28 09:44: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 ObjC/Swift binding. This is a simple wrapper class in your Swift project. import UIKit import TVMLKit

UICollectionView sticky header in swift

隐身守侯 提交于 2019-11-27 18:03:09
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 would be great to have an example in Swift. Simplest solution for iOS 9 + as it doesn't need of writing