copied osx example to ios.