Latest 1.2.0
Homepage https://github.com/myoungsc/SCWebPreview
License MIT
Platforms ios 9.0
Authors

CI Status
Version
License
Platform

Description

A library that get metadata(og:url, og:image, og:title, og:description) for previewing via Web in HTML.

How to use (http://)
Add "App Transport Security Setting-Allow Arbitrary Loads-YES" in polist file

ScreenShot

SCWebPreview

Requirements

* Swift 5.0
* XCode 10.2
* iOS 9.0 (Min SDK)

Installation

SCWebPreview is available through CocoaPods. To install
it, simply add the following line to your Podfile:

//Add Podfile
pod "SCWebPreview" //Swift 5.0
pod "SCWebPreview", '~> 1.1.0' //Swift 4.2
pod "SCWebPreview", '~> 1.0.0' //Swift 4.0

//After
pod install

How To Use

  • Get metadata from web in HTML
import SCWebPreview

let webPages: [String] = ["https://github.com/myoungsc", "http://devsc.tistory.com/"]
let scWebPreview = SCWebPreview()
scWebPreview.initWebPages(webPages)
scWebPreview.startCrawling(){
    for i in 0 ..< webPages.count {
        let dic = self.scWebPreview.getPreviewDataFromIndex(i)
        guard dic.count != 0 else {
            print("error: dic is optionl Value")
            return
        }
        //doSomething
    }
}
  • example: get date form index
let dicWebData: [String: String] = scWebPreview.getPreviewDataFromIndex(0)

print("og:url - (dicWebData["og:url"]!)")
print("og:url - (dicWebData["og:title"]!)")
print("og:url - (dicWebData["og:description"]!)")
print("og:url - (dicWebData["og:image"]!)")
  • example: url open safari
scWebPreview.openSafariFromUrl(0)

Author

myoung

HomePage

[email protected]

License

SCWebPreview is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SCWebPreview",
    "version": "1.2.0",
    "summary": "Preview content in Website:)",
    "description": "Preview content in Website",
    "homepage": "https://github.com/myoungsc/SCWebPreview",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "myoungsc": "[email protected]"
    },
    "source": {
        "git": "https://github.com/myoungsc/SCWebPreview.git",
        "tag": "1.2.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "SCWebPreview/Classes/**/*",
    "swift_version": "5.0"
}

Pin It on Pinterest

Share This