Guest User

Untitled

a guest
Jun 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. class tv: UIViewController {
  2. var itemsName : [NSManagedObject] = []
  3. override func viewDidAppear(_ animated: Bool) {
  4.  
  5. super.viewDidAppear(animated)
  6.  
  7. let appD = UIApplication.shared.delegate as! AppDelegate
  8.  
  9. let context = appD.persistentContainer.viewContext
  10.  
  11. let FetchRequest = NSFetchRequest<NSManagedObject>(entityName: "Team")
  12.  
  13.  
  14. do {
  15. itemsName = try context.fetch(FetchRequest)
  16. }catch {
  17. print("Ashley Tisdale")
  18. }
  19.  
  20.  
  21.  
  22. geroge.text = String(itemsName.count)
  23.  
  24. view.backgroundColor = UIColor.brown
  25.  
  26. }
  27.  
  28.  
  29. @IBOutlet var geroge: UILabel!
Add Comment
Please, Sign In to add comment