AirPrint contents of a UIView
问题 I'm trying to set up printing through an iPad app, where clicking Print will print a view with all of its contents. Here's what I've tried (pulled together from a few examples online): // This is the View I want to print // Just a 200x200 blue square var testView = UIView(frame: CGRectMake(0, 0, 200, 200)) testView.backgroundColor = UIColor.blueColor() let printInfo = UIPrintInfo(dictionary:nil)! printInfo.outputType = UIPrintInfoOutputType.General printInfo.jobName = "My Print Job" // Set up