added more sample code illustrating usage with a UIFragment