tvOS is the operating system for Apple TV.

tvOS Documentation

Posts under tvOS tag

124 Posts
Sort by:
Post not yet marked as solved
0 Replies
401 Views
We have an video app that puts up it's own screen saver after some idle time to prevent TV screen burn-in. Is there a way to stop video (including downloading segments) while still maintaining audio playback? I see the currentItem has different tracks and can enable/disable closed captioning for instance, but this doesn't work for the video track. Is it even possible? -B
Posted
by byrtM.
Last updated
.
Post not yet marked as solved
0 Replies
435 Views
I have a tvOS project contains an App target and 3 static libraries: EntryPoint – Static library that contains main , AppDelegate and SceneDelegate Experience – Static library containing my UI elements AppTarget – executable built using above two libraries I have a class "SelectionTable" which subclasses UITableView in Experience target : import UIKit class SelectionTable : UITableView { private var vDataSrc:[String]! func SetDataSrc (_ pDataSrc:[String]) { self.vDataSrc = pDataSrc } func UpdateDataSrc (_ pStringList:[String]) { self.vDataSrc += pStringList } func GetDataSrc () -> [String] { return self.vDataSrc } } I am not using this class anywhere and still i am getting these errors when i build my AppTarget: Cannot find interface declaration for 'UITableView', superclass of 'SelectionTable' Expected a type These above error are coming in generated header file "Experience-Swift.h". This file is auto-generated by compiler. I am not using @objc anywhere in the code, But still the Target-Swift.h file has the below lines: SWIFT_CLASS("_TtC10Experience22SelectionTable") @interface SelectionTable : UITableView - (nonnull instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style OBJC_DESIGNATED_INITIALIZER; - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; @end When i am marking above class as Private , this error goes away . And also , if i am defining SelectionTable class in EntryPoint library , this error does not occur . I am using similar model for an iOS project also and there i am not facing this issue. I am using :- Swift version : Swift 5.9.2 XCode version : 15.2
Posted Last updated
.
Post not yet marked as solved
0 Replies
388 Views
Hello, We would like to create a custom keyboard for our tv app, while also keeping the features of dictation and device input (via phone or pad). However setting the inputView on the UITextField does not work. When the textfield is focused/selected it should show the inputView. Instead it does nothing, freezes and builds up memory usage slowly until it goes OOM and crashes. Setting any view (empty UIView()) on a UITextField will reproduce the issue. Reproducible on tvOS 16 and 17. Test project added to github for reproduction: https://github.com/drs-st/test-tvos-custom-inputview/blob/develop/TestKeyboard/ViewController.swift
Posted Last updated
.
Post not yet marked as solved
0 Replies
382 Views
I was shutdown tvOS simulator as hold TV/Control center button and select Shutdown. How turn on? Im trying press/hold menu/tv/any buttons, simulate not react, I see only black screen
Posted
by gruzd1sok.
Last updated
.
Post not yet marked as solved
2 Replies
448 Views
If users press the menu button multiple times from any page, it is likely to exit the app. I think it would be nice to have an alert before exiting the app. I have noticed that some apps on other platforms have this feature; however, I am not sure if it is allowed on tvOS. The logic would be something like this: Users tap the menu button. Show an alert with 'Cancel' and 'Exit' buttons. If 'Cancel' is tapped, go back to the app. If 'Exit' is tapped, exit the app by calling UIApplication.shared.perform(#selector(NSXPCConnection.suspend)). Will calling NSXPCConnection.suspend get my app rejected from Apple? It seems like a reasonable feature, though."
Posted
by ANATest.
Last updated
.
Post not yet marked as solved
3 Replies
614 Views
I have an AppleTV app which I released in 2016. I've updated it and released a new version every year without much hassle. This year, with tvOS 17.2, the layered app icon isn't working right. This is a two-layer image made with PNGs. When it's selected, it looks right and the layers move correctly: But when it's not selected, the background layer disappears: Screenshots are from the simulator but it also happens on the device. It's inconsistent; sometimes it's the front layer that disappears. Occasionally both layers work, but I can't tell why. I've spent a day trying everything. Very frustrated. The icon previews correctly in Xcode and in Parallax Viewer. The image sizes are correct: 400 x 240 for Small, 800 x 480 for Small@2x, 1280 x 768 for Large. The back layer is a non-transparent PNG. I tried adding a Large@2x set. Didn't help. Originally I had a three-layer image with no middle layer PNG. I deleted the empty middle layer, but that didn't help. All the PNG files are from GnuIMP. Same color space, even. I was using the filenames tvicon-back-s.png and tvicon-back-s@2x.png. I tried taking out the @ sign in case that was confusing Xcode. (It never has before, but I am flailing here.) Anybody have any clues? If it's an Apple bug and there's nothing I can do, I'm going to just push the release button and hope it fixes itself someday.
Posted
by erkyrath.
Last updated
.
Post not yet marked as solved
0 Replies
321 Views
Hi guys, I have Xcode 15.2 + MacOS Sonoma 14.2.1 + iPhone SDK 17.2 + Apple M3 chip When I build my project with FMOD for Unreal 2.0.2.20 for iOS Simulator on have an error: /Plugins/FMODStudio/Binaries/IOS/libfmodL_iphoneos.a(libfmodL_iphoneos.a-arm64-master.o) building for iOS Simulator, but linking in object file built for iOS**, file '/Plugins/FMODStudio/Binaries/IOS/libfmodL_iphoneos.a' Found that in downloaded latest verison "fmodstudio20220ue5.3mac.zip" from https://www.fmod.com/download#fmodforunreal inside folder "Plugins/FMODStudio/Binaries/IOS" there are no files for iOS Simulator (so it's not builded for support it or they just forgot to do it) So next i found on page https://www.fmod.com/docs/2.02/api/platforms-ios.html#ios-specific-starter-guide that they Released iOS simulator binary for Core Engine and Studio Engine FMOD Core Engine library /api/core/lib/libfmod_iphonesimulator.a - Release iOS simulator binary for production code. /api/core/lib/libfmodL_iphonesimulator.a - Release iOS simulator binary with logging enabled for development. FMOD Studio Engine library (used in conjunction with core library) /api/studio/lib/libfmodstudio_iphonesimulator.a - Release iOS simulator binary for production code. /api/studio/lib/libfmodstudioL_iphonesimulator.a - Release iOS simulator binary with logging enabled for development. So next step from page https://www.fmod.com/download#fmodengine I downloaded "fmodstudioapi20220ios-installer.dmg" inside 2 folders "/api/core/lib" and "/api/studio/lib" I found these files and copy it to my folder "/Plugins/FMODStudio/Binaries/IOS/", and it didn't work :slight_smile: So just to try luck I made a copy of this folder and deleted files that work for iOS build only libfmod_iphoneos.a libfmodL_iphoneos.a libfmodstudio_iphoneos.a libfmodstudioL_iphoneos.a Next step renamed files libfmod_iphonesimulator.a -> libfmod_iphoneos.a libfmodL_iphonesimulator.a -> libfmodL_iphoneos.a libfmodstudio_iphonesimulator.a -> libfmodstudio_iphoneos.a libfmodstudioL_iphonesimulator.a -> libfmodstudioL_iphoneos.a And finally I successfully builded and launched my project with FMOD for Unreal 2.0.2.20 for iOS Simulator FMOD team need to rebuild FMOD for Unreal with adding _iphonesimulator and _appletvsimulator files and support and it will launch on iOS/TVOS Simulators with any problems. PS same you can do with TVOS Simulator and fix it
Posted
by davaidev.
Last updated
.
Post not yet marked as solved
2 Replies
444 Views
I’m developing this tvOS app, and it builds and runs fine locally in Simulator. However, when I do Product > Archive (so I can upload it to app store later), it fails with error in the screenshot. Looks like Xcode is trying to sign the app with a certificate, but could not find a valid profile to do so. Since I don't have a physical Apple TV device, I'm unable to add an Apple TV to the Devices list on developer.apple.com, thus unable to create a profile. Is the any way around this issue to archive my tvOS app?
Posted
by hliang.
Last updated
.
Post not yet marked as solved
4 Replies
694 Views
Loading a video that played on tvOS 17, won't now play in tvOS 17.2. It isn't true for all videos or even all videos of a certain type. This code works fine on tvOS 17, but not on 17.2 import SwiftUI import AVKit struct ContentView: View { var body: some View { let player = AVPlayer(url: URL(string: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")!) VideoPlayer(player: player) .onAppear { player.play() } } } I have tried reloading the metadata. I tried making the player from an AVAsset rather than a URL. I can't seem to see what is making it work with some videos and not all and what is different from tvOS 17 to 17.2.
Posted Last updated
.
Post not yet marked as solved
4 Replies
686 Views
I have a multiplatform app where I support iOS, macOS and tvOS. There is one target which supports it all. In my assets catalog I have the AppIcon entry which holds the app icon for iOS and macOS. This works as expected. However the tvOS app icon is ignored. I added an "tvOS App Icon & Top Shelf Image" asset to my asset catalog and filled it with my icons for tvOS. Then I added it in the target’s general settings App Icon entry under App Icons and Launch Screen like shown in the screenshot. What am I missing? What needs to be done to make this work?
Posted
by RayWo.
Last updated
.
Post not yet marked as solved
0 Replies
353 Views
It looks like there's a new tab bar / column style design for tvOS that was introduced with the current TV app. Is there any word on this being a developer available component?
Posted Last updated
.
Post not yet marked as solved
0 Replies
447 Views
when i am adding new view to replace viewcontroller's view like this : let viewcontroller: UIViewController! let rootview:UIView! viewcontroller = UIViewController () rootview = UIView (frame:viewcontroller.view.bounds) viewcontroller.view = rootview // Adding a button let button = UIButton(type: .system) button.setTitle("Tap Me", for: .normal) button.titleLabel?.font = UIFont.systemFont(ofSize: 18) button.addTarget(self, action: #selector(buttonTapped), for:.allEvents) viewcontroller.view.addSubview(button) For ios(iPhone/ipad) , i am able to get button click event . But in case of tvOS , i am not getting button click event. But in case of tvOS if use the default view of viewcontroller like this , i am getting button click events and things works fine: let viewcontroller: UIViewController! viewcontroller = UIViewController () // Adding a button let button = UIButton(type: .system) button.setTitle("Tap Me", for: .normal) button.titleLabel?.font = UIFont.systemFont(ofSize: 18) button.addTarget(self, action: #selector(buttonTapped), for:.allEvents) viewcontroller.view.addSubview(button) Is this some bug for tvOS or for tvOS this suppose to happen this way ?
Posted Last updated
.
Post not yet marked as solved
0 Replies
406 Views
I want to use uitableview in tvos to show list of string data but compiler is throughing following errors in generated header: "No type or protocol named 'UITableViewDataSource'" And "Attempting to use the forward class 'UITableView' as superclass of 'TWOSSelectionTableTVOS'" Even though this code is working is ios . My code structure is as follow : SelectionTable.swift: import UIKit class TWOSSelectionTableTVOS : UITableView { private var vDataSrc:[String]! func SetDataSrc (_ pDataSrc:[String]) { self.vDataSrc = pDataSrc } func UpdateDataSrc (_ pStringList:[String]) { self.vDataSrc += pStringList } func GetDataSrc () -> [String] { return self.vDataSrc } } PaintUI.swift : import UIKit @objc class PaintUI: NSObject,UITableViewDelegate, UITableViewDataSource { static let uShared = PaintUI () @objc static func updateUIMessage() { DispatchQueue.main.async { ExecuteInlineSelectionTable () } } func tableView (_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 5 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell (withIdentifier: "cell", for: indexPath) cell.textLabel?.text = "hello" return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let viewcontroller: TWIOSViewController! viewcontroller = StaticContext.sViewController } public static func ExecuteInlineSelectionTable () { let selectiontable:TWOSSelectionTableTVOS! selectiontable = TWOSSelectionTableTVOS () selectiontable.register (UITableViewCell.self, forCellReuseIdentifier: "cell") selectiontable.dataSource = uShared selectiontable.delegate = uShared selectiontable.isScrollEnabled = true // TODO : will add selection table in view heriearchy but currently getting // compilation error } } And finally calling PaintUI.updateUIMessage () , it is throughing above errors for tvOS only but in case of ios code is working fine.
Posted Last updated
.
Post not yet marked as solved
0 Replies
552 Views
On an Apple TV, if you have an app that triggers a video playing in AVPlayer while another device is air playing to the Apple TV. The device gets disconnected from Airplay and the video plays instead. There doesn't seem to be a way to sense that Airplay is happening or not happening from the Apple TV side programmatically or a way to prevent the behavior. Is this intentional? It would seem to make more sense to have Airplay take priority or push the app to the background.
Posted Last updated
.
Post marked as solved
3 Replies
554 Views
I have a pretty basic tvOS app. It uses storyboard named 'Main'. Before a week ago, all was fine. It would load no problems at all. I installed 17.2 on my Apple TV, and it crashes as soon as it opens. I tested this out in Xcode and it runs on a 17.0 simulator, but the 17.2 simulator crashes and the only message I get is Exception NSException * "Could not load NIB in bundle: 'NSBundle </Users/Tyler/Library/Developer/CoreSimulator/Devices/A442BA1A-318B-43EC-850E-EA0CFA7AAB95/data/Containers/Bundle/Application/CC57DE61-B9E4-49EE-A044-8FE00D709CB6/Piedmont Road Apple TV.app> (loaded)' with name 'kQf-Ef-Nxz-view-nK4-c0-71Y'" 0x0000600000c73d50 I have put in breakpoints, but it doesn't seem to help. Anyone have an idea what got changed with tvOS 17.2 to cause this?
Posted
by tbrass84.
Last updated
.
Post not yet marked as solved
0 Replies
336 Views
Hardware: Apple TV 4K (1st gen) OS: tvOS 17.1 I have been attempting to create a simple dashboard using MapKit for my company's devices located around the globe. As of now, we only have 7-8 attached to the main database, so I'm using an API client I created to load that many Map markers after the View is loaded. My issue is that despite this being a relatively low-intensity task, the Map view crashes after about 15 minutes, with no errors or any indications of memory leaks or other problems that would indicate something is wrong. GPU usage spikes on initial load, but remains in the green throughout the process. I tried the same code in swift playgrounds and was able to get the globe to spin indefinitely, probably because it's using the extra resources available on my M2 Max chip. But again, I am well below the memory and CPU usage limits available for tvOS. other than initially loading 7-8 objects asynchornously on initial load, no other work is being done. MRE: import SwiftUI import MapKit struct ContentView: View { let timer = Timer.publish(every: 0.1, on: .main, in: .default).autoconnect() @State var viewport: MapCameraPosition = .region(MKCoordinateRegion(center: .init(latitude: 0, longitude: 0), span: .init(latitudeDelta: 90, longitudeDelta: 180))) @State var longitude: Double = 0 { didSet { viewport = .region(MKCoordinateRegion(center: .init(latitude: 20, longitude: longitude), span: .init(latitudeDelta: 90, longitudeDelta: 180))) } } private func shiftLongitude(by: Double) { if self.longitude >= 180 { self.longitude -= 360 } else { self.longitude += by } } var body: some View { Map(position: $viewport) { } .mapStyle(.imagery(elevation: .realistic)) .onReceive(timer) { _ in withAnimation { self.shiftLongitude(by: 1.0) } } } }
Posted
by theta71.
Last updated
.
Post not yet marked as solved
2 Replies
489 Views
When we try to push blueprint for MDM over Wi-Fi in apple TV it fails, but in over the cable it works properly. After pushing the blueprint over Wi-Fi, the device gets rebooted and go through setup steps, at the end we don't see the step for Mobile Device Management. I'm attaching a sample Profile we attach to blueprint and Screenshot of Blueprint configuration.
Posted
by _kvnryn.
Last updated
.
Post not yet marked as solved
0 Replies
339 Views
In a tvOS app I have two buttons and would like to determine which one has focus when selected. Using func pressesBegan works for nw. override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { guard let selected = UIScreen.main.focusedItem else { return } Xcode tells me that focusedItem is deprecated and I should use -[UIWindowScene focusSystem].focusedItem instead. Any suggestions on a code snippet that could be used. Thanks
Posted
by Boomer.
Last updated
.