I am trying to present a quote using a presented from the uipresentationcontroller api view but it is not working. What am I doing wrong? also, how do I resize the presented view dynamically to fit the text? Thanks.
this is my code:
override func presentationTransitionWillBegin() {
presentedView()!.layer.cornerRadius = 15.0
//adding label for quote to the presented view
let label = UILabel(frame: CGRectMake(presentedView()!.frame.origin.x, presentedView()!.frame.origin.y, presentedView()!.bounds.width, presentedView()!.bounds.height))
label.center = presentedView()!.center
label.textAlignment = NSTextAlignment.Center
label.text = readQuotesFromLibrary()
presentedView()?.addSubview(label)
//rest of the code dealing with uipresentationcontroller goes here ...