Skeletonview: Can you make compatibility with the objective-c based project?

Created on 21 Dec 2017  路  2Comments  路  Source: Juanpe/SkeletonView

Most helpful comment

I had same issue so i write a simple extension in swift and make those method accessable in Objective c.

Something like this

extension UIView {

   @objc public func showWaitingLoader() {

        let gradient = SkeletonGradient(baseColor: UIColor(red:0.9, green:0.9, blue:0.9, alpha:1))
        let animation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: GradientDirection.leftRight)
        self.showAnimatedGradientSkeleton(usingGradient: gradient, animation: animation)
    }

    @objc public func hideWaitingLoader(){

        self.hideSkeleton(reloadDataAfter: true)
    }
}

All 2 comments

I had same issue so i write a simple extension in swift and make those method accessable in Objective c.

Something like this

extension UIView {

   @objc public func showWaitingLoader() {

        let gradient = SkeletonGradient(baseColor: UIColor(red:0.9, green:0.9, blue:0.9, alpha:1))
        let animation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: GradientDirection.leftRight)
        self.showAnimatedGradientSkeleton(usingGradient: gradient, animation: animation)
    }

    @objc public func hideWaitingLoader(){

        self.hideSkeleton(reloadDataAfter: true)
    }
}

thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GauravTechbirds picture GauravTechbirds  路  4Comments

guidev picture guidev  路  4Comments

raphaklr picture raphaklr  路  5Comments

mohpor picture mohpor  路  6Comments

moray95 picture moray95  路  5Comments