tvos

Xcode tvOS - Error: You don’t have permission to save the file “fileName.txt” in the folder “Documents”

眉间皱痕 提交于 2020-06-27 21:08:45
问题 I have an Xcode tvOS project in Objective-C. I'm trying to save a sample fileName.txt file into the Documents folder with this code: #import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self applicationDocumentsDirectory]; NSString *path = [[self applicationDocumentsDirectory].relativePath stringByAppendingPathComponent:@"fileName.txt"]; NSString* sampleText = @"Prova"; NSError* err; [sampleText writeToFile

Xcode tvOS - Error: You don’t have permission to save the file “fileName.txt” in the folder “Documents”

£可爱£侵袭症+ 提交于 2020-06-27 21:03:10
问题 I have an Xcode tvOS project in Objective-C. I'm trying to save a sample fileName.txt file into the Documents folder with this code: #import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self applicationDocumentsDirectory]; NSString *path = [[self applicationDocumentsDirectory].relativePath stringByAppendingPathComponent:@"fileName.txt"]; NSString* sampleText = @"Prova"; NSError* err; [sampleText writeToFile

tvOS Button inside NavigationLink is not Working

六眼飞鱼酱① 提交于 2020-06-27 18:27:27
问题 I have built an iOS app using swift and swiftui and now I am working on the tvOS version of the app. However, I have a couple of issues. One of the issues is still unresolved: tvOS Textfield Transparent Background I was creating a login page and I realized that the button inside the NavigationLink was not doing anything. Then to test and identify the issue I created a simple button as follows: Button(action: { print("Login pressed") }) { Text("Login") .frame(width:300, height: 35) }

tvOS Button inside NavigationLink is not Working

女生的网名这么多〃 提交于 2020-06-27 18:27:10
问题 I have built an iOS app using swift and swiftui and now I am working on the tvOS version of the app. However, I have a couple of issues. One of the issues is still unresolved: tvOS Textfield Transparent Background I was creating a login page and I realized that the button inside the NavigationLink was not doing anything. Then to test and identify the issue I created a simple button as follows: Button(action: { print("Login pressed") }) { Text("Login") .frame(width:300, height: 35) }

How to slide TabBar up to hide it in tvOS app?

自作多情 提交于 2020-06-27 17:32:13
问题 In my tvOS app I have a TabBarController with 3 viewControllers. What I want to do is to automatically hide/change focus of the tabBar when I switch to the next viewController. I saw some posts here, on SO that suggested to change alfa on the tabBar, but I would like to have a slide up animation, same way as it does when you change focus to something in the viewController. Any kind of help is highly appreciated. 回答1: As Charles said.. Something like this in the derived UITabBarController: var

Button is not selectable on tvOS using own ButtonStyle in SwiftUI

≡放荡痞女 提交于 2020-06-16 06:20:13
问题 After replacing a standard button style with a custom one, the button isn't selectable anymore on tvOS (it works as expected on iOS). Is there a special modifier in PlainButtonStyle() that I'm missing? Or is it a bug in SwiftUI? Here's the snipped that works: Button( action: { }, label: { Text("Start") } ).buttonStyle(PlainButtonStyle()) and here's the one that doesn't: Button( action: { }, label: { Text("Start") } ).buttonStyle(RoundedButtonStyle()) where RoundedButtonStyle() is defined as:

SwiftUI and tvOS (focusable)

萝らか妹 提交于 2020-06-12 05:51:20
问题 I know, SwiftUI is currently in beta, but i want to be sure to use focusable correctly. Actually, when i scroll down in the list, the focused item skips 3 or 4 rows when the list scroll down (up scroll direction is fine). You can try with this code, in b4 version: (Edit: same for b5) import SwiftUI struct TestList: Identifiable { var id: Int var name: String } let testData = [Int](0..<50).map { TestList(id: $0, name: "Row \($0)") } struct SwiftUIView : View { var testList: [TestList] var body

How to detect if the internet connection is over WiFi or Ethernet?

我的梦境 提交于 2020-05-10 04:37:43
问题 Is there a way to open network settings programmatically? Closest thing I know is opening the main settings page: let settingsURL = NSURL(string: UIApplicationOpenSettingsURLString)! UIApplication.sharedApplication().openURL(settingsURL) I want to be able to detect if the internet connection is over WiFi or Ethernet. 回答1: The way to detect this is to look at the name of the network interfaces. For Mac and Apple TV, en0 and en1 refer to the wired and wireless interfaces respectively. Add this

Unable to Install the Charles Proxy profile on Apple TV via Apple Configurator 2

天涯浪子 提交于 2020-04-13 14:12:40
问题 I have been trying this official guide to setup Charles Proxy on my Apple TV (4th Gen, running tvOS 13.3). After creating the profile on Apple Configurator 2, I was performing the steps for setting up the profile on Apple TV below: After pressing "Done" above, this screen shows up indicating that no profile has been installed: Can you guide me on how I can successfully install the Charles Proxy profile on my Apple TV running tvOS 13.3? 回答1: This guide worked for me from https://forums

Unable to Install the Charles Proxy profile on Apple TV via Apple Configurator 2

爷,独闯天下 提交于 2020-04-13 14:11:11
问题 I have been trying this official guide to setup Charles Proxy on my Apple TV (4th Gen, running tvOS 13.3). After creating the profile on Apple Configurator 2, I was performing the steps for setting up the profile on Apple TV below: After pressing "Done" above, this screen shows up indicating that no profile has been installed: Can you guide me on how I can successfully install the Charles Proxy profile on my Apple TV running tvOS 13.3? 回答1: This guide worked for me from https://forums