Day 79 … 84 HotProspects

person using smartphone shallow focus photography

Day 79,80, 81

This project seemed to be working very well on the watch. Up until, day 81 when Paul introduces the idea of the Context Menu. In watchOS the context menu used to be available for Apps when a user ‘long pressed’ ‘deep pressed’ the watch screen.

Trying to put .contextmenu() on the Text view results in the error ‘contextMenu(menuItems:)’ was deprecated in watchOS 7.0

Day 82

On Day 82, when setting up the tabView I found the watch dealt with tabView differently. For a start, it doesn’t use a bar at the bottom of the screen but rather displays a page indicator showing that you can swipe to another tab/page. This means you need to cycle through the screens to get to the meView rather than directly tapping.

As there is no bar, the systemImage of the .tabItem label is used instead of the ‘dot’ of the standard page indicator (see below). I felt that the systemImages chosen were making it hard to read, and didn’t feel like they were indicating 4 pages to the UI.

A standard watchOS page indicator would more look like a row of dots, this is a much better visual representation that there are other pages available.

I wondered if the choice of image was the problem, so set out to find more solid glyphs that might work as a way of indicating what each page did.

Although this worked better and provided a visual guide to the number of pages available, they are still hard to read. Ultimately the lack of wording on the .tabItem in watchOS does mean that it could be a bad use for watchOS and just having 4 Views in the tabView would allow the default behaviour of dots to appear.

var body: some View {
  TabView {
    ProspectsView(filter: .none)
    ProspectsView(filter: .contacted)
    ProspectsView(filter: .uncontacted)
    MeView()
  }
  .environmentObject(prospects)
}

Day 83

Troubles go further on Day 83 as there is no way to import CoreImage.CIFilterBuiltins or CoreImage on watchOS. Therefore we cannot generate our QR code.

Also, although we can add the CodeScanner package, most of the code relies on using a capture device which again is not available on the watch. Error ‘AVCaptureDevice’ is unavailable in watchOS

Day 84

On day 84 two of the three sessions work. We can save using UserDefaults and we can post a notification to the screen. However, we come up again with contextMenu being depreciated on the watchOS and there is no longer a way to trigger the menu on any watch running watchOS 7 or later. Therefore the button could be located in a ToolbarItem(placement: .automatic) or place the button at the end of the Form.

Conclusion

It was always going to be a bit of an ask to run this on the watch. Scanning QR codes would certainly not be possible when the watch has no camera. However, you can easily see how the watch could be used to show the lists and schedule notifications for your prospects.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.