tvos

In auto scrolling UICollectionView cellForItemAtIndexPath not triggered by contentOffset

做~自己de王妃 提交于 2019-12-11 17:18:04
问题 I am attempting to create an auto scrolling UICollectionView (each cell has an image and a string). The scrolling works fine using contentOffset but since cellForItem is never triggered new/non-visible cells never load. I do not want to use scrollToItem ... contentOffset allows for a slow scrolling effect. I also can't use anything that requires a duration because I want this to run until the view is changed by the user. Here is the code I'm using: func configAutoScrollTimer() { signInTimer =

tvOS: pressesEnded is called intermittently

隐身守侯 提交于 2019-12-11 15:39:39
问题 I am creating a subclass of a UIButton, the reason why I'm trying to intercept the touch is because I cant seem to find another way to receive 'press up' or 'press ended' events for the standard UIButton in tvOS. If I could find a way to do that then I wouldn't need to bother with the solution below. pressesEnded(_ presses: Set<UIPress>, with event: UIPressesEvent?) doesn't seem to be getting called every time I release the 'select' button on the Apple TV Remote. pressesBegan(_ presses: Set

How to implement Firebase Analytics implementation for AppleTV (tvOS)?

佐手、 提交于 2019-12-11 15:08:27
问题 Currently, we have implemented Google Analytics for AppleTV (tvOS) via Measurement Protocol i.e. using batch end point Google Analytics - Measurement Protocol. Now, Google Analytics is sunsetting. Alternative as suggested by Google is Google Analytics for Firebase. But, that implementation is for Mobile Platform. Does anybody know any workaround that I can use on Firebase Platform in order to report analytics from tvOS using some sort of Firebase API? 来源: https://stackoverflow.com/questions

Play YouTube videos from my tvOS application

人盡茶涼 提交于 2019-12-11 12:59:58
问题 I want to play YouTube videos from my tvOS application. I found to play URL videos by AVPlayer, but not getting to play YouTube videos since UIWebView is not supported on tvOS. I don't want to use any third party libraries. 回答1: You need to use YoutubeSourceParserKit to parse data that you receive from url. Then you will have the url and you will be able to play video with the following code (Swift 2 solution for tvOS 9): Youtube.h264videosWithYoutubeURL(NSURL.init(string: "https://www

UICollectionView not updating inside UITableViewCell

蹲街弑〆低调 提交于 2019-12-11 12:40:31
问题 I am building a tvos app. Currently i am stuck on a problem in which i have a UITableView . There are two sections of my UITableView and each section is having only one row. In both of these rows i have a UICollectionView which scrolls horizontally. In each UICollectionViewCell there is an imageView which is used to show some image. here is the image of what i am setting up. I have set the a separate reuse Identifier for both the UITableViewCells . However i have the same reuse identifier for

How to retrieve values from settings.bundle in TVML?

坚强是说给别人听的谎言 提交于 2019-12-11 11:18:10
问题 In my tvOS app I created a settings bundle, but I don't know how to get the values in TVML. I know how to do it in Obj-c or Swift. var standardUserDefaults = NSUserDefaults.standardUserDefaults() var us: AnyObject? = standardUserDefaults.objectForKey("your_preference") if us==nil { self.registerDefaultsFromSettingsBundle(); } Any ideas about TVML way? Any kind of help is highly appreciated. 回答1: I am not aware of a direct TVJS access method... but you could easily set up a Swift/Obj-C-"proxy"

iCloud synchronization on tvOS

家住魔仙堡 提交于 2019-12-11 11:12:46
问题 has anybody managed to get iCloud working on tvOS so far? I am using key-value-storage and it successfully saves everything in iCloud. However, it does not synchronize the data between the iOS-App and the tvOS-App. I am using the same bundle-identifier for both apps. Has anyone experienced the same issue? 回答1: So, it appears that Apple may have an issue here on the tvOS side, because if I follow Apple's instructions on Configuring Common Key-Value Storage for Multiple Apps I can share between

Apple TV: don't show system keyboard

别等时光非礼了梦想. 提交于 2019-12-11 10:06:39
问题 I created a new single-view tvOS project and successfully hooked up a UITextField : import UIKit class ViewController: UIViewController { @IBAction func onChangeEditing(_ sender: UITextField) { NSLog("Editing changed: %@", sender.text!) } } As expected, I received log output on each key press, showing the currently entered text. I then tried to hide the on-screen keyboard: import UIKit class ViewController: UIViewController { @IBAction func onStartEditing(_ sender: UITextField) { // Hide the

UIFocusGuide UITableView and UIButton

耗尽温柔 提交于 2019-12-11 06:44:29
问题 I am having a hard time creating a UIFocusGuide that will jump from the UITableView to a UIButton. Here is the debugger context screenshot: And here is the implementation: override func viewDidLoad() { super.viewDidLoad() self.tableView.delegate = self self.tableView.dataSource = self // add the focus guide self.view.addLayoutGuide(focusGuide) // add the anchors self.focusGuide.leftAnchor.constraintEqualToAnchor(self.button.leftAnchor).active = true self.focusGuide.topAnchor

Getting different data in Instruments based on method of profiling

那年仲夏 提交于 2019-12-11 06:02:12
问题 This question is a follow up question to the answer of this: instruments-leaks-and-allocations-tvos The initial question relates to a memory leak I had in a tvOS app, but I think the answer to this question is relevant to iOS/Xcode/Instruments development in general. The issue was solved by removing a closure inside another closure keeping a reference to a variable in the first closure. This caused a retain cycle. Question I really want to understand why I didn't find the issue earlier, let