페이지

2020년 1월 31일 금요일

How to install old OSX ( El Capitan )

1. download El capitan OSX


https://support.apple.com/en-us/HT206886

* execute Install dmg and install.pkcg file. and "Install El capitan.app" file  will be placed in /Applications/


2. create a bootable usb from "Install El capitan.app" 


https://support.apple.com/en-me/HT201372


3. Install OSX


if error message "This copy of the install OS X ... application can't be verified. It may have been corrupted or tampered with during downloading." occur during installing osx,
check your system date on your mac.




* checking date
Open Terminal and Type date

if date is not current time, change date.




* change date
type date month day time minute year

date 0201010120

2/1/2020, 01:01

2020년 1월 14일 화요일

rootViewController is the first ViewController on Application stack


var firstNavigationController = UINavigationController(rootViewController: self.mainViewController )
window?.rootViewController = firstNavigationController


PopupViewController #3 : PopupViewController Style

override func viewWillAppear(_ animated: Bool) {

    super.viewWillAppear(animated)
    self.view.backgroundColor = UIColor(white: 0, alpha: 0.5)
    self.modalTransitionStyle = .crossDissolve
    self.modalPresentationStyle = .overCurrentContext
}

Add InitViewController

In App executing at first time, app sometimes have lots of tasks.


  • splash view showing
  • check app version
  • load app significant values from UserStandard or local storage
  • showing app usage info popup view ( it's a one-off )
  • locked screen for log-in
  • and so on
  • splash view hiding


class AppDelegate: UIResponder, UIApplicationDelegate {
    var window :UIWindow?
    var naviController :UINavigationController?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        naviController = window?.rootViewController as? UINavigationController ;
        showSplash()
    }

    func showSplash(){
        let vc = UIViewController.instantiateViewController(storyboard: "Sotryboard", viewController: "\(InitViewController.self)" )
        window?.rootViewController = vc;
    }

}





class InitViewController: UIViewController{
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        checkInit()
    }


    func checkInit(){
        Async.serial(tasks: [
        {  done in
            task1 {
                done(nil)
            }
        }
        ,
        { done in
            task2 {
                done(nil)
            }
        }
        ,
        { done in
            //chage rootViewController.
            UIApplication.appDelegate?.window?.rootViewController = UIApplication.appDelegate?.naviController
            self.dismiss(animated: true, completion: {
                    done(nil)
            })
        }

    }

}



PopupViewController #2 : PopupViewController must check if another popupView is presenting


if let vc = UIApplication.rootViewController?.presentedViewController {
    vc.dismiss(animated: false) {
        UIApplication.rootViewController?.present( myPopupVc, animated: true, completion: nil )
    }
} else {
    UIApplication.rootViewController?.present( myPopupVc, animated: true, completion: nil)
}

PopupViewController #1 : use rootViewController.present when presenting Pop Up ViewController

When we are going to show Custom Popup Style ViewController, It's good to use rootViewController.present(,,,, )  method.

.rootViewController?.present( myPopupViewController, animated: true, completion: nil )

Reason 1.

self.present( myPopupViewController, animated: true, completion: nil )
    //self : SomeViewController


if self(SomeViewController) has dismissed while presenting myPopupViewController, myPopupViewController also will be dismissed without user's interaction.