Bluetooth Beacon Aquisition

I’m working on an interesting project for a client. It involves Bluetooth LE Beacons and there are lots of them in an the office. About 43 in the 10 metre square office space. But the problem is that not all the Beacons are being seen by our test handsets. I did some investigating.

It turns out that although Android and the Bluetooth LE spec don’t place a limit on the number of beacons in a given area at any one time, physics does. After you get to about 35 beacons in a small area the time taken to find further beacons increases exponentially. 

Given that the Beacons operate on the 2.4ghz part of the spectrum the issue is probably crowding, causing back offs from each device. To many individuals shouting at the same time. Whatever the cause, an interesting phenomenon.

I tested using a Samsung S7, a Nexus 5X and a Moto X (Gen 1). The Samsung performed best taking only 1.23 minutes to find all 43 beacons. The Moto took just over 6 and a half minutes. In dead last place, the Nexus took a huge 12 and a half minutes. Complete stats below. Times are given in miliseconds, except for the last row which is in minutes.

It will be interesting to compare performance on iOS compared to Android.


Screen Shot 2018 03 15 at 21 49 47Screen Shot 2018 03 15 at 21 48 36

Silencing Warnings in Xcode

Lets face it, there are times when you just want to make Xcode stop showing you a particular warning. Turns out this is easy to do if you are compiling using the LLVM GCC. There are few options.

The nuclear option

Select your target and then select build phases. Find the file in the Compile Sources phase (by Eyeballing or by using the filter field in the top right). Double click on the file and enter -w in the box to turn off all warnings for that file.

Obviously you should use this with great care and you should take note of when it’s used. It will not be clear from the code that warning have been silenced.

You can find out more by taking a look at the Clang manual.

The tactial option

You can also silence warnings line by line. In Objective C you can use a clang diagnostic directive. The following example silences depricated calls using the -Wdeprecated-declarations directive. Other option are available.

#pragma clang diagnostic push
#pragma clang diagnostic ignored “-Wdeprecated-declarations”
// Your code goes here
#pragma clang diagnostic pop

Something similar is possible in Swift. For example…

@available(iOS, deprecated: 9.0)
func addressBookStatus() -> ABAuthorizationStatus {
return ABAddressBookGetAuthorizationStatus()


Weight is one of my oldest and most popular apps. Unfortunately it’s also one of the most neglected. Fortunately Apple, and some very kind, patient and understanding users have forced my hand; it is neglected no longer. I recently released version 3 of Weight with a new design and integration with modern iOS features such as Healthkit and Biometric identification. I’m looking to add loads of polish over the coming months. It’s still unapologetically minimalist and the fastest way keep track of your Weight, BMI and body goals. You can download a copy from the App Store.

WWDC Predictions

Well, it’s that time of year again. Predictions seem to be the thing to do, so here are mine. iOS is splitting into many forms at the moment. I think the iPhone flavour of iOS won’t see too many big changes, but the iPad version will do. Also, you can think of Siri as a whole new ajunctive OS that’s available in the cloud, though all Apple devices. Here we go…


  • UI Refresh in line with the music app. Nothing too major. You will see more bold fonts and more colours.
  • New music features. Because Apple has to keep driving this forward.
  • Dark mode. OLED is coming and a dark mode is a battery bonus for OLED screens. It also looks cool. The interesting question is how developers will be asked to go about implementing this.


This is where the big stuff is bound to happen. Nothing happened in iOS10 so there is two years worth of stuff ready to go.

  • Drag and drop has to be the number one most demanded feature. With split view this will solve so many of the iPads productivity whoes.
  • New split view app picker. Because the existing one is just awful.
  • A finder type app. 
  • Some Pro only feature to help differentiate the line up. Possibly pencil related.
  • No 10.5 inch iPad just yet. WWDC just doesn’t seem like the time


  • I think Apple knows that Devs are getting tired of waiting. So they need to show willing. They can do this by releasing new spec bumped MacBook Pros.
  • New version of MacOs with extended touchbar support. I’m not sure what else. macOS is a thing of beauty and I’m not sure what more they can really add without changes to the hardware.

Apple Watch

  • Sports focused refinements
  • A baby step away from the app model. Tres Vague.


  • Amazon Instant Video.
  • TV app comes to more countries.
  • Lots of talk about Planet of the Apps and Carpool Karoke.


  • No Siri Speaker announced because the devs need to get to work first
  • New domains that heavily hint at the Siri Speakers imminent arrival
  • New AI smarts

Ok, that’s 18 predictions. Lets see how I do.

Location Alert

Screen Shot 2017-03-06 at 17.08.26.png

Back in iOS 8 Apple deprecated the beautifully simple and readily abusable UIAlertView. The replacement; Surprisingly, its replacement UIAlertController has some short comings the UIAlertView does not. One major limitation is the inability to simply add custom views.

Fortunately, it is possible to remedy that with a little hacking about. I’ve put up a demo on Github using a MapView as an example. You can get it here.

One Watch Kit App from multiple targets

This has happened to me a few times now. I’m working on an iOS app with multiple targets. Each target is designed for a specific customer. I want a single watch kit app that serves and adapts to the hosting iOS app. Sounds simple. Actually it is. Bit it is not obvious. Here’s how you do it.

First create the WatchKit app as you normally would, associating it with whichever target is most sensible. The steps are;

1. Do: File > New > Target 2. watchOS > WatchKit App > Next 3. Give the target a name relating to the hosting iOS App target 4. Select the Target you want to from the “Embed in Companion Application” dropdown 5. Click finish 6. Write it

Next, when you’re ready to add the watch kit app to another target, just like the above create a new watch kit target (steps 1 – 5 from above).

Like before, this will create two new file groups (which will end with “WatchApp” and ” WatchApp Extension”). Next, delete all the files created with the possible exception of the the PLIST or assets folder in order to customise the app on a target by target basis.

Next, go into the file groups for the first Watch App. Set the target memberships to include the new target (with the possible exception of the PLIST and the assets folder).

You should now be able to build and the second target, using the code from the first target.