ارفع راسك فوق انته سوري حر ... :green_heart::green_heart:

Skip to content
Snippets Groups Projects
Commit d9fa07ed authored by George's avatar George
Browse files

temp

parent 6a26cdef
Branches
No related tags found
No related merge requests found
Showing
with 1693 additions and 692 deletions
......@@ -7,7 +7,7 @@
<key>MiniScanner.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>8</integer>
<integer>9</integer>
</dict>
</dict>
</dict>
......
No preview for this file type
......@@ -14,8 +14,8 @@
filePath = "MiniScanner/Modules/EditViewController/EditViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "230"
endingLineNumber = "230"
startingLineNumber = "239"
endingLineNumber = "239"
landmarkName = "saveFileAndShare(with:name:)"
landmarkType = "7">
</BreakpointContent>
......
......@@ -10,6 +10,7 @@ import UIKit
import LNExtensionExecutor
import NBBottomSheet
import QuickLook
import AVKit
public protocol EditViewControllerDelegate: NSObjectProtocol {
func editViewController(_ editViewController: EditViewController, finished session: MultiPageScanSession)
......@@ -40,6 +41,8 @@ public class EditViewController: UIViewController {
return activityIndicator
}()
// MARK: - LifeCycle
public override func viewDidLoad() {
super.viewDidLoad()
......@@ -174,6 +177,12 @@ public class EditViewController: UIViewController {
}
}
// MARK: - TABBAR ACTION
@IBAction func editButtonTapped(_ sender: UIButton) {
}
}
// MARK: - BannerViewDelegate
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Icons (4).svg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<svg width="35" height="36" viewBox="0 0 35 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26.6735 24.6214C25.2 27.4076 22.2577 28.4088 17.0626 28.4088C9.88421 28.4088 7.00686 26.4973 6.36259 20.6062M26.6735 24.6214C27.5526 22.9591 27.9089 20.6617 27.9089 17.5624C27.9089 9.26815 25.3569 6.71606 17.0626 6.71606C8.76831 6.71606 6.21623 9.26815 6.21623 17.5624C6.21623 18.6783 6.26242 19.6903 6.36259 20.6062M26.6735 24.6214L22.6953 20.643C21.6986 19.6464 20.0828 19.6464 19.0861 20.643L18.8672 20.862C17.8706 21.8586 16.2546 21.8586 15.258 20.862L12.487 18.091C11.4904 17.0944 9.87438 17.0944 8.8778 18.091L6.36259 20.6062M18.7329 13.5378C18.7329 14.8381 19.7882 15.8934 21.0885 15.8934C22.3875 15.8934 23.4428 14.8381 23.4428 13.5378C23.4428 12.2375 22.3875 11.1822 21.0885 11.1822C19.7882 11.1822 18.7329 12.2375 18.7329 13.5378Z" stroke="#070707" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Icons (5).svg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2042_357)">
<g clip-path="url(#clip1_2042_357)">
<path d="M25.3542 25.5626C25.3542 25.5626 23.649 21.9167 21.9515 21.9167C20.2538 21.9167 18.3125 25.5626 16.8473 25.5626C15.3821 25.5626 15.0265 24.1042 13.4445 24.1042C11.8626 24.1042 11.5257 25.5626 10.0417 25.5626C8.5578 25.5626 4.93758 24.1042 4.93758 24.1042" stroke="#070707" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M25.3542 11.7664H4.93758" stroke="#070707" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M25.3542 14.9895H4.93758" stroke="#070707" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M25.3542 18.2708H4.93758" stroke="#070707" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.3674 8.0625H26.2159C27.7535 8.0625 29 9.04188 29 10.25V27.75C29 28.9581 27.7535 29.9375 26.2159 29.9375H11.3674C9.82981 29.9375 8.58333 28.9581 8.58333 27.75V10.25C8.58333 9.04188 9.82981 8.0625 11.3674 8.0625Z" stroke="#070707" stroke-width="2"/>
</g>
</g>
<defs>
<clipPath id="clip0_2042_357">
<rect width="35" height="35" fill="white" transform="matrix(-1 0 0 1 35.25 0.5)"/>
</clipPath>
<clipPath id="clip1_2042_357">
<rect width="35" height="35" fill="white" transform="translate(0.25 0.5)"/>
</clipPath>
</defs>
</svg>
......@@ -11,6 +11,7 @@ target 'MiniScanner' do
pod 'ImagePicker'
pod 'NBBottomSheet'
pod 'FSPagerView'
pod 'EPSignature'
......
PODS:
- EPSignature (1.0.6)
- FSPagerView (0.8.3)
- ImagePicker (3.2.0)
- IQKeyboardManagerSwift (7.0.3)
......@@ -6,6 +7,7 @@ PODS:
- NBBottomSheet (1.2.0)
DEPENDENCIES:
- EPSignature
- FSPagerView
- ImagePicker
- IQKeyboardManagerSwift
......@@ -14,6 +16,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- EPSignature
- FSPagerView
- ImagePicker
- IQKeyboardManagerSwift
......@@ -21,12 +24,13 @@ SPEC REPOS:
- NBBottomSheet
SPEC CHECKSUMS:
EPSignature: 3fa3b520c80717b98019723faa60a41794b03fbc
FSPagerView: 670405b2f18e2a87fa37f20b00de783e562c25a8
ImagePicker: 1d950bbb2422548ed58791b4ec7f42fe42920511
IQKeyboardManagerSwift: f9c5dc36cba16ddd2e51fa7d51c34a2e083029b5
LanguageManager-iOS: 6b2dbb3793445827114708f0759b76e96932d7c8
NBBottomSheet: aa7a52809b2d7b193f733247b8ce391a59904372
PODFILE CHECKSUM: 52accaf9c5f2924a92fc166365082451576507fe
PODFILE CHECKSUM: 23ea4bb572ed7de088aee5894c2fe160357b3d96
COCOAPODS: 1.14.3
Copyright (c) 2016 Prabaharan <prabaharan.e@payoda.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
//
// EPExtensions.swift
// Pods
//
// Created by Prabaharan Elangovan on 17/01/16.
//
//
import Foundation
//MARK: - UIViewController Extensions
extension UIViewController {
func showAlert(_ message: String) {
showAlert(message, andTitle: "")
}
func showAlert(_ message: String, andTitle title: String) {
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert)
// add an action (button)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil))
// show the alert
self.present(alert, animated: true, completion: nil)
}
}
//MARK: - UIColor Extensions
extension UIColor {
class func defaultTintColor() -> UIColor {
return UIColor(red: (233/255), green: (159/255), blue: (94/255), alpha: 1.0)
}
}
//
// EPDrawingView.swift
// Pods
//
// Created by Prabaharan Elangovan on 13/01/16.
//
//
import UIKit
open class EPSignatureView: UIView {
// MARK: - Private Vars
fileprivate var bezierPoints = [CGPoint](repeating: CGPoint(), count: 5)
fileprivate var bezierPath = UIBezierPath()
fileprivate var bezierCounter : Int = 0
// MARK: - Public Vars
open var strokeColor = UIColor.black
open var strokeWidth: CGFloat = 2.0 {
didSet { bezierPath.lineWidth = strokeWidth }
}
open var isSigned: Bool = false
// MARK: - Initializers
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.backgroundColor = UIColor.clear
bezierPath.lineWidth = strokeWidth
addLongPressGesture()
}
public override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor.clear
bezierPath.lineWidth = strokeWidth
addLongPressGesture()
}
override open func draw(_ rect: CGRect) {
bezierPath.stroke()
strokeColor.setStroke()
bezierPath.stroke()
}
// MARK: - Touch Functions
func addLongPressGesture() {
//Long press gesture is used to keep clear dots in the canvas
let longPressGesture = UILongPressGestureRecognizer(target: self, action: #selector(EPSignatureView.longPressed(_:)))
longPressGesture.minimumPressDuration = 1.5
self.addGestureRecognizer(longPressGesture)
}
@objc func longPressed(_ gesture: UILongPressGestureRecognizer) {
let touchPoint = gesture.location(in: self)
let endAngle: CGFloat = .pi * 2.0
bezierPath.move(to: touchPoint)
bezierPath.addArc(withCenter: touchPoint, radius: 2, startAngle: 0, endAngle: endAngle, clockwise: true)
setNeedsDisplay()
}
override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
if let currentPoint = touchPoint(touches) {
isSigned = true
bezierPoints[0] = currentPoint
bezierCounter = 0
}
}
override open func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
if let currentPoint = touchPoint(touches) {
bezierCounter += 1
bezierPoints[bezierCounter] = currentPoint
//Smoothing is done by Bezier Equations where curves are calculated based on four concurrent points drawn
if bezierCounter == 4 {
bezierPoints[3] = CGPoint(x: (bezierPoints[2].x + bezierPoints[4].x) / 2 , y: (bezierPoints[2].y + bezierPoints[4].y) / 2)
bezierPath.move(to: bezierPoints[0])
bezierPath.addCurve(to: bezierPoints[3], controlPoint1: bezierPoints[1], controlPoint2: bezierPoints[2])
setNeedsDisplay()
bezierPoints[0] = bezierPoints[3]
bezierPoints[1] = bezierPoints[4]
bezierCounter = 1
}
}
}
override open func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
bezierCounter = 0
}
func touchPoint(_ touches: Set<UITouch>) -> CGPoint? {
if let touch = touches.first {
return touch.location(in: self)
}
return nil
}
//MARK: Utility Methods
/** Clears the drawn paths in the canvas
*/
open func clear() {
isSigned = false
bezierPath.removeAllPoints()
setNeedsDisplay()
}
/** scales and repositions the path
*/
open func reposition() {
var ratio = min(self.bounds.width / bezierPath.bounds.width, 1)
ratio = min((self.bounds.height - 64) / bezierPath.bounds.height, ratio)
bezierPath.apply(CGAffineTransform(scaleX: ratio, y: ratio))
setNeedsDisplay()
}
/** Returns the drawn path as Image. Adding subview to this view will also get returned in this image.
*/
open func getSignatureAsImage() -> UIImage? {
if isSigned {
UIGraphicsBeginImageContext(CGSize(width: self.bounds.size.width, height: self.bounds.size.height))
self.layer.render(in: UIGraphicsGetCurrentContext()!)
let signature: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return signature
}
return nil
}
/** Returns the rect of signature image drawn in the canvas. This can very very useful in croping out the unwanted empty areas in the signature image returned.
*/
open func getSignatureBoundsInCanvas() -> CGRect {
return bezierPath.bounds
}
//MARK: Save load signature methods
open func saveSignature(_ localPath: String) {
if isSigned {
NSKeyedArchiver.archiveRootObject(bezierPath, toFile: localPath)
}
}
open func loadSignature(_ filePath: String) {
if let path = getPath(filePath) {
isSigned = true
bezierPath = path
setNeedsDisplay()
}
}
fileprivate func getPath(_ filePath: String) -> UIBezierPath? {
if FileManager.default.fileExists(atPath: filePath) {
return NSKeyedUnarchiver.unarchiveObject(withFile: filePath) as? UIBezierPath
}
return nil
}
func removeSignature() {
let docPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first
let filePath = (docPath! as NSString).appendingPathComponent("sig.data")
do {
try FileManager.default.removeItem(atPath: filePath)
}
catch let error {
print(error)
}
}
}
//
// EPSignatureViewController.swift
// Pods
//
// Created by Prabaharan Elangovan on 13/01/16.
//
//
import UIKit
// MARK: - EPSignatureDelegate
@objc public protocol EPSignatureDelegate {
@objc optional func epSignature(_: EPSignatureViewController, didCancel error : NSError)
@objc optional func epSignature(_: EPSignatureViewController, didSign signatureImage : UIImage, boundingRect: CGRect)
}
open class EPSignatureViewController: UIViewController {
// MARK: - IBOutlets
@IBOutlet weak var switchSaveSignature: UISwitch!
@IBOutlet weak var lblSignatureSubtitle: UILabel!
@IBOutlet weak var lblDefaultSignature: UILabel!
@IBOutlet weak var lblDate: UILabel!
@IBOutlet weak var viewMargin: UIView!
@IBOutlet weak var lblX: UILabel!
@IBOutlet weak var signatureView: EPSignatureView!
// MARK: - Public Vars
open var showsDate: Bool = true
open var showsSaveSignatureOption: Bool = true
open weak var signatureDelegate: EPSignatureDelegate?
open var subtitleText = "Sign Here"
open var tintColor = UIColor.defaultTintColor()
// MARK: - Life cycle methods
override open func viewDidLoad() {
super.viewDidLoad()
let cancelButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.cancel, target: self, action: #selector(EPSignatureViewController.onTouchCancelButton))
cancelButton.tintColor = tintColor
self.navigationItem.leftBarButtonItem = cancelButton
let doneButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.done, target: self, action: #selector(EPSignatureViewController.onTouchDoneButton))
doneButton.tintColor = tintColor
let clearButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.trash, target: self, action: #selector(EPSignatureViewController.onTouchClearButton))
clearButton.tintColor = tintColor
if showsDate {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = DateFormatter.Style.short
dateFormatter.timeStyle = DateFormatter.Style.none
lblDate.text = dateFormatter.string(from: Date())
} else {
lblDate.isHidden = true
}
if showsSaveSignatureOption {
let actionButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.action, target: self, action: #selector(EPSignatureViewController.onTouchActionButton(_:)))
actionButton.tintColor = tintColor
self.navigationItem.rightBarButtonItems = [doneButton, clearButton, actionButton]
switchSaveSignature.onTintColor = tintColor
} else {
self.navigationItem.rightBarButtonItems = [doneButton, clearButton]
lblDefaultSignature.isHidden = true
switchSaveSignature.isHidden = true
}
lblSignatureSubtitle.text = subtitleText
switchSaveSignature.setOn(false, animated: true)
}
override open func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Initializers
public convenience init(signatureDelegate: EPSignatureDelegate) {
self.init(signatureDelegate: signatureDelegate, showsDate: true, showsSaveSignatureOption: true)
}
public convenience init(signatureDelegate: EPSignatureDelegate, showsDate: Bool) {
self.init(signatureDelegate: signatureDelegate, showsDate: showsDate, showsSaveSignatureOption: true)
}
public init(signatureDelegate: EPSignatureDelegate, showsDate: Bool, showsSaveSignatureOption: Bool ) {
self.showsDate = showsDate
self.showsSaveSignatureOption = showsSaveSignatureOption
self.signatureDelegate = signatureDelegate
let bundle = Bundle(for: EPSignatureViewController.self)
super.init(nibName: "EPSignatureViewController", bundle: bundle)
}
required public init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - Button Actions
@objc func onTouchCancelButton() {
signatureDelegate?.epSignature!(self, didCancel: NSError(domain: "EPSignatureDomain", code: 1, userInfo: [NSLocalizedDescriptionKey:"User not signed"]))
dismiss(animated: true, completion: nil)
}
@objc func onTouchDoneButton() {
if let signature = signatureView.getSignatureAsImage() {
if switchSaveSignature.isOn {
let docPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first
let filePath = (docPath! as NSString).appendingPathComponent("sig.data")
signatureView.saveSignature(filePath)
}
signatureDelegate?.epSignature!(self, didSign: signature, boundingRect: signatureView.getSignatureBoundsInCanvas())
dismiss(animated: true, completion: nil)
} else {
showAlert("You did not sign", andTitle: "Please draw your signature")
}
}
@objc func onTouchActionButton(_ barButton: UIBarButtonItem) {
let action = UIAlertController(title: "Action", message: "", preferredStyle: UIAlertController.Style.actionSheet)
action.view.tintColor = tintColor
action.addAction(UIAlertAction(title: "Load default signature", style: UIAlertAction.Style.default, handler: { action in
let docPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first
let filePath = (docPath! as NSString).appendingPathComponent("sig.data")
self.signatureView.loadSignature(filePath)
}))
action.addAction(UIAlertAction(title: "Delete default signature", style: UIAlertAction.Style.destructive, handler: { action in
self.signatureView.removeSignature()
}))
action.addAction(UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: nil))
if let popOver = action.popoverPresentationController {
popOver.barButtonItem = barButton
}
present(action, animated: true, completion: nil)
}
@objc func onTouchClearButton() {
signatureView.clear()
}
override open func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation) {
signatureView.reposition()
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="EPSignatureViewController" customModule="EPSignature" customModuleProvider="target">
<connections>
<outlet property="lblDate" destination="axD-zL-F02" id="wTq-kl-F6R"/>
<outlet property="lblDefaultSignature" destination="aik-5V-tSc" id="I3Z-k5-p5s"/>
<outlet property="lblSignatureSubtitle" destination="rdS-ZH-7LX" id="JNs-Ic-dDV"/>
<outlet property="lblX" destination="MkH-Jy-I8l" id="LOa-wr-8Mx"/>
<outlet property="signatureView" destination="OAr-kk-HpY" id="4ZM-Go-wnK"/>
<outlet property="switchSaveSignature" destination="J7f-zy-tMu" id="KAn-zS-2zW"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
<outlet property="viewMargin" destination="Yrj-8B-7oQ" id="0gX-Sw-qAm"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OAr-kk-HpY" customClass="EPSignatureView" customModule="EPSignature" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Save to default signature" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aik-5V-tSc">
<rect key="frame" x="104" y="613" width="165" height="29"/>
<constraints>
<constraint firstAttribute="height" constant="29" id="RVR-PA-nbo"/>
<constraint firstAttribute="width" constant="165" id="lKF-66-rNd"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.3333333432674408" green="0.3333333432674408" blue="0.3333333432674408" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="X" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MkH-Jy-I8l">
<rect key="frame" x="15" y="541" width="20" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="fkM-wc-mzP"/>
<constraint firstAttribute="width" constant="20" id="qBh-KN-NXm"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="22"/>
<color key="textColor" red="0.66666668653488159" green="0.66666668653488159" blue="0.66666668653488159" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yrj-8B-7oQ">
<rect key="frame" x="15" y="565" width="345" height="2"/>
<color key="backgroundColor" red="0.66666668653488159" green="0.66666668653488159" blue="0.66666668653488159" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="2" id="t0X-Mk-zhu"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sign Here" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rdS-ZH-7LX">
<rect key="frame" x="20" y="582" width="335" height="21"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="21" id="4kW-fB-aHl"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.78543893909999996" green="0.1638312089" blue="0.099763569080000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="21 December 2015" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="axD-zL-F02">
<rect key="frame" x="238" y="40" width="122" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.66666668653488159" green="0.66666668653488159" blue="0.66666668653488159" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="J7f-zy-tMu">
<rect key="frame" x="279" y="611" width="51" height="31"/>
<color key="onTintColor" red="0.82745098039999998" green="0.3294117647" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</switch>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Yrj-8B-7oQ" firstAttribute="leading" secondItem="F5l-mP-b9o" secondAttribute="leading" constant="15" id="5PA-ug-Sg6"/>
<constraint firstItem="MkH-Jy-I8l" firstAttribute="leading" secondItem="Yrj-8B-7oQ" secondAttribute="leading" id="64f-F5-UUL"/>
<constraint firstItem="F5l-mP-b9o" firstAttribute="trailing" secondItem="axD-zL-F02" secondAttribute="trailing" constant="15" id="9Pq-L2-SZk"/>
<constraint firstItem="aik-5V-tSc" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" constant="-1" id="GlS-Yf-S40"/>
<constraint firstItem="F5l-mP-b9o" firstAttribute="trailing" secondItem="rdS-ZH-7LX" secondAttribute="trailing" constant="20" id="JOv-bb-Yrx"/>
<constraint firstItem="Yrj-8B-7oQ" firstAttribute="top" secondItem="MkH-Jy-I8l" secondAttribute="bottom" constant="3" id="K58-Xq-qgO"/>
<constraint firstItem="rdS-ZH-7LX" firstAttribute="leading" secondItem="F5l-mP-b9o" secondAttribute="leading" constant="20" id="L7L-MI-kvu"/>
<constraint firstItem="aik-5V-tSc" firstAttribute="top" secondItem="rdS-ZH-7LX" secondAttribute="bottom" constant="10" id="MgR-XF-1Bq"/>
<constraint firstItem="F5l-mP-b9o" firstAttribute="trailing" secondItem="Yrj-8B-7oQ" secondAttribute="trailing" constant="15" id="Oc8-OS-bPq"/>
<constraint firstItem="OAr-kk-HpY" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="R89-jA-Ieb"/>
<constraint firstItem="rdS-ZH-7LX" firstAttribute="top" secondItem="Yrj-8B-7oQ" secondAttribute="bottom" constant="15" id="REi-Qo-wZH"/>
<constraint firstAttribute="trailing" secondItem="OAr-kk-HpY" secondAttribute="trailing" id="Wcg-X5-9zF"/>
<constraint firstAttribute="bottom" secondItem="OAr-kk-HpY" secondAttribute="bottom" id="WtB-mL-Yei"/>
<constraint firstItem="J7f-zy-tMu" firstAttribute="leading" secondItem="aik-5V-tSc" secondAttribute="trailing" constant="10" id="ZAL-TA-pyS"/>
<constraint firstItem="OAr-kk-HpY" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="hnC-tQ-bvr"/>
<constraint firstItem="axD-zL-F02" firstAttribute="top" secondItem="F5l-mP-b9o" secondAttribute="top" constant="20" id="sBW-Lu-kBm"/>
<constraint firstItem="J7f-zy-tMu" firstAttribute="centerY" secondItem="aik-5V-tSc" secondAttribute="centerY" constant="-1" id="xje-Yv-Jiz"/>
<constraint firstItem="F5l-mP-b9o" firstAttribute="bottom" secondItem="Yrj-8B-7oQ" secondAttribute="bottom" constant="100" id="zIP-nq-YWP"/>
</constraints>
<viewLayoutGuide key="safeArea" id="F5l-mP-b9o"/>
</view>
</objects>
</document>
<p align="center" >
<img src="Screenshots/logo.png" alt="EPSignature" title="EPSignature" width="196">
</p>
# EPSignature
Signature component for iOS written in Swift
[![Platform](https://img.shields.io/cocoapods/p/EPSignature.svg?style=flat)](http://cocoapods.org/pods/EPSignature)
[![Swift 3.0](https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![CI Status](https://travis-ci.org/ipraba/EPSignature.svg?branch=master)](https://travis-ci.org/ipraba/EPSignature)
[![Version](https://img.shields.io/cocoapods/v/EPSignature.svg?style=flat)](https://cocoapods.org/?q=EPsignature)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](http://img.shields.io/badge/license-MIT-33e0ff.svg)](https://github.com/ipraba/EPSignature/blob/master/LICENSE)
[![Twitter: @HaveYouMetPrabu](https://img.shields.io/badge/contact-@HaveYouMetPrabu-blue.svg?style=flat)](https://twitter.com/HaveYouMetPrabu)
### Preview
![Screenshot](https://raw.githubusercontent.com/ipraba/EPSignature/master/Screenshots/iPhone.png) ![Screenshot](https://raw.githubusercontent.com/ipraba/EPSignature/master/Screenshots/iPad.png)
### Installation
##### [CocoaPods](http://cocoapods.org)
EPSignature is available through CocoaPods. To install it, simply add the following line to your Podfile:
```ruby
pod "EPSignature"
```
##### [Carthage](https://github.com/Carthage/Carthage#if-youre-building-for-ios)
To integrate EPSignature into your Xcode project using Carthage, specify it in your Cartfile:
```ruby
github "ipraba/EPSignature"
```
##### Manual Installation
Just drag and drop the files in `Pod/Classes` folder into your project
#### Features
1. User can draw the signature either by finger or by apple pencil
2. Ability to save the signature as default signature which can be retrieved later
3. Ability to load the saved signature
4. Works on both orientations(portrait and landscape)
5. Works on both iPhone and iPad devices
6. Also can be embedded in any container view
7. Can extract the signature as Image
8. Draws smoothly
### Initialization of EPSignatureViewController
```swift
let signatureVC = EPSignatureViewController(signatureDelegate: self, showsDate: true, showsSaveSignatureOption: true)
signatureVC.subtitleText = "I agree to the terms and conditions"
signatureVC.title = "John Doe"
let nav = UINavigationController(rootViewController: signatureVC)
presentViewController(nav, animated: true, completion: nil)
```
Note: You can also embed the signature view in any one of the container using the EPSignatureView
### Properties of EPSignatureViewController
Properties | Description
---- | ---------
**`showsDate`**|`Bool value that allows to show the date while signing`
**`showsSaveSignatureOption`**|`Bool value that allows the user to save the signature for future use`
**`signatureDelegate`**|`Delegate listening for events`
**`subtitleText`**|`Subtitle text for signature(Eg: Sign here)`
**`tintColor`**|`Tint color for the view controller. Applies for barbuttons, switches and actionsheet`
### Properties of EPSignatureView
Properties | Description
---- | ---------
**`strokeColor`**|`Stroke color of the signature`
**`strokeWidth`**|`Stroke width of the signature`
**`isSigned`**|`Bool value checks whether the user has signed or not`
### EPSignatureViewController Delegates
```swift
func epSignature(_: EPSignature.EPSignatureViewController, didCancel error: NSError)
func epSignature(_: EPSignature.EPSignatureViewController, didSign signatureImage: UIImage, boundingRect: CGRect)
```
Note: boundingRect will contain the bounds of the signed image retrieved. Crop using this rect to make shorter and small signature images
### License
EPSignature is available under the MIT license. See the [LICENSE](https://github.com/ipraba/EPSignature/blob/master/LICENSE) file for more info.
### Author
[@ipraba](https://github.com/ipraba)
PODS:
- EPSignature (1.0.6)
- FSPagerView (0.8.3)
- ImagePicker (3.2.0)
- IQKeyboardManagerSwift (7.0.3)
......@@ -6,6 +7,7 @@ PODS:
- NBBottomSheet (1.2.0)
DEPENDENCIES:
- EPSignature
- FSPagerView
- ImagePicker
- IQKeyboardManagerSwift
......@@ -14,6 +16,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- EPSignature
- FSPagerView
- ImagePicker
- IQKeyboardManagerSwift
......@@ -21,12 +24,13 @@ SPEC REPOS:
- NBBottomSheet
SPEC CHECKSUMS:
EPSignature: 3fa3b520c80717b98019723faa60a41794b03fbc
FSPagerView: 670405b2f18e2a87fa37f20b00de783e562c25a8
ImagePicker: 1d950bbb2422548ed58791b4ec7f42fe42920511
IQKeyboardManagerSwift: f9c5dc36cba16ddd2e51fa7d51c34a2e083029b5
LanguageManager-iOS: 6b2dbb3793445827114708f0759b76e96932d7c8
NBBottomSheet: aa7a52809b2d7b193f733247b8ce391a59904372
PODFILE CHECKSUM: 52accaf9c5f2924a92fc166365082451576507fe
PODFILE CHECKSUM: 23ea4bb572ed7de088aee5894c2fe160357b3d96
COCOAPODS: 1.14.3
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3CAF5EBFE5D1550CFF58AEC93594990A"
BuildableName = "EPSignature.framework"
BlueprintName = "EPSignature"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment