Search code examples
iosobjective-cswiftcocoaslideshow

Cannot load images from KASlideShow pod


Im just starting out with Swift and IOS development so I think Im missing something obvious to make the pod below work

I am using the cocoa pod for KASlideShow : https://github.com/kirualex/KASlideShow in my Swift Project. The cocoa pod enables me to build an easy slideshow

I seemed to have loaded the pod correctly since I can access the methods and instantiate objects in my target ViewController

However I can't get the actual images to load, and I seemed to have covered all the steps necessary to get it to start a slideshow

Here's the code from my target ViewController

class SShowViewController: UIViewController, KASlideShowDelegate {



override func viewDidLoad() {
    super.viewDidLoad()

    let ss = KASlideShow(frame: CGRectMake(0, 0, 320, 250))
    ss.delegate = self
    ss.delay = 3
    ss.transitionDuration = 1
    ss.transitionType = KASlideShowTransitionType.Slide
    ss.imagesContentMode = UIViewContentMode.ScaleAspectFill
    ss.addImagesFromResources(["cat.jpeg", "oldyoung.jpg"])
    ss.start()
    print("Slidshow over?")
    // Do any additional setup after loading the view.
}

Any ideas??


Solution

  • Aha!

    I have it working now. I was just missing a addSubView call. So this one line brings up the slideshow

            self.view.addSubview(ss)