Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. import UIKit
  2. import PlaygroundSupport
  3.  
  4. class MyViewController : UIViewController {
  5. override func loadView() {
  6. let view = UIView()
  7. view.backgroundColor = .white
  8.  
  9. let textView = UITextView()
  10. textView.backgroundColor = UIColor.lightGray
  11. textView.translatesAutoresizingMaskIntoConstraints = false
  12. textView.isScrollEnabled = false
  13.  
  14. textView.text = """
  15. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  16. """
  17.  
  18. view.addSubview(textView)
  19. textView.topAnchor.constraint(equalTo: view.topAnchor, constant: 88.0).isActive = true
  20. textView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16.0).isActive = true
  21. textView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -16.0).isActive = true
  22. self.view = view
  23. }
  24. }
  25. // Present the view controller in the Live View window
  26. PlaygroundPage.current.liveView = MyViewController()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement