Xcode Instruments and DYLD_PRINT_STATISTICS are very useful but sometimes you need to visually confirm the data you want has been displayed on the screen when measuring times.

Some video analyzing tools can be helpful in that case. Most of them provide slow-motion play back control, side-by-side video comparison which are quite helpful to checking the optimization result.

Some of the apps are:

  • CMV: Slow Frame-Frame Video Analysis (free, last update 14 Dec 2016)
  • Hudl Technique: Slow Motion Video Analysis (free, register needed, last update 16 Dec 2016)
  • Slowmo — Slow Motion Video Analysis (free, last update 12 Nov 2016) — there seems to be a bug in synchronizing two videos

Screenshot from Hudl:

Here are some tips as the official Amazon IoT github repository (https://github.com/awslabs/aws-sdk-ios-samples/tree/master/IoT-Sample/Swift/) is not updated regularly.

  • To play the IoT iOS samples on iOS 10+ with Xcode 8, the readme is not clear enough to guide you through, plus some changes on the iOS side if you are a new comer it would take you some time to get it up and running. Check the tips I reported in an issue about how to make the IoT Sample app working: https://github.com/awslabs/aws-sdk-ios-samples/issues/132

Sometimes it’s useful to know which other method calls your method and it’s easy to do so in Objective C.

#include <execinfo.h>

void *addr[2];
int nframes = backtrace(addr, sizeof(addr)/sizeof(*addr));
if (nframes > 1) {
char **syms = backtrace_symbols(addr, nframes);
NSLog(@"%s: caller: %s", __func__, syms[1]);
} else {
NSLog(@"%s: *** Failed to generate backtrace.", __func__);

You can change the size of the array to print deeper levels.

From http://stackoverflow.com/questions/4046833/print-the-name-of-the-calling-function-to-the-debug-log

It’s kind of ridiculous that the swift libraries take 99% percentage of the package size. My iMessage extension is about 200K but the swift libraries are about 70M.

It’s a pain when everybody is trying to upload new builds to iTunes store before a major iOS release.

Why can’t at least the swift libraries are put in the package on the iTunes server if they must be bundled with the app?

Recently I found when working with a slightly problematic peripheral, after calling cancelPeripheralConnection, CoreBluetooth does not call didDisconnectPeripheral or didFailToConnectPeripheral as mentioned in the documentation, which seems to indicate that CoreBluetooth is actually waiting for something to happen between the peripheral and itself…

The workaround is to start a guard timer to ensure we can deliver a disconnected notification to the UI layer :D




iOS Developer & Bluetooth LE Veteran

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store