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

Colors of 'Cancel' and 'Done' buttons #459

Closed
dvdblk opened this issue Dec 20, 2020 · 1 comment
Closed

Colors of 'Cancel' and 'Done' buttons #459

dvdblk opened this issue Dec 20, 2020 · 1 comment
Assignees
Labels

Comments

@dvdblk
Copy link

dvdblk commented Dec 20, 2020

First of all, thanks for this pod Tim!

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Possibility (public API) to set the color of 'Cancel' and 'Done' buttons.

Describe alternatives you've considered
Currently I am using a hacky solution that subclasses CropViewController and changes the title colors of TOCropToolbar's subviews in case they are of type UIButton.

class CustomCropViewController: CropViewController {

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        toolbar.subviews.map({ ($0 as? UIButton) }).forEach({ $0?.setTitleColor(.blue, for: .normal) })
    }
}

Additional context
I get that you wanted the same color Apple is using in Photos but it would be nice to have an option to change it. 😅

@dvdblk
Copy link
Author

dvdblk commented Dec 23, 2020

I just noticed that there is a public API for changing the color. I didn't notice them at first, but the buttons are accessible directly from the toolbar. 🙂

toolbar.cancelTextButton.setTitleColor(.primary, for: .normal)
toolbar.doneTextButton.setTitleColor(.primary, for: .normal)

Closing.

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

2 participants