Skip to content

iOS UI library for viewing slides inspired by SlideShare iOS App.

License

Notifications You must be signed in to change notification settings

abeyuya/SlideViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlideViewer

iOS UI library for viewing slides inspired by SlideShare iOS App.

screenshot

  • UI is very similar to SlideShare iOS App.
  • Accept date sources:
    • array of image url
    • url of pdf file
    • bundle pdf file
  • Corresponds to both portrait and landscape.

Installation

CocoaPods

  • require swift4.2
  pod 'SlideViewer', git: 'https://github.com/abeyuya/SlideViewer'

Getting Started

with Array of image URL

let mainImageURLs = [0, 1, 2, 3, 4, 5].map { i -> URL in
    let str = [
        "https://speakerd.s3.amazonaws.com/presentations/50021f75cf1db900020005e7/",
        "preview_slide_\(i).jpg?1362165300"
        ].joined(separator: "")

    return URL(string: str)!
}

let thumbImageURLs = [0, 1, 2, 3, 4, 5].map { i -> URL in
    let str = [
        "https://speakerd.s3.amazonaws.com/presentations/50021f75cf1db900020005e7/",
        "thumb_slide_\(i).jpg?1362165300"
        ].joined(separator: "")

    return URL(string: str)!
}

let v = SlideViewerController.setup(mainImageURLs: mainImageURLs, thumbImageURLs: thumbImageURLs)
present(v, animated: true)

with URL of PDF file

let pdfURL = "https://speakerd.s3.amazonaws.com/presentations/50021f75cf1db900020005e7/speakerdeck.pdf"
let v = SlideViewerController.setup(pdfFileURL: URL(string: pdfURL)!)
present(v, animated: true, completion: nil)

with Bundle PDF file

let path = Bundle.main.path(forResource: "speakerdeck", ofType: "pdf")
let url = URL(fileURLWithPath: path!)
let doc = PDFDocument(url: url)
let v = SlideViewerController.setup(pdfDocument: doc!)
present(v, animated: true)

All of sample codes are here. https://github.com/abeyuya/SlideViewer/blob/master/Example/PDFSlideView/ViewController.swift

About

iOS UI library for viewing slides inspired by SlideShare iOS App.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published