0 Replies
      Latest reply on Apr 17, 2020 11:57 AM by Gant
      Gant Level 1 Level 1 (0 points)

        I am having an issue that appears to be SwiftUI only as the code works when not using SwiftUI. The issue is the TVDigitEntryViewController is presented but the focus stays on the number 1 and I cannot swipe to any other number. Here is a sample project that will demonstrate the issue:

         

        import SwiftUI
        import TVUIKit
        
        
        struct ContentView: View {
            var body: some View {
                VStack {
                    Spacer()
                    NavigationView {
                        List {
                            NavigationLink(destination: LinkAccountView()) {
                                HStack {
                                    Image(systemName: "link")
                                        .font(.headline)
                                    Text("Link Account")
                                        .font(.headline)
                                }
                            }
                        }
                        .padding()
                        .navigationBarTitle("Settings")
                    }
                }
            }
        }
        
        
        struct LinkAccountView: UIViewControllerRepresentable {
            
            func makeUIViewController(context: Context) -> TVDigitEntryViewController {
                return LinkAccountVC()
            }
            
            func updateUIViewController(_ viewController: TVDigitEntryViewController, context: Context) {
        
        
            }
        }
        
        
        class LinkAccountVC: TVDigitEntryViewController {
            override func viewDidLoad() {
                super.viewDidLoad()
                
                self.numberOfDigits = 4
                self.titleText = "Link Code"
                entryCompletionHandler = { (enteredCode) in
                    print("Code:\(enteredCode)")
                }
            }
        }