diff --git a/Sources/Gallery/GalleryController.swift b/Sources/Gallery/GalleryController.swift index f442b066..de536edf 100644 --- a/Sources/Gallery/GalleryController.swift +++ b/Sources/Gallery/GalleryController.swift @@ -41,7 +41,7 @@ public class GalleryController: UIViewController, PermissionControllerDelegate { } public override var prefersStatusBarHidden : Bool { - return true + return Config.showStatusBar } // MARK: - Child view controller @@ -75,6 +75,9 @@ public class GalleryController: UIViewController, PermissionControllerDelegate { let useCamera = Permission.Camera.needsPermission && Permission.Camera.status == .authorized let tabsToShow = Config.tabsToShow.compactMap { $0 != .cameraTab ? $0 : (useCamera ? $0 : nil) } + if useCamera, Permission.Camera.status == .notDetermined { + return nil + } let controllers: [UIViewController] = tabsToShow.compactMap { tab in if tab == .imageTab { diff --git a/Sources/Utils/Config.swift b/Sources/Utils/Config.swift index 07dbc955..dfda421b 100644 --- a/Sources/Utils/Config.swift +++ b/Sources/Utils/Config.swift @@ -22,7 +22,8 @@ public struct Config { public static var tabsToShow: [GalleryTab] = [.imageTab, .cameraTab, .videoTab] // Defaults to cameraTab if present, or whatever tab is first if cameraTab isn't present. public static var initialTab: GalleryTab? - + public static var showStatusBar: Bool = false + public enum GalleryTab { case imageTab case cameraTab