ChiliLabs / CHIPageControl

A set of cool animated page controls written in Swift to replace boring UIPageControl. Mady by @ChiliLabs - https://chililabs.io
MIT License
3.34k stars 256 forks source link

Objective C #38

Open roarapps opened 6 years ago

roarapps commented 6 years ago

Hello,

Have successfully added this control to an Obj C project but am unable to see the func set(progress: Int, animated: Bool) from my class.

Is this a limitation or is there workaround to get the control to animate?

Heisenbean commented 5 years ago

get same problem

MichaelDanielTom commented 5 years ago

There's probably a better way of doing this, but I made a swift extension with an @objc annotation, and a wrapper function:

import CHIPageControl

@objc extension CHIBasePageControl {
    func animate(progress: NSInteger, animated: Bool) {
        self.set(progress: progress, animated: animated)
    }
}

You could also go into CHIBasePageControl.swift and add the @objc annotation to set(progress: Int, animated: Bool)