Latest 0.1.9
Homepage https://github.com/YK-Unit/SnapshotKit
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

A Kit that can make UIView/UIWindow/UIScrollView/UITableView/UIWebView/WKWebView to easily take snapshot image of visible or full content.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

UIView Example

func uiView_takeSnapshotOfVisibleContent() {
    let image = self.view.takeSnapshotOfVisibleContent()
    // edit image 
}

func uiView_sync_takeSnapshotOfFullContent() {
    let image = self.view.takeSnapshotOfFullContent()
    // edit image 
}

func uiView_async_takeSnapshotOfFullContent() {
    self.view.takeScreenshotOfFullContent { (image) in
      // edit image 
    }
}

UIScrollView Example

private func takeSnapshotOfVisibleContent() {
    let image = self.scrollView.takeSnapshotOfVisibleContent()
    // edit image
}

private func sync_takeSnapshotOfFullContent() {
    let image = self.scrollView.takeSnapshotOfFullContent()
    // edit image
}

private func async_takeSnapshotOfFullContent() {
    self.scrollView.takeScreenshotOfFullContent { (image) in
      // edit image
    }
}

UITableView Example

func uiTableView_takeSnapshotOfVisibleContent() {
    let image = self.tableView.takeSnapshotOfVisibleContent()
    // edit image
}

func uiTableView_sync_takeSnapshotOfFullContent() {
    let image = self.tableView.takeSnapshotOfFullContent()
    // edit image
}

func uiTableView_async_takeSnapshotOfFullContent() {
    self.tableView.takeScreenshotOfFullContent { (image) in
      // edit image
    }
}

UIWebView/WKWebView Example

private func takeSnapshotOfVisibleContent() {
    let image = self.webView.takeSnapshotOfVisibleContent()
    // edit image
}

private func sync_takeSnapshotOfFullContent() {
    let image = self.webView.takeSnapshotOfFullContent()
    // edit image
}

private func async_takeSnapshotOfFullContent_bySpliter() {
    self.webView.scrollView.takeScreenshotOfFullContent { (image) in
      // edit image
    }
}

private func async_takeSnapshotOfFullContent_byPrinter() {
    self.webView.takeScreenshotOfFullContent { (image) in
      // edit image
    }
}

Installation

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

pod 'SnapshotKit'

License

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

Latest podspec

{
    "name": "SnapshotKit",
    "version": "0.1.9",
    "summary": "UIView/UIWindow/UIScrollView/UITableView/UIWebView/WKWebView Extension to easily take snapshot image of visible or full content.",
    "description": "A Kit that can make UIView/UIWindow/UIScrollView/UITableView/UIWebView/WKWebView to easily take snapshot image of visible or full content.",
    "homepage": "https://github.com/YK-Unit/SnapshotKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "York": "[email protected]"
    },
    "source": {
        "git": "https://github.com/YK-Unit/SnapshotKit.git",
        "tag": "0.1.9"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SnapshotKit/Classes/**/*"
}

Pin It on Pinterest

Share This