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

Implementing this library in Swift 3 #9

Open
PrakashMaharjan opened this issue Aug 7, 2017 · 1 comment
Open

Implementing this library in Swift 3 #9

PrakashMaharjan opened this issue Aug 7, 2017 · 1 comment

Comments

@PrakashMaharjan
Copy link

hi,
can we implement this in swift?
I tried but could not get to load images from internet.

i added a UIView on storyboard and set its class to LCBannerView.

Then created outlet for the view as
@IBOutlet weak var lgAddBannerView: LCBannerView!

then on viewed load as below:

override func viewDidLoad() {
super.viewDidLoad()
self.lgAddBannerView.imageURLs = ["https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQUSaoTcU7EiRBKlB26__J_YhAXK5WUjffGO9lQZ5bHgJs5Boybzg",
"https://cdn.pixabay.com/photo/2016/05/04/15/52/cats-1371991_960_720.jpg", "http://image5.tuku.cn/wallpaper/Animal%20Wallpapers/5491_2560x1600.jpg"]
self.lgAddBannerView.currentPageIndicatorTintColor = UIColor.red
self.lgAddBannerView.pageIndicatorTintColor = UIColor.white
self.lgAddBannerView.pageDistance = 20
self.lgAddBannerView.frame = CGRect(x: 0, y:0, : width: screen width, height: 150)
}

But it dod not worked for me.
Is there any way to make it work with Swift 3?
Help would be appreciated.

Thanks

@iOSDevGarg
Copy link

iOSDevGarg commented Nov 2, 2017

Here I Have A demo Project Which Solve your Issue in Swift
Swift 4 Xcode 9.1
Used - In a normal View and In collectionView multiple times

Note:
Need to call the banner view in DidAppear instead of willAppear or DidLoad

Have a look at below Code File
Link - https://github.com/RockinGarg/LCBannerView-Swift4.git

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

No branches or pull requests

2 participants