Skip to content

Commit

Permalink
Document custom overlay. Fixes #156
Browse files Browse the repository at this point in the history
  • Loading branch information
JanGorman committed Jan 13, 2020
1 parent 50d821d commit 03a4769
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Example/Agrume Example/CloseButtonViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import Agrume

final class CloseButtonViewController: UIViewController {

private lazy var agrume = Agrume(image: #imageLiteral(resourceName: "MapleBacon"), background: .blurred(.regular),
dismissal: .withButton(nil))
private lazy var agrume = Agrume(image: #imageLiteral(resourceName: "MapleBacon"), background: .blurred(.regular), dismissal: .withButton(nil))

@IBAction private func showImage() {
agrume.show(from: self)
Expand Down
2 changes: 1 addition & 1 deletion Example/Agrume Example/OverlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ protocol OverlayViewDelegate: AnyObject {
}

/// Example custom image overlay
class OverlayView: AgrumeOverlayView {
final class OverlayView: AgrumeOverlayView {
lazy var toolbar: UIToolbar = {
let toolbar = UIToolbar()
toolbar.translatesAutoresizingMaskIntoConstraints = false
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ let helper = makeHelper()
agrume.onLongPress = helper.makeSaveToLibraryLongPressGesture
```

### Custom Overlay View

You can customise the look and functionality of the image views. To do so, you need create a class that inherits from `AgrumeOverlayView: UIView`. As this is nothing more than a regular `UIView` you can do anything you want with it like add a custom toolbar or buttons to it. The example app shows a detailed example of how this can be achieved.

### Lifecycle

`Agrume` offers the following lifecycle closures that you can optionally set:
Expand Down

0 comments on commit 03a4769

Please sign in to comment.