-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Open up CropViewController for inheritance. (#274)
- Loading branch information
1 parent
068c49f
commit cdeafcd
Showing
8 changed files
with
133 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// ViewController.swift | ||
// Mantis | ||
// | ||
// Created by Yingtao Guo on 10/19/18. | ||
// Copyright © 2018 Echo Studio. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import Mantis | ||
|
||
class CustomViewController: CropViewController { | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
title = "Custom View Controller" | ||
|
||
let rotate = UIBarButtonItem( | ||
image: UIImage.init(systemName: "crop.rotate"), | ||
style: .plain, | ||
target: self, | ||
action: #selector(onRotateClicked) | ||
) | ||
|
||
let done = UIBarButtonItem( | ||
image: UIImage.init(systemName: "checkmark"), | ||
style: .plain, | ||
target: self, | ||
action: #selector(onDoneClicked) | ||
) | ||
|
||
navigationItem.rightBarButtonItems = [ | ||
done, | ||
rotate, | ||
] | ||
} | ||
|
||
@objc private func onRotateClicked() { | ||
didSelectClockwiseRotate() | ||
} | ||
|
||
@objc private func onDoneClicked() { | ||
crop() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.