NavViewController

class NavViewController : UINavigationController, PlayerViewControllerDelegate, SettingsViewControllerDelegate

This is a controller used to control the initial view

Properties

  • Player View is displayed when a content is tapped

    Declaration

    Swift

    @IBOutlet
    var playerView: PlayerView!
  • Search View will show up if you press the search button

    Declaration

    Swift

    @IBOutlet
    var searchView: SearchView!
  • Setting View will show up if you press the setting button

    Declaration

    Swift

    @IBOutlet
    var settingsView: SettingsView!
  • Login View will show up if you press the login button

    Declaration

    Swift

    @IBOutlet
    var loginView: LoginView!
  • The title of the page

    Declaration

    Swift

    let titleLabel: UILabel
  • Page names

    Declaration

    Swift

    let names: [String]
  • The origin point of playerview

    Declaration

    Swift

    let hiddenOrigin: CGPoint
  • The origin point of playerview after the minimized prossses is operated

    Declaration

    Swift

    let minimizedOrigin: CGPoint
  • The origin point when full screen mode

    Declaration

    Swift

    let fullScreenOrigin: CGPoint

Methods

  • Customise View

    • Setup NavigationBarButtons
    • Setup TitleLable
    • Setup Login View
    • Setup Search View
    • Setup Setting View
    • Setup Notification Centre

    Declaration

    Swift

    func customisation()
  • Show Search View

    Declaration

    Swift

    @objc
    func showSearch()
  • Show Setting view

    Declaration

    Swift

    @objc
    func showSettings()
  • Show login view

    Declaration

    Swift

    func showLogin()
  • Change th title

    Declaration

    Swift

    @objc
    func changeTitle(notification: Notification)
  • Animate to the state of the viewController

    Usage Example:

    let content = NaviViewController.animatePlayView(.hidden)
    
    

    Declaration

    Swift

    func animatePlayView(toState: stateOfViewController)

    Parameters

    toState

    fullScreen, minimized, hidden

  • Detect the swipe position

    Declaration

    Swift

    func positionDuringSwipe(scaleFactor: CGFloat) -> CGPoint
  • Set prefer status bar Hidden

    Declaration

    Swift

    func setPreferStatusBarHidden(_ preferHidden: Bool)
  • True if the Content is hidden

    Declaration

    Swift

    var isHidden: Bool { get set }

Delegate

ViewController lifecycle

  • Called after the controller'€™s view is loaded into memory.

    Declaration

    Swift

    override func viewDidLoad()
  • Deinit

    Declaration

    Swift

    deinit
  • Notifies the view controller that its view was added to a view hierarchy.

    Declaration

    Swift

    override func viewDidAppear(_: Bool)