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

Status bar throw error in ios #2299

Open
joebnb opened this issue Jan 21, 2025 · 0 comments
Open

Status bar throw error in ios #2299

joebnb opened this issue Jan 21, 2025 · 0 comments
Labels

Comments

@joebnb
Copy link

joebnb commented Jan 21, 2025

this line

import Foundation
import Capacitor

/**
 * StatusBar plugin. Requires "View controller-based status bar appearance" to
 * be "YES" in Info.plist
 */
@objc(StatusBarPlugin)
public class StatusBarPlugin: CAPPlugin, CAPBridgedPlugin {
    public let identifier = "StatusBarPlugin"
    public let jsName = "StatusBar"
    public let pluginMethods: [CAPPluginMethod] = [
        CAPPluginMethod(name: "setStyle", returnType: CAPPluginReturnPromise),
        CAPPluginMethod(name: "setBackgroundColor", returnType: CAPPluginReturnPromise),
        CAPPluginMethod(name: "show", returnType: CAPPluginReturnPromise),
        CAPPluginMethod(name: "hide", returnType: CAPPluginReturnPromise),
        CAPPluginMethod(name: "getInfo", returnType: CAPPluginReturnPromise),
        CAPPluginMethod(name: "setOverlaysWebView", returnType: CAPPluginReturnPromise)
    ]
    private var statusBar: StatusBar?    // not import
    private let statusBarVisibilityChanged = "statusBarVisibilityChanged"
    private let statusBarOverlayChanged = "statusBarOverlayChanged"

    override public func load() {
        guard let bridge = bridge else { return }
        statusBar = StatusBar(bridge: bridge, config: statusBarConfig())
    }

    private func statusBarConfig() -> StatusBarConfig {
        var config = StatusBarConfig()
        config.overlaysWebView = getConfig().getBoolean("overlaysWebView", config.overlaysWebView)
        if let colorConfig = getConfig().getString("backgroundColor"), let color = UIColor.capacitor.color(fromHex: colorConfig) {
            config.backgroundColor = color

    /@capacitor/status-bar/ios/Sources/StatusBarPlugin/StatusBarPlugin.swift:20:28:
        error: cannot find type 'StatusBar' in scope
        private var statusBar: StatusBar?
        ^~~~~~~~~
       /@capacitor/status-bar/ios/Sources/StatusBarPlugin/StatusBarPlugin.swift:29:39:
        error: cannot find type 'StatusBarConfig' in scope
        private func statusBarConfig() -> StatusBarConfig {
        ^~~~~~~~~~~~~~~
     /@capacitor/status-bar/ios/Sources/StatusBarPlugin/StatusBarPlugin.swift:125:33:
        error: cannot find type 'StatusBarInfo' in scope
        private func toDict(_ info: StatusBarInfo) -> [String: Any] {
        ^~~~~~~~~~~~~
        
        warning: Run script build phase '[CP] Embed Pods Frameworks' will be run during every build because
        it does not specify any outputs. To address this issue, either add output dependencies to the script
        phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the
        script phase. (in t
@ionitron-bot ionitron-bot bot added the triage label Jan 21, 2025
@joebnb joebnb changed the title Status bar throw error Status bar throw error in ios Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant