Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ability to customize statusBarStyle #164

Merged
merged 1 commit into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ class CoachMarksViewController: UIViewController {

///
weak var delegate: CoachMarksViewControllerDelegate?

///
var statusBarStyle:UIStatusBarStyle = .default

///
override var preferredStatusBarStyle : UIStatusBarStyle {
return statusBarStyle
}

// MARK: - Private properties
fileprivate var onGoingSizeChange = false
Expand All @@ -92,7 +100,6 @@ class CoachMarksViewController: UIViewController {
fileprivate var _shouldAutorotate: Bool = true
fileprivate var _prefersStatusBarHidden: Bool = false
fileprivate var _supportedInterfaceOrientations: UIInterfaceOrientationMask = [.portrait]

// MARK: - Lifecycle
convenience init(coachMarkDisplayManager: CoachMarkDisplayManager,
skipViewDisplayManager: SkipViewDisplayManager) {
Expand Down
11 changes: 11 additions & 0 deletions Sources/Instructions/Core/Public/CoachMarksController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ public class CoachMarksController {
/// be called at various points.
public weak var delegate: CoachMarksControllerDelegate?

/// Controls the style of the status bar when coach marks are displayed
public var statusBarStyle:UIStatusBarStyle {
set(value) {
coachMarksViewController.statusBarStyle = value
coachMarksViewController.setNeedsStatusBarAppearanceUpdate()
}
get {
return coachMarksViewController.statusBarStyle
}
}

/// Hide the UI.
fileprivate(set) public lazy var overlay: OverlayManager = {
let overlay = OverlayManager()
Expand Down