tvos

Swift: tvOS IBAction for UIControl in Collection View cell never gets called

若如初见. 提交于 2019-12-11 05:53:27
问题 I know this has been asked many times, but I am still learning, I have tried all possible solutions here in S.O. and I haven't had luck a single time. So this is the issue: I am using Xcode 11 beta 3 (hopefully that ISN'T the issue!) I have a simple collection view in a view controller Inside the cell I have put a tvOS' TVPosterView - which inherits from UIControl and testing it by itself it does behave like a button (IBAction gets called). On the collection view there is the animation when I

Instruments: Leaks and Allocations (tvOS)

跟風遠走 提交于 2019-12-11 04:41:41
问题 I’m currently working on a tvOS app. This is my first native (Swift) app. The app will be a digital signage app, used during events or in offices of companies. One big difference compared to a typical app on iOS/tvOS is that it needs to run pretty much 24/7, so memory is a big topic for this app. The smallest leak will eventually cause the app to crash. The app is constantly looping through a set of fullscreen slides. At the bottom of the screen there is a ticker with 10 articles (refreshed

Manage Focus with multiple controls on Apple TV

拜拜、爱过 提交于 2019-12-10 23:49:20
问题 I have multiple controls on my screen. A collection view on right-top, then a button at left-center and besides the button, i have another collection view. Please refer the attached image for it I am able to move the focus from button to bottom collection view and vice versa. I have created a focus guide for the same as below: focusGuide.preferredFocusedView = self.btn self.view.addLayoutGuide(self.focusGuide) self.focusGuide.topAnchor.constraintEqualToAnchor(collectionViewHeader.topAnchor)

Can I have a cross-platform framework for OS X and tvOS?

空扰寡人 提交于 2019-12-10 23:24:59
问题 I am writing a tvOS app. Up to now I was developing the code as an OS X framework with a prototyping OS X app. Now I would like to add the production tvOS app into the mix, keeping the OS X prototype . Which means I need the framework to be built both for OS X and tvOS. This should not be a problem in the principle, since I only use frameworks available on both platforms. Is it possible to build a cross-platform framework? What settings do I use? 回答1: Yes it's commonly done. Create a new

How to change placeholder color in UITextField on tvOS, so that the change is kept and it does not revert back to its default placeholder state?

一个人想着一个人 提交于 2019-12-10 19:21:05
问题 How to change placeholder color in UITextField on tvOS, so that the change is kept and it does not revert back to its default placeholder state? In viewDidLoad() I have added the following: self.txfUsername?.attributedPlaceholder = NSAttributedString(string: "Email", attributes:[NSForegroundColorAttributeName: UIColor(red:1.0, green:1.0, blue:1.0, alpha:1.0), NSFontAttributeName:UIFont(name:"GothamBook", size:38.0)!]) So at first the placeholder color is white, however when it looses focus it

indexPathForPreferredFocusedView is not being Called

蹲街弑〆低调 提交于 2019-12-10 16:48:08
问题 I need to specify which cell should receive focus. According to Apple Documentation the indexPathForPreferredFocusedView delegate method should be called if the remembersLastFocusedIndexPath property is false , or if there is no saved index path because no cell was previously focused. In my case I am using a collection view in a UIViewController and setting remembersLastFocusedIndexPath to false but indexPathForPreferredFocusedView is not being called. How explain this behaviour? 回答1: The

How to make in app purchase work with tvOS beta 2?

ぃ、小莉子 提交于 2019-12-10 16:37:37
问题 I am working on an tvOS app which is linked (with the same App ID) to an iOS app where in app purchase is fully functional, and I am using the same implementation as for the iOS app. I am using a development apple TV, not just the simulator. My sandbox tester account is not recognized by the Apple TV and my productsRequest doesn't get any answer. Is there something specific to do with StoreKit on tvOS ? Thanks 回答1: I found the answer. In app purchases actually work with beta 2 and the

Why SCNPhysicsBody resets position when set eulerAngles?

人盡茶涼 提交于 2019-12-10 15:26:19
问题 I'm trying to use SceneKit to develop a game for tvOS, and I'm having an issue. When I set the node's eulerAngle before apply an impulse to the physicsBody the node is reset to his original position. I was expecting to see the nodes moving around on the floor's plane, but on each tap the nodes are moved to the origin position before the impulse is applied. I'm new at the use of this framework, so I wonder where is the mistake. I'm using the new AppleTV with tvOS 9.0 and XCode 7.1.1 To

How do I get a UIButton press to work in a UICollectionViewCell in Swift?

亡梦爱人 提交于 2019-12-10 11:07:41
问题 So this is a tvOS project in Swift. I have a custom UICollectionViewCell with a button as one of its subviews. I add a target to the button to allow it to interpret clicks. Here's a simplified version of the relevant code class CustomCell: UICollectionViewCell { var button:UIButton! override init(frame: CGRect) { super.init(frame: frame) button = UIButton(...) // Button is initialized with a frame button.userInteractionEnabled = true button.enabled = true button.addTarget(self, action:

Setting up Apple TV video JavaScript

本小妞迷上赌 提交于 2019-12-10 11:06:12
问题 I have a simple function that will launch the player that handles video playback for the Apple TV function launchPlayer() { var player = new Player(); var playlist = new Playlist(); var mediaItem = new MediaItem("video", "http://localhost:9001/videos/nsoperations.mp4"); player.playlist = playlist; player.playlist.push(mediaItem); player.present(); } According to the Player Documentation, all I needed to play a video back is a player, a playlist(docs), and a media item(docs). I've got all