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

Make FlexiblePageControl properties customizable via UIAppearance #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bhr
Copy link

@bhr bhr commented Jun 4, 2020

The proposed changes allow FlexiblePageControl to be customizable via UIAppearance, for instance:

let config = FlexiblePageControl.Config(
	displayCount: 5,
	dotSize: 6,
	dotSpace: 4,
	smallDotSizeRatio: 0.5,
	mediumDotSizeRatio: 0.7
)
FlexiblePageControl.appearance().pageIndicatorTintColor = UIColor.systemGray
FlexiblePageControl.appearance().currentPageIndicatorTintColor = UIColor.systemBlue
FlexiblePageControl.appearance().setConfig(config)
  • Add @objc dynamic to setConfig(), pageIndicatorTintColor, currentPageIndicatorTintColor, animateDuration
  • Make Config class and inherit from NSObject.

- Add @objc dynamic to setConfig(), pageIndicatorTintColor, currentPageIndicatorTintColor, animateDuration
- Make Config class and inherit from NSObject.
@bhr
Copy link
Author

bhr commented Aug 3, 2020

I found an issue with the displayCount not updating properly.

The issue has been fixed in the second commit. displayCount needs to be updated when setting calling setConfig:

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

Successfully merging this pull request may close these issues.

None yet

1 participant