Giter VIP home page Giter VIP logo

swviewcapture's Introduction

SwViewCapture

A nice iOS View Capture Library which can capture all content.

SwViewCapture could convert all content of UIWebView to a UIImage.

一个用起来还不错的iOS截图库.(支持截取所有内容, 适用于所有ScrollView组成的视图, 包括WebView)

SwViewCapture支持截取网页以及ScrollView的所有内容

Version License Platform

Example

Feature

  1. API is more easy to use.
    • use swift extension
  2. Support to capture all content of scrollView.
    • eg: UIScrollView, UITableView, UIWebView
  3. Support capture WKWebView.
    • WKWebview is hard to capture;
    • Screenshots of WKWebview's content isn't good now
  4. Flasing will not appear in the process of Screenshots.
    • SwCaptureView use a fake screenshots as a cover which over target view. All the action of target will be hidden below the fake screenshots.

###功能

  1. API更容易使用.

    • 使用Extension去封装API
  2. 支持截取滚动视图内的所有内容.

    • 支持UIScrollView, UITableView, UIWebView
  3. 支持截取WKWebView的内容.

    • 因为WKWebView的内部实现问题, WKWebView比较难去截屏
    • 目前SwViewCapture对WKWebView的截屏也不完美, 还存在一些瑕疵, 尤其表现在CSS样式为position: absolute;的元素上。
  4. 截图过程中不会出现视图闪烁.

    • 截图过程中, 使用一张伪装截图遮盖屏幕, 底层截图活动不透明化。

Usage

  1. Capture basic screenshots (size of view's frame)
import SwViewCapture
// ...
view.swCapture { (capturedImage) -> Void in
	// capturedImage is a UIImage.           
}
  1. Capture all content screenshots (size of content)
import SwViewCapture
// ...
view.swContentCapture { (capturedImage) -> Void in
	// capturedImage is a UIImage.           
}

###用法

  1. 普通截屏(屏幕大小)
import SwViewCapture
// ...
view.swCapture { (capturedImage) -> Void in
	// capturedImage is a UIImage.           
}
  1. 内容截屏(全部内容的大小)
import SwViewCapture
// ...
view.swContentCapture { (capturedImage) -> Void in
	// capturedImage is a UIImage.           
}

Requirement

iOS 8.0+, Swift 2.0+

SwViewCapture is available through CocoaPods now. To Install it, simply and the following line to your Podfile:

pod "SwViewCapture"

License

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

swviewcapture's People

Contributors

startry avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.