Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewController.swift
- // iOS MVVM
- //
- // Created by Mengheang Rat on 12/16/18.
- // Copyright © 2018. All rights reserved.
- //
- import UIKit
- class ViewController: UIViewController, OrientationMaskable {
- // Mark: you have to with OrientationMaskable protocol
- var appDelegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view.
- }
- override func viewWillAppear(_ animated: Bool) {
- // you want to rotation up down, portrait when you are in video player view (Facebook)
- self.orientationAll()
- }
- override func viewDidDisappear(_ animated: Bool) {
- // you want to lock rotation to portrait only when you go back to another view
- self.orientationPortrait()
- }
- }
Add Comment
Please, Sign In to add comment