1

Link to BWWalkthrough library: https://github.com/ariok/BWWalkthrough

I'm new to iOS development (Swift 2.2, Xcode 7.3.1). I have walk through working for my App using library BWWalkthrough. When walkthrough page (Class BWWalkthroughPageViewController) is loaded, I want to auto play video on each page. Currently, I can add images, labels, buttons etc. using view scene in Main storyboard for walkthrough pages but how can I add video to these pages? Should I create "XViewController.swift" file for each of these pages to add video programmatically ? But how can I link these files with walkthrough pages ? Currently, pages are added to walkthrough as:

@IBAction func openInstrButtonPressed(){

    let stb = UIStoryboard(name: "Main", bundle: nil)
    walkthrough = stb.instantiateViewControllerWithIdentifier("container") as! BWWalkthroughViewController
    let page_one = stb.instantiateViewControllerWithIdentifier("instr_page1")
    let page_two = stb.instantiateViewControllerWithIdentifier("instr_page2")
    let page_three = stb.instantiateViewControllerWithIdentifier("instr_page3")
    let page_four = stb.instantiateViewControllerWithIdentifier("instr_page4")

    // Attach the pages to the master
    walkthrough.delegate = self
    walkthrough.addViewController(page_one)
    walkthrough.addViewController(page_two)
    walkthrough.addViewController(page_three)
    walkthrough.addViewController(page_four)

    self.presentViewController(walkthrough, animated: true) {
        ()->() in
        self.needWalkthrough = false
    }
}

Since walkthrough pages are using class "BWWalkthroughPageViewController", should I define a new class to add video programmatically?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
ios_mxe
  • 115
  • 2
  • 12

1 Answers1

0

Of Course, thats the only way to do it, create a new class, if you preffer create an View into (Ex. Storyboard) and add you video. I hope be useful.

OBS: If you know how edit classes of BWWalkthroughPageViewController you can create a specific modification to import videos.

  • Thanks! If I create a new "X.swift" view controller file for each of the walkthrough pages, how can I link it to walkthrough while adding pages ? – ios_mxe Aug 09 '16 at 17:54