translated first chapter 9 example to swift, adopting new iOS 8 popover API