Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. @IBAction func action(sender: UIButton!) {
  2.  
  3. let stringAttributes = [
  4. NSFontAttributeName: UIFont.boldSystemFontOfSize(14.0),
  5. NSBackgroundColorAttributeName: UIColor.redColor(),
  6. ]
  7. let attributedString = NSMutableAttributedString(string: "Hello world!", attributes: stringAttributes)
  8.  
  9. let string: String = {
  10. let s = String(attributedString)
  11. return s
  12. }()
  13.  
  14. let pasteboard = UIPasteboard.generalPasteboard()
  15. pasteboard.string = string
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement