Closed HamdyAli closed 6 years ago
The whole code looks like this: `import UIKit import ZKCarousel
class ViewController: UIViewController {
let carousel : ZKCarousel = {
let carousel = ZKCarousel()
// Create as many slides as you'd like to show in the carousel
let slide = ZKCarouselSlide(image: UIImage(), title: "Hello There 👻", description: "Welcome to the ZKCarousel demo! Swipe left to view more slides!")
let slide1 = ZKCarouselSlide(image: UIImage(), title: "A Demo Slide ☝🏼", description: "lorem ipsum devornum cora fusoa foen sdie ha odab ebakldf shjbesd ljkhf")
let slide2 = ZKCarouselSlide(image: UIImage(), title: "Another Demo Slide ✌🏼", description: "lorem ipsum devornum cora fusoa foen ebakldf shjbesd ljkhf")
// Add the slides to the carousel
carousel.slides = [slide, slide1, slide2]
return carousel
}()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.carousel.frame = CGRect()
view.addSubView(self.carousel)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}`
Change this view.addSubView(self.carousel) into --> self.view.addSubview(self.carousel) The letter V should be v.
Did @thewozz answer your problem?
Closing due to inactivity. If your issue persists, please open another one.
I copied the usage code as shown in the instructions but when I build it returns the error "Value of type 'UIView' has no member 'addSubView'". I'm currently using Xcode 9.3 with Swift 4.