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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions FlexiblePageControl/FlexiblePageControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class FlexiblePageControl: UIView {

// MARK: public

public struct Config {
@objc public class Config: NSObject {

public var displayCount: Int
public var dotSize: CGFloat
Expand All @@ -37,12 +37,13 @@ public class FlexiblePageControl: UIView {

private var config = Config()

public func setConfig(_ config: Config) {
@objc dynamic public func setConfig(_ config: Config) {

self.config = config

invalidateIntrinsicContentSize()


displayCount = min(config.displayCount, numberOfPages)
update(currentPage: currentPage, config: config)
}

Expand All @@ -67,19 +68,19 @@ public class FlexiblePageControl: UIView {
}
}

public var pageIndicatorTintColor: UIColor = UIColor(red: 0.86, green: 0.86, blue: 0.86, alpha: 1.00) {
@objc dynamic public var pageIndicatorTintColor: UIColor = UIColor(red: 0.86, green: 0.86, blue: 0.86, alpha: 1.00) {
didSet {
updateDotColor(currentPage: currentPage)
}
}

public var currentPageIndicatorTintColor: UIColor = UIColor(red: 0.32, green: 0.59, blue: 0.91, alpha: 1.00) {
@objc dynamic public var currentPageIndicatorTintColor: UIColor = UIColor(red: 0.32, green: 0.59, blue: 0.91, alpha: 1.00) {
didSet {
updateDotColor(currentPage: currentPage)
}
}

public var animateDuration: TimeInterval = 0.3
@objc dynamic public var animateDuration: TimeInterval = 0.3

public var hidesForSinglePage: Bool = false {
didSet {
Expand Down