قالب وردپرس درنا توس
Home / IOS Development / My first dive in watchOS – Erica Sadun

My first dive in watchOS – Erica Sadun



Just wrote my first two watchOS apps. The first, which was meant to provide speech coaching for physiotherapy exercises, was a failure. Timing was just not reliable, and the errors were built more and more over an increase of repeated counts, teams and "almost there" / "two more" / "last one" recommendations.

The other was a simple D & D dice set and much more successful. (Block, of course, my miserable sense of interface design.)

It consists of an iOS app paired with a watchOS extension that runs as its own watchOS app, allowing anyone with an arm and One need for the D20 to roll for will.

WatchOS APIs were disappointing at first glance. For one thing, the buttons look at goal action, but do not give a sense of sender . A single iOS call must be divided into 7 conversations on the clock:

  // iOS. I used brands. Apply me.
@IBAction func roll (_ Button: UIButton) {
let value = Int.random (in: 1 ... button.tag)
la percent = button.tag == 100? "%": ""
label.text = " (value)  (percent)"
}

// watchOS
@IBAction func d4 () {label.setText (" (Int.random (i: 1 ... 4))")}
@IBAction func d6 () {label.setText (" (Int.random (i: 1 ... 6))")}
@IBAction func d8 () {label.setText (" (Int.random (i: 1 ... 8))")}
@IBAction func d10 () {label.setText (" (Int.random (i: 1 ... 10))")}
@IBAction func d12 () {label.setText (" (Int.random (i: 1 ... 12))")}
@IBAction func d20 () {label.setText (" (Int.random (i: 1 ... 20))")}
@IBAction func dPercent () {label.setText (" (Int.random (in: 1 ... 100))%")} 

There is no automatic layout as far as I can tell, so you either "fill "things or you give them fixed sizes. I could not figure out how to share my buttons in thirds of the available screen area.

Entering a label's text is a matter of a call, not a property assignment. It was surprising to me. I'm not sure what benefit was achieved here without breaking the principle of least amazement.

I had to design the interface of my app in the WatchKitApp target, but implement it in the extension goal. This can be quite normal and in line with other extensions on IOS, but I have not spent much time there, so it slightly increased my eyebrows. You add your app to the app, your complications (which I did not build) in the extension.

Right now on my priority list, I'd like to build something similar to the "breathe" app. I do not know where to start. I need to use a notification system to start the app at certain intervals, n times a day, preferably during the workday, and then use a form of interaction with haptic feedback. My immediate goal is one that regularly exercises my back muscles to build strength.

I'm a little sad about the timing problems I experienced with my first jab on the coaching app. I can close it again with a new design like having my wrist number and it would be much better than having to do all the work myself (I always lose my space) or have to keep the phone nearby.

My need for reps, teams and rest periods is simple. And while I do not really like the scroll wheel that looks like segmented controls, I can live with them.

To see my first project (to be inspired or to criticize), I have left a copy on github.


Source link