Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func action(sender: UIButton!) {
- let stringAttributes = [
- NSFontAttributeName: UIFont.boldSystemFontOfSize(14.0),
- NSBackgroundColorAttributeName: UIColor.redColor(),
- ]
- let attributedString = NSMutableAttributedString(string: "Hello world!", attributes: stringAttributes)
- let string: String = {
- let s = String(attributedString)
- return s
- }()
- let pasteboard = UIPasteboard.generalPasteboard()
- pasteboard.string = string
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement