Questions tagged [watchos]

watchOS is Apple's operating system for Apple Watches. Optimized for touch-based interfaces, this OS has a lot in common with iOS, which is the operating system for Apple's mobile devices, but shouldn't be confused with it.

watchOS is Apple's operating system for Apple Watches. Optimized for touch-based interfaces, this OS has a lot in common with , but shouldn't be confused with it.

Currently, the Apple Watch is the only device that runs watchOS. Its API is called WatchKit (see ).

Helpful links

1236 questions
0
votes
1 answer

How to hide/remove WatchOS 9's .sheet cancel button?

Previous to watchOS 9 you could present a sheet without any out of the box way to cancel or dismiss. However starting in watchOS 9 presenting a sheet also presents a cancel button in the top left of the navigation bar. How can I remove this and…
GarySabo
  • 5,806
  • 5
  • 49
  • 124
0
votes
1 answer

Swift - Not enough bits to represent the passed value

Below code works fine on iOS devices and watchOS simulator. static func getEventDateTime(startDateTime: Date?) -> String { if let startDateTime = startDateTime { let startTimeInMillis = Int(startDateTime.timeIntervalSince1970 * 1000) …
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
2 answers

SwiftUI - Activity indicator not animating at certain times

I am using custom activity indicator and I see it animating only when I call it at certain places in the view. Adding the code first for better understanding. Activity Indicator: import SwiftUI struct ActivityIndicator: View { @Binding var…
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
1 answer

SwiftUI - Custom view not being presented as sheet's content for all buttons

In my data object, I have a dictionary which specifies how many buttons I need to display on the view. I am looping over the dictionary to display the buttons with custom style and when a button is clicked, I intend to display a sheet with content…
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
1 answer

Convert CGImage? to an Image I can show in my view (swiftUI)

I am working with EFQRCode library and am trying to generate a QR-code on my apple watch. The result of EFQRCode.generate(for: "test") is a CGImage. If I print the line above I get something like this: Optional(
Pjaks
  • 251
  • 1
  • 11
0
votes
1 answer

How to use HStack to fill equally to the very edge of the View?

How can I make the HStack fill equally to the very edge of the View like yellow arrows indicate in the screenshot? Here is the code: var labelList = ["0", "6", "12", "6", "0"] HStack { ForEach(labelList, id: \.self) { item in …
0
votes
1 answer

SwiftUI - Error - Initializer 'init(_:rowContent:)' requires that 'CustomDataModel' conform to 'Identifiable'

In my watch app, I wish to display list of events. When the view is opened, I send a request to iPhone app to send the events list. This is working so far and I am getting the events list back to Watch. However when I try to display the data on the…
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
1 answer

SwiftUI - Data being displayed in center even when alignment is specified as "leading"

I have 4 vertical stacks within a parent vertical stack. Only the data that's in first vertical stack should be center and rest all of them should be left alignment. I have set the alignment on those 4 vertical stack i.e. for 1st vertical stack…
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
1 answer

Using a shared framework with Tuist

I am migrating an existing project in Xcode to using Tuist. The application has a main app, Watch App, and a notification extension. There is loads of shared code between each project. How can I use Tuist to share a framework between the iOS and…
datinc
  • 3,404
  • 3
  • 24
  • 33
0
votes
1 answer

I can detect workout started on backgroun with apple watch, but how can I detect workout finished?

I can detect workout started on backgroun with apple watch, with below code let workoutevent = HKObjectType.workoutType() if store.authorizationStatus(for: workoutevent) != HKAuthorizationStatus.notDetermined { …
Pd.Jung
  • 113
  • 1
  • 3
  • 13
0
votes
1 answer

SwiftUI - reduce extra space within the list

I wanted some extra space on the top of the list so I tried using Spacer within the list and added modifiers to it. However I am not seeing the height getting reduced further. Below is the code for my view. CustomView: import SwiftUI struct…
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
0 answers

SwiftUI - Circular image on rounded rectangle

I am seeing the below UI a lot these days where there is a circle with image on top left of rounded rectangle. Is there a specific control or specific name to it? I wish to implement it, but not sure where to start. I know how to make a rounded…
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
1 answer

SwiftUI - Color in the code does not match color set in assets

I had some custom color being repeated in different views, so I decided to move them to Assets as Color set, create a constant and then use it in my views. However I am noticing the color that I used in code(Colors are in…
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
2 answers

SwiftUI - NavigationLink not showing 'Back' or title of the view besides arrow on next view

Noob to SwiftUI and WatchOS. I have NavigationLink wrapped around the row in the list. When I click on the row within the list, it does navigate to new view, but I only see '<' back arrow on the top left of the new view. I don't see word 'Back' or…
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
1 answer

How to fix TextField popping back to root on cancel?

I have a simple test watchOS application with a TextField in a secondary view (navigated to from a NavigationLink). However, when the TextField is canceled or submitted, it will pop back out to the root view instead of staying in the current view. I…
pycoder
  • 1
  • 3