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

Related tags

UI SwViewCapture
Overview

SwViewCapture

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

SwViewCapture could convert all content of UIWebView to a UIImage.

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

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;
    • WKWebView could be capture like UIWebView
  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的支持比较完美, 已经提供了两种截图方法, 非滚动的截图方式已经解决了position: fixed的问题
  4. 截图过程中不会出现视图闪烁.

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

Usage

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

###用法

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

Requirement

iOS 8.0+, Swift 2.0+ or Swift 3.0(Compatiable)

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

pod "SwViewCapture"

Or, if you’re using Carthage, add SwViewCapture to your Cartfile:

github "startry/SwViewCapture"

License

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

You might also like...
Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.
Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.

kishikawakatsumi/SpreadsheetView has moved! It is being actively maintained at bannzai/SpreadsheetView. This fork was created when the project was mov

This widget displays a weight and a label. It can be used in the summary view for a strength assessment.
This widget displays a weight and a label. It can be used in the summary view for a strength assessment.

Strength Assessment Widget - Flutter Modern UI engineering is all about components. When we build components to be reusable, we enable faster iteratio

Fetch the star wars api from all the planets and list and show details using Swift UI and Combine

Star Wars Planets Fetch the star wars planet data by using stat war api, list and show details using SwiftUI and Combine frameworks 🔖 Swift UI Framew

LicensePlist is a command-line tool that automatically generates a Plist of all your dependencies, including files added manually
LicensePlist is a command-line tool that automatically generates a Plist of all your dependencies, including files added manually

LicensePlist is a command-line tool that automatically generates a Plist of all your dependencies, including files added manually(specifi

A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Confetti View lets you create a magnificent confetti view in your app
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.

PullToDismiss PullToDismiss provides dismiss modal viewcontroller function like Facebook Messenger by pulling scrollview or navigationbar with smooth

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting

Features • Guides • Installation • Usage • Miscellaneous • Contributing 🌎 README is available in other languages: 🇪🇸 . 🇨🇳 . 🇧🇷 . 🇰🇷 . 🇫🇷 To

A framework which helps you attach observers to `UIView`s to get updates on its frame changes

FrameObserver is a framework that lets you attach observers to any UIView subclass and get notified when its size changes. It doesn't use any Method S

Comments
  • 您好,我在知乎上给你反应过问题

    您好,我在知乎上给你反应过问题

    我是在做UICollectionView的截图的时候,借鉴您的思路。并且我做过测试,UITableView用你的思路完全是没问题的,就只有UICollectionView 会出现Cell 未出现在屏幕上的,不会被渲染的情况。按照UIScrollView的截图思路,应该就是通过

    // Scroll To Bottom show all cached view if self.frame.size.height < self.contentSize.height { self.contentOffset = CGPoint(x: 0, y: self.contentSize.height - self.frame.size.height) } 可以将其全部缓存获取到,似乎这到UICollectionView并不是很管用。希望能与您共同探讨这个问题,谢谢

    opened by shafujiu 7
  • WKWebView capture all content, some div may repeat.

    WKWebView capture all content, some div may repeat.

    The function of capture all content of WKWebView. The div with css style position: absolute; will be repeat many times. WKWebView screenshots need enhance for this feature.

    enhancement 
    opened by startry 1
  • App crashes when using  swContentCapture

    App crashes when using swContentCapture

    Hi, thanks for the awesome pod, can you please help me with the following Application crashes when using the below code but works fine with swCapture. self.scrollView.swContentCapture({ (capturedImage) -> Void in UIImageWriteToSavedPhotosAlbum(capturedImage!, self, nil, nil) }) I don't know what I'm doing wrong.

    I'm using swift 4.2, xcode 10.2.1. Thanks

    opened by noura-rizk 0
Owner
Xing Chen
Xing Chen
A SwiftUI Library for creating resizable partitions for View Content.

Partition Kit Recently Featured In Top 10 Trending Android and iOS Libraries in October and in 5 iOS libraries to enhance your app! What is PartitionK

Kieran Brown 230 Oct 27, 2022
A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Arale A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built f

Putra Z. 43 Feb 4, 2022
SwiftUI view enabling navigation between pages of content, imitating the behaviour of UIPageViewController for iOS and watchOS

PageView SwiftUI view enabling page-based navigation, imitating the behaviour of UIPageViewController in iOS. Why SwiftUI doesn't have any kind of pag

Kacper Rączy 365 Dec 29, 2022
A controller that uses a UIStackView and view controller composition to display content in a list

StackViewController Overview StackViewController is a Swift framework that simplifies the process of building forms and other static content using UIS

Seed 867 Dec 27, 2022
A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View

ScrollViewIfNeeded A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View Installation Requirements iOS 13+ Swift Package Manag

Daniel Klöck 19 Dec 28, 2022
An iOS picker view to serve all your "picking" needs

Mandoline The PickerView is a UICollectionView that provides a smooth "picking" interface. In order to get the most out of it, a consuming view contro

Blue Apron 883 Nov 28, 2022
A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed flag

HidesNavigationBarWhenPushed A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed

Danil Gontovnik 55 Oct 19, 2022
A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval.

MultiStepSlider A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval. Th

Susmita Horrow 25 Apr 28, 2022
Placeholder views based on content, loading, error or empty states

StatefulViewController A protocol to enable UIViewControllers or UIViews to present placeholder views based on content, loading, error or empty states

Alexander Schuch 2.1k Dec 8, 2022
A Swift material design UI module which paints over the parent view when the switch is on.

:octocat: ?? RAMPaperSwitch is a Swift material design UI module which paints over the parent view when the switch is turned on. iOS library by @Ramotion

Ramotion 2.9k Dec 29, 2022