tvos

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

谁说我不能喝 提交于 2019-12-06 03:57:33
I have a subview for which I have overridden the preferredFocusedView. The subclass has a UIView called viewToFocus. I check if that view exists, if it does I focus that view, if not I return the preferredFocusedView of the parent. Since I updated to tvOS 10 today I am getting the following error: 'preferredFocusedView' is deprecated: first deprecated in tvOS 10.0 - Use -preferredFocusEnvironments instead. I cant find anywhere in the documentation that explains how preferredFocusEnvironment is to be implemented. In the documentation found Supporting Focus within Your App , it says to Override

How to select buttons in tvOS menu for SpriteKit game

不羁的心 提交于 2019-12-05 18:54:31
I am extending my iOS game for tvOS. Most of the game controls are handled by touchesBegan , touchesMoved and touchesEnded . All my select buttons are handled in the following way: if button1.contains(location){ let gameplayScene = GamePlayScene(size: self.size) self.view?.presentScene(gameplayScene) } if button2.contains(location){ let settingsScene = SettingsScene(size: self.size) self.view?.presentScene(settingsScene) } if button3.contains(location){ let helpScene = HelpScene(size: self.size) self.view?.presentScene(helpScene) } for an image below: How can I appropriately highlight and

Can you host TVJS files on the Apple TV instead of an external server?

烂漫一生 提交于 2019-12-05 13:25:02
I've downloaded the TVMLCatalog application from Apple. The code is split up into 2 parts. client - this holds the TVML and TVJS files TVMLCatalog Project - this is the basic Xcode project that sets up the TVML/TVJS I'm attempting to host the client TVJS files in the same bundle as the TVMLCatalog Project . I've changed the AppDelegate didFinishLaunching as follows: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. window = UIWindow(frame: UIScreen.mainScreen(

Customize Keyboard in tvOS

眉间皱痕 提交于 2019-12-05 05:40:31
I use UISearchController to search inline with keyboard, textfield and results in one screen. Does tvOS allow to customize keyboard? I want to use dark design, but I don't know how to customize the keyboard. For example YouTube app did that. They have black screen with white keyboard A UISearchController has a UISearchBar , which conforms to UITextInputTraits . This means it has a keyboardAppearance which you can set to UIKeyboardAppearanceDark to get a dark keyboard appearance. This isn't identical to what happens in the YouTube app, but it's probably the closest you can get. From the Apple

UITabBar displays UITabBarItem image ignoring rendering mode AlwaysOriginal

你。 提交于 2019-12-05 02:36:55
问题 With the release of tvOS 9.1 and Xcode 7.2, my UITabBarItem images are being displayed incorrectly. In my view controllers, I set the tabBarItem.image and tabBarItem.selectedImage with images using UIImageRenderingMode.AlwaysOriginal . required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.tabBarItem.image = UIImage(named: "myTabImage")?.imageWithRenderingMode(.AlwaysOriginal) self.tabBarItem.selectedImage = UIImage(named: "myTabImageSelected")?.imageWithRenderingMode(

UIButton on different Y level can't be focused on tvOS

夙愿已清 提交于 2019-12-05 01:28:31
I started developing apps for Apple TV and I have this problem whit buttons. I have a screen where are several buttons on bottom of the screen and then there is one, which is in the middle (see screenshot to understand). The problem is that I can't get focused the middle button. Focus is only on bottom three buttons. The problem is obviously caused by the Y position , when I move the button on bottom of the screen, it gets focused. Buttons are created in storyboard, there is no code in ViewController. Settings in storyboard for the middle button are equal with settings for bottom buttons. Do I

YouTube URL Scheme tvOS

坚强是说给别人听的谎言 提交于 2019-12-04 21:19:52
问题 I am trying to open YouTube's app from my application with the URL scheme or the YouTube.com domain which opens YouTube's app directly on an iOS device. This is the code I tried: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"youtube://results?search_query=trailer+%@",movieTitle]]]; and [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://www.youtube.com/results?search_query=trailer+%@",movieTitle]]]

Are there any hidden tools in tvOS for Focus Engine debugging?

不羁的心 提交于 2019-12-04 21:00:34
问题 One of my favorite hidden debugging tools for iOS is using recursiveDescription on UIView instances. This is very useful for troubleshooting view locations that may be off-screen, for example. Debugging the Focus Engine on tvOS brings its own set of challenges, especially around what it thinks are focusable elements. Are there any hidden debugging tools for tvOS to introspect what is going on inside the Focus Engine? 回答1: There are two helpful methods, both of which are actually documented in

Rendering PDF in Apple TV tvOS

泪湿孤枕 提交于 2019-12-04 19:52:11
问题 I am working on an addition to my tvOS app that would allow viewing of PDFs stored in the app. However, without UIWebView, I'm at a loss on how to do this. I've asked question in other places, and get greeted with a link to a wordy and helpless document from Apple about the APIs that can be used, and even here it has been referenced (CGPDFPage) but no real guide on how to implement this. Has anyone successfully done this on tvOS, and if so, would you help me get started in this process? 回答1:

How do I open another application with tvOS?

别说谁变了你拦得住时间么 提交于 2019-12-04 17:48:34
问题 Does UIApplication:openURL work? NSString *iTunesLink = @"http://www.youtube.com/watch?v=TFFkK2SmPg4"; BOOL did = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]]; This does nothing. 回答1: I assume you're wanting to test a Custom URL Scheme. You will want to use canOpenURL to see if the URL can be opened first. canOpenURL returns a BOOL value indicating whether or not the URL’s scheme can be handled by some app installed on the device. If canOpenURL returns YES then