watchos-6

Fullscreen view in watchOS with SwiftUI

对着背影说爱祢 提交于 2021-02-02 03:46:29
问题 I wan't to display a SwiftUI View as fullscreen in watchOS (without the Cancel/Back Button or Clock) I've tried adding a Sprite Kit Scene to the view and also setting the .edgesIgnoringSafeArea(.all) but I'm still able to hide them or put a view under the top bar. 回答1: Unless it's a game, it's not possible to strip out the space at the top, watchOS reserves it so that the time is always visible to the user. 回答2: Turns out it does "work", even with SwiftUI: Using Interface Builder: https:/

Fullscreen view in watchOS with SwiftUI

ε祈祈猫儿з 提交于 2021-02-02 03:44:44
问题 I wan't to display a SwiftUI View as fullscreen in watchOS (without the Cancel/Back Button or Clock) I've tried adding a Sprite Kit Scene to the view and also setting the .edgesIgnoringSafeArea(.all) but I'm still able to hide them or put a view under the top bar. 回答1: Unless it's a game, it's not possible to strip out the space at the top, watchOS reserves it so that the time is always visible to the user. 回答2: Turns out it does "work", even with SwiftUI: Using Interface Builder: https:/

Failing APNS for Independent WatchOS6 app

拜拜、爱过 提交于 2021-01-27 20:14:20
问题 After setting up a new independent WatchOS6 app, which now supports push notifications, getting the device to request the user for push notifications and capturing the push token. I can’t get my server to send a push notification. With all the correct credentials and P8 set up on my NodeJS server, I have tried to push messages to the device... This is the error all the time: Status 400 - DeviceTokenNotForTopic - Which according to Apple’s documentation, means that the Topic (BundleId of the

Issues implementing navigation from a main controller to page based controllers in WatchOS using SwiftUI

我只是一个虾纸丫 提交于 2021-01-27 20:08:50
问题 I'm trying to do do something like this using SwiftUI. So far I have the ability to go from one main view to a page based views but I cannot scroll between the page views. The storyboard looks like this: As you can see I do not have any segues or next page relationships in the storyboard. I'm implementing those in code in the WKHostingController of HC3 (the middle one of the three). HostingController of HC3 : class HC3: WKHostingController<CV> { override func awake(withContext context: Any?)

NavigationBarTitle color change for watchOS in SwiftUI

时光怂恿深爱的人放手 提交于 2020-01-13 18:30:14
问题 In the image above id like to change -02:49 to a color such as Color.blue I've tried: struct ContentView: View { var body: some View { PlayerView().accentColor(Color.blue) } } and I've also tried adding it in the actual PlayerView as follows: struct PlayerView: View { var body: some View { VStack{ .... }.navigationBarTitle(Text(“-2:49”)) .accentColor(.blue) } } I've also tried: struct PlayerView: View { var body: some View { VStack{ .... }.navigationBarTitle(Text(“-2:49”).foregroundColor(

Why is Starscream not working anymore on real Apple Watch (WatchOS 6)?

两盒软妹~` 提交于 2020-01-05 03:26:12
问题 Recently I upgraded my Apple Watch to WatchOS 6.0.1, my iPhone to iOS 13.1.2, Xcode to 11.1. MacOS still 10.14.6. I've created an Independent Apple Watch project where I test the communication between the Watch and a WebSocket server using Starscream: https://github.com/daltoniam/Starscream It works perfectly on the Simulator but on real Apple Watch when I try to connect to the server I got these errors : 2019-10-08 18:57:53.064887+0200 BackgroundWebSocketOnlyWatch WatchKit Extension[251

Cannot use TabView on SwiftUI, WatchOS

浪子不回头ぞ 提交于 2019-12-20 05:21:30
问题 Is there a way to use TabView using SwiftUI on WatchOS? I've seen most of the WWDC talks and they don't mention it for WatchOS. Moreover, in the apple documentation it is not enumerated under SDK's. Whenever I try to add it to a WatchOS project I get the following error: 'TabView' is unavailable in watchOS Or is there a good way to replicate the desired TabView ? I want something similar to this: Two different pages that are changed simply by swiping horizontally. 回答1: If you want a page

Cannot use TabView on SwiftUI, WatchOS

三世轮回 提交于 2019-12-20 05:21:14
问题 Is there a way to use TabView using SwiftUI on WatchOS? I've seen most of the WWDC talks and they don't mention it for WatchOS. Moreover, in the apple documentation it is not enumerated under SDK's. Whenever I try to add it to a WatchOS project I get the following error: 'TabView' is unavailable in watchOS Or is there a good way to replicate the desired TabView ? I want something similar to this: Two different pages that are changed simply by swiping horizontally. 回答1: If you want a page

Using multiple hosting controllers in SwiftUI on WatchOS

回眸只為那壹抹淺笑 提交于 2019-12-11 05:25:33
问题 I'm trying to use multiple WKHostingController in a SwiftUI WatchOS project. I want to be able to go from one Controller to 3 controllers. The user will press a button in the first ContentView(1) (That is paired with HostingController(1) ) that will then navigate them to the middle controller in the 3-grouped set HC3 (or HostingController3 , with Identifier HC3 ) The Code is as follows: struct ContentView: View { var body: some View { VStack{ NavigationLink(destinationName: "HC3"){ Text("Go

How to inject .environmentObject() in watchOS6

情到浓时终转凉″ 提交于 2019-12-11 05:20:21
问题 I want to inject an EnvironmentObject while creating a SwiftUI view in watchOS6. But since WKHostingController expects a Concrete type I am not able to do the following ContentView().environmentObject(UserData()) class HostingController: WKHostingController<ContentView> { override var body: ContentView { return ContentView().environmentObject(UserData()) } } This code fails with the following error: Cannot convert return expression of type 'some View' to return type 'ContentView' I have seen