Skip to content

SWift 3 compatibility #1

@simplealina

Description

@simplealina

Hi there,

Thanks for the library. I've been trying all day to use it with Swift 3 but to no avail. The control does not display any of the items.

class BannerItem: NSObject, FPScrollingBannerItem {

    var bannerImage: UIImage!

    init(imageName: String) {

        self.bannerImage = UIImage(named: imageName)
    }

}

and:

scrollingBanner = FPScrollingBanner(frame: view.bounds)
        scrollingBanner.backgroundColor = UIColor.green()

        let arrayNames = ["paralaxtest_01", "paralaxtest_02","paralaxtest_03"]
        var arrayItems: [BannerItem] = []

        for name in arrayNames {
            let bannerItem: BannerItem = BannerItem(imageName: name)
            arrayItems.append(bannerItem)
        }

        scrollingBanner.delegate = self
        scrollingBanner.items = arrayItems

        view.addSubview(scrollingBanner)

All I can see in the end is the green background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions