corin8823 / Popover

Popover is a balloon library like Facebook app. It is written in pure swift.
MIT License
2.11k stars 327 forks source link

text in Label #16

Closed zenithscholar closed 8 years ago

zenithscholar commented 8 years ago

which easiest way to put text inside the label? Thanks!

corin8823 commented 8 years ago

Do you want to implement like screen shot? 2016-03-27 12 22 50

@IBAction func tappedRightBarButton(sender: UIBarButtonItem) {
  let startPoint = CGPoint(x: self.view.frame.width - 60, y: 55)
  let label = UILabel(frame: CGRect(x: 0, y: 0, width: self.view.frame.width / 2, height: 50))
  label.text = "popover"
  label.textAlignment = .Center
  let popover = Popover()
  popover.show(label, point: startPoint)
}
zenithscholar commented 8 years ago

thank you so much! very useful.