Skip to content

Commit

Permalink
gif url is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Yagiz Gurgul committed Mar 10, 2017
1 parent e7d9989 commit 65c0512
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ScreenshotSharer is a little Swift 3.0 pod that enables users to share a specific part of the view or the whole screen when they took a screenshot. It's heavily inspired from Asos app and highly customizable.

### Preview
![](https://github.com/yagiz/ScreenshotSharer/blob/master/preview.gif?raw=true)
![](https://github.com/yagiz/ScreenshotSharer/blob/master/screenshots/preview.gif?raw=true)

### Installation

Expand All @@ -22,16 +22,17 @@ import UIKit
import ScreenshotSharer

class ViewController: UIViewController {

let sssharer = ScreenshotSharer()

@IBOutlet weak var captureView: UIView!

override func viewDidLoad()
{
super.viewDidLoad()

sssharer.registerViewCapturer(view: self.view, cropRect: CGRect.zero, sender: self) { (image, sharerViewController) in


sssharer.registerViewCapturer(view: self.captureView, cropRect: CGRect.zero) { (image, screenshotSharerViewController) in

//this block is called when the user takes a screenshot
//image is the image of given view and it can be cropped according to cropRect.
//sharerViewController is the presented view controller
Expand All @@ -57,7 +58,7 @@ class ViewController: UIViewController {

#### Capturing Whole Screen
```swift
sssharer.registerScreenCapturer(cropStatusBar: true, cropRect: CGRect.zero) { (image, sharerViewController) in
sssharer.registerScreenCapturer(cropStatusBar: true, cropRect: CGRect.zero) { (image, screenshotSharerViewController) in

//this block is called when the user takes a screenshot
//image is the image of given view and it can be cropped according to cropRect.
Expand Down Expand Up @@ -98,9 +99,9 @@ These are the all the methods you can use to customize default sharer view contr
#### Designing Your Own Sharer View Controller
In some cases you may want to design the whole sharer view controller from stratch. To do this your sharer view controller should extend ScreenshotSharerViewController class and you should register it to ScreenshotSharer instance. Default sharer view controller uses UIActivityViewController but you can implement your own share logic.
```swift
let customSharerVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CustomScreenShotSharerViewController") as! CustomScreenShotSharerViewController
let customSharer = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CustomSharerViewController") as! CustomSharerViewController

sssharer.registerViewCapturer(view: self.view, cropRect: CGRect.zero, sharerViewController: customSharerVC, sender: self) { (image, sharerViewController) in
sssharer.registerScreenCapturer(cropStatusBar: true, cropRect: CGRect.zero, sharerViewController: customSharer) { (image, customScreenshotSharerViewController) in

}
```
Expand Down

0 comments on commit 65c0512

Please sign in to comment.