thieumao

Những thứ cần thiết khi học lập trình iOS

Sep 15th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. Cơ bản: Action, Outlet, Closure (Block) -> Callback
  2. UITableView (indexPath), Custom
  3. UIWebView
  4. AutoLayout
  5. Vòng đời UIViewController, AppDelegate
  6.  
  7.  
  8. super.viewWillAppear(animated)
  9. self.navigationController?.navigationBarHidden = false
  10. let notificationCenter = NSNotificationCenter.defaultCenter()
  11. notificationCenter.addObserver(self, selector: #selector(handleKeyboardWillShowNotification(_:)), name: UIKeyboardWillShowNotification, object: nil)
  12. notificationCenter.addObserver(self, selector: #selector(handleKeyboardWillHideNotification(_:)), name: UIKeyboardWillHideNotification, object: nil)
  13.  
  14. profileSettingViewTable.reloadData()
  15. }
  16.  
  17. override func viewDidDisappear(animated: Bool) {
  18. super.viewDidDisappear(animated)
  19. let notificationCenter = NSNotificationCenter.defaultCenter()
  20. notificationCenter.removeObserver(self, name: UIKeyboardWillShowNotification, object: nil)
  21. notificationCenter.removeObserver(self, name: UIKeyboardWillHideNotification, object: nil)
  22. }
  23.  
  24.  
  25. func handleKeyboardWillShowNotification(notification: NSNotification) {
  26. if let userInfo = notification.userInfo where isHandleWhenShowKeyboard == true {
  27. if let keyboard = userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue{
  28. let keyBoardRect = keyboard.CGRectValue()
  29. let heightKeyboard = keyBoardRect.size.height
  30. let heightScreen = UIScreen.mainScreen().bounds.height
  31. // ...
  32. }
  33. }
  34. }
  35.  
  36. func handleKeyboardWillHideNotification(notification: NSNotification) {
  37. topTableViewConstraint.constant = 0
  38. }
  39.  
  40. Thư viện hay sử dụng: AFNetworking (Alamofire), SDWebImage
  41.  
  42. Project Example: https://github.com/framgia/fels_137/tree/develop
  43. https://viblo.asia/u/nguyen.van.thieub
  44.  
  45. Quản lý bộ nhớ: http://laptrinhios.vn/quan-ly-bo-nho-trong-ios-memory-management/
  46.  
  47. UIViewController Life Cycle https://i.stack.imgur.com/g19fw.png
  48. Application Life Cycle https://i.stack.imgur.com/URh6p.png
Advertisement
Add Comment
Please, Sign In to add comment