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

How to have placeholder with mandatory symbol * #343

Open
arishanapalli opened this issue Dec 28, 2022 · 1 comment
Open

How to have placeholder with mandatory symbol * #343

arishanapalli opened this issue Dec 28, 2022 · 1 comment

Comments

@arishanapalli
Copy link

How to have SkyFloatingLabelTextField with mandatory symbols * with red colour.
Placeholder text is "Enter your password *", The * should be in different colour?

@ronak-selldo
Copy link

You can use this

        let placeholderAttriburedString = NSMutableAttributedString(string: "Email")
        if let isRequired = dataSource["required"] as? Bool, isRequired {
            let asterix = NSAttributedString(string: " *", attributes: [.foregroundColor: UIColor.red])
            placeholderAttriburedString.append(asterix)
        }
        self.textField.attributedPlaceholder = placeholderAttriburedString

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

2 participants