Advertisement
Don_Mag

Untitled

Jul 24th, 2024
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.78 KB | None | 0 0
  1. import UIKit
  2.  
  3. class SLNavigationViewController: UINavigationController {
  4.    
  5. }
  6.  
  7. class SLLoadingViewController: UIViewController {
  8.    
  9.     override func viewDidLoad() {
  10.         super.viewDidLoad()
  11.         view.backgroundColor = .systemYellow
  12.     }
  13.    
  14.     override func viewDidAppear(_ animated: Bool) {
  15.         super.viewDidAppear(animated)
  16.        
  17.         let nav = SLNavigationViewController()
  18.         let mainView = StoreViewController()
  19.         nav.navigationBar.frame.size = nav.navigationBar.sizeThatFits(CGSize(width: nav.navigationBar.frame.size.width, height: 2))
  20.         nav.viewControllers = [mainView]
  21.        
  22.         present(nav, animated: false, completion: nil)
  23.        
  24.     }
  25.    
  26. }
  27.  
  28. class StoreViewController: UIViewController {
  29.    
  30.     override func viewDidLoad() {
  31.         super.viewDidLoad()
  32.         view.backgroundColor = .systemGreen
  33.     }
  34.    
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement