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

Part of the UI control localizeKey is missing. #155

Open
CainLuo opened this issue Nov 25, 2020 · 2 comments
Open

Part of the UI control localizeKey is missing. #155

CainLuo opened this issue Nov 25, 2020 · 2 comments

Comments

@CainLuo
Copy link

CainLuo commented Nov 25, 2020

// MARK: UITextField
@IBDesignable public extension UITextField {
    @IBInspectable var placeholderLocalizeKey: String {
        set {
            DispatchQueue.main.async {
                self.placeholder = newValue.localized()
            }
        }
        get {
            return self.placeholderLocalizeKey.localized()
        }
    }
}

// MARK: UIBarButtonItem
@IBDesignable public extension UIBarButtonItem {
    @IBInspectable var localizeKey: String {
        set {
            DispatchQueue.main.async {
                self.title = newValue.localized()
            }
        }
        get {
            return self.localizeKey.localized()
        }
    }
}

Part of the UI control localizeKey is missing, the code is above, can we add it in the next version?

And is there something unreasonable about the localizeKey setting of the UIButton? For example, I need to set the localizeKey for UIButton's highlighted state, which is not provided.

@CainLuo
Copy link
Author

CainLuo commented Nov 30, 2020

// MARK: UIBarButtonItem
@IBDesignable public extension UIViewController {
    @IBInspectable var localizeKey: String {
        set {
            DispatchQueue.main.async {
                self.title = newValue.localized()
            }
        }
        get {
            return self.localizeKey.localized()
        }
    }
}

@CainLuo
Copy link
Author

CainLuo commented Nov 30, 2020

@marmelroy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant