LeoNatan / LNPopupController

A framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
MIT License
3.04k stars 342 forks source link

Issue with the tint of progressView and button #446

Closed leogiroux closed 3 years ago

leogiroux commented 3 years ago

Hello @LeoNatan

There is a little bug with the tint of progressView and button when presenting a UIViewController modally. appearanceProxy.tintColor = .yellow is not set and the color is blue by default instead of the yellow.

This is the appearanceProxy init inside an UITabBarController

Capture d’écran 2021-06-03 à 11 19 30

This how I present the controller with the bug

Capture d’écran 2021-06-03 à 11 21 11

this the expected result

Capture d’écran 2021-06-03 à 11 21 37

This is the controller with the bug

Capture d’écran 2021-06-03 à 11 30 52

Thanks for your help :)

LeoNatan commented 3 years ago

Thanks, I will take a look soon.

LeoNatan commented 3 years ago

You are using the appearance API incorrectly. appearanceProxy.progressView.tintColor is not a correct syntax that the UIKit system can work with. Instead, you should create an appearance proxy for the progress view, and set that tint color.

let progressViewAppearanceProxy = UIProgressView.appearance(whenContainedInInstancesOf: [LNPopupBar.self, UIViewController.self])
progressViewAppearanceProxy.tintColor = .white