tvos

How to get Parallax Effect on UIButton in tvOS?

夙愿已清 提交于 2019-12-10 10:54:39
问题 I'm trying to make some UIButtons in a UIView for a tvOS app but have been unable to get them to display the new parallax effect in the simulator. I successfully set up a TV image stack in images.xcassets called "startReadingButton" and my buttons load with the file, but they do not display the shiny parallax effect when swiping around on the remote in the simulator. Here is how I am loading my UIButtons: for button in 1...5 { let image = UIImage(named: "startReadingButton") let newButton =

How to open GameCenter in tvOS

Deadly 提交于 2019-12-09 12:58:13
问题 How can I open a game center leaderboard in tvOS? I've used this code for my iPhone games, 'leaderboardIdentifier' aren't available on tvOS. I've planned to use the same leaderboard on the AppleTV (it will be the same game). Many thanks for your help, Stefan @IBAction func handleGameCenter(sender: UIButton) { let gcViewController = GKGameCenterViewController() gcViewController.viewState = GKGameCenterViewControllerState.Leaderboards gcViewController.leaderboardIdentifier = gamePrefix +

UIDatePicker replacement for tvOS?

此生再无相见时 提交于 2019-12-08 19:47:34
问题 Since UIDatePicker is not available in tvOS, what does one use to ask the user for date/time? Is there a new class that replaces UIDatePicker ? Thanks 回答1: Currently it seems you need to build something on your own. There is a nice concept with some explanation here. 回答2: Since Apple does not provide a date picker for tvOS, there is no standard solution. However, some possible steps would be: Design and implement a UI for manipulating the date components (= year, month, day, hour, minute).

How to change background color for tab in tvOS 13?

瘦欲@ 提交于 2019-12-08 13:41:38
TvOS 13. I have a UITabBarController with tabs. And can customize almost everything except this obvious thing: focused tab's background. It's always white. Guide tells Specify tints for selected and unselected items I tried: view.backgroundColor = .purple tabBar.tintColor = .yellow tabBar.barTintColor = .red tabBar.unselectedItemTintColor = .brown tabBar.backgroundColor = .green tabBar.backgroundImage = UIColor.blue.toImage() tabBar.shadowImage = UIColor.orange.toImage() tabBar.selectionIndicatorImage = UIColor.burgundy.toImage() Nothing helped. After playing a bit with various properties of

How to get the node and keyboard reference of TVML textField in TVJS?

為{幸葍}努か 提交于 2019-12-08 07:22:54
问题 Someone asked the same question here How do you get the value from a TVML textField? but didn't explain the full answer and my comment there was edited, suggesting me to ask a brand new question. Here it is... Can anyone help understand how to best get a reference to the textField node and its keyboard value from TVML? Right now I'm using this code below in Presenter.js to get to the textField once the user clicks the Done button in the template displaying the form & keyboard, but still get

Siri Remote's Menu Button not exiting application when UIButton is focused

北慕城南 提交于 2019-12-08 01:22:26
问题 I'm overriding pressesBegan to receive Select presses. The Siri Remote's Menu Button does not exit my application when the focus is on a UIButton . If no UI element is focused the Menu Button works as expected. How do I receive Menu Button presses when the focus is on a UIButton ? override func pressesBegan(presses: Set<UIPress>, withEvent event: UIPressesEvent?) { for item in presses { if item.type == .Select { print("Click") } if item.type == .Menu { print("Menu Button") super.pressesBegan

CLLocationManager and tvOS - RequestWhenInUseAuthorization() not prompting

不打扰是莪最后的温柔 提交于 2019-12-08 00:57:15
问题 I seem to be having a little trouble getting tvOS to prompt the user for location data authorization. I literally copied and pasted working code from iOS and it seems to not be prompting the user. I am using the code listed below as well as the NSLocationWhenInUseUsageDescription key with a string value. The only difference in the api that I see is on iOS it uses startupdatinglocation() and on tvOS it uses requestLocation() (similar to watchOS) I've stepped through the problem and it is

Unable to load LCR image in tvOS apps

こ雲淡風輕ζ 提交于 2019-12-07 21:36:53
问题 I am trying to load LCR image in UIImageView using "contentsOfFile" method as described in apple document but I am getting error with nil image. Can anyone please confirm how we can load LCR images from server? Code I am using: UIImage(contentsOfFile: "LCR file url") Error I am getting in console: BOMStorage BOMStorageOpenWithSys(const char , Boolean, BomSys ): can't open: '/LCR file url' No such file or directory One thing I noticed is it adds "/" in front of my actual url. I think its

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

淺唱寂寞╮ 提交于 2019-12-07 08:09:36
问题 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 { //

tvOS: Rounded corners for image view when focused

喜夏-厌秋 提交于 2019-12-07 05:54:15
问题 I have an image view that will get this awesome tvOS focus effect when the containing view gets focused. The problem is - it should have rounded corners. Now this is easily done: imageView.layer.cornerRadius = 5 imageView.layer.masksToBounds = true I have to set either masksToBounds of the layer or clipsToBounds of the image view to true (which is basically the same), in order to clip the edges of the image - but as soon as I do this, the focus effect won't work any more, because it will get