Here’s a simple use of NSTimer to repeatedly trigger a method call every X seconds in Objective-c, for iOS.
Declare NSTimer variable in header file
Initialise myTimer at the appropriate point in code. Could be viewDidLoad on iPhone or willActivate on Apple Watch. My example triggers the method named updateDisplay at 5 second intervals. Note that I’ve set repeats: YES.
You can trigger the method for a one off call after X seconds by setting repeats: NO.
It’s a little tricky but you can take a screenshot on Apple Watch, handy when you want a live shot of an app your developing. Or perhaps you want a lasting reminder of some notification or other. Either way, follow these steps:
1. Get a good grip of your Apple watch.
If you wear with the side buttons facing your hand:
Placing your thumb on the smooth side
Rest your first finger over the digital crown
Rest your middle finger on the side button
If you wear with the side buttons facing your elbow:
Placing your first finger on the smooth side
Rest your thumb over the digital crown and the side button
2. Press the digital crown and side button at the same time.
The two buttons pressed at the same time will result in a screenshot of the current display. A flash of the screen accompanied by the camera shutter sound signifies a successful screenshot.
3. View and share the image
The screenshot from your Apple watch is saved to the paired iPhones camera roll. Open photos on iPhone to view your screenshot. Tap the share button to view the options.
My home automation app running an a wall mounted iPad. It brings a number of technologies and coding platforms together to run behind a simple & easy-to-use interface. Basically, I get to control a bunch of stuff in my house from my iPad or iPhone.
Lazy?: A little bit. Geeky?: More than a little bit.
It not only works from my home wifi, but anywhere with web connection. Useful to check in on the security cams and control lights, sockets, heating, music, etc. It links to open into other apps for Hive heating control, Sonos audio throughout the house and some others for my gadgets.
I add to the project as & when I get my hands on new stuff!
I use Lightwave RF (http://www.lightwaverf.co.uk/) products throughout my home – power sockets, light switches, energy monitor, wifi link – which enable direct communication via the wifi link. The public iOS app was okay but I wanted something a little easier to use that was customised to my environment. There’s no API for the wifi link, so I had to create one. The architect’s drawings provide a great backdrop for room controls.