Skip to content

Commit 6e5ac9e

Browse files
authored
Create README.md
1 parent 9132027 commit 6e5ac9e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# ✍🏻Signature View in SwiftUI🚀 [without any package dependency!!]
2+
3+
Signature views are an effective way to capture user signatures in your SwiftUI app. In this tutorial, we’ll guide you through the process of building a signature view using Swift and SwiftUI.
4+
5+
![ezgif com-optimize](https://github.com/adityagi02/SignatureView/assets/77538183/c2677c93-8985-4b35-8137-6adab7a26c5b)
6+
7+
We’ll break down the code into easily digestible chunks, explaining each step along the way. This will allow users to sign documents or forms within your application, providing a more interactive and engaging user experience.
8+
9+
## We have to add 2 files:
10+
11+
#### [`ADrawSignatureView`](https://github.com/adityagi02/SignatureView/blob/main/SignatureView/DrawSignatureView.swift) :
12+
> The class in this code defines a custom ADrawSignatureView class in Swift, which inherits from UIView. It enables users to draw signatures, providing touch handling, customization options, and delegate callbacks.
13+
14+
#### [`SignatureView.swift`](https://github.com/adityagi02/SignatureView/blob/main/SignatureView/SignatureView.swift) :
15+
> The code in SignatureView.swift defines a SignatureViewContainer using UIViewRepresentable. It wraps an ADrawSignatureView, allowing users to draw signatures. The view handles clearing the signature, updates image and PDF data bindings, and delegates to a coordinator for completion events. The coordinator, conforming to ASignatureDelegate, manages the signature-related actions.
16+
17+
That's all, DONE✅ !!
18+
19+
Now just call this in your view,
20+
21+
```swift
22+
SignatureViewContainer(clearSignature: $clearSignature, signatureImage: $signatureImage, pdfSignature: $signaturePDF)
23+
```
24+
## Screenshot
25+
<img width="1440" alt="Screenshot 2023-12-24 at 6 40 50 PM" src="https://github.com/adityagi02/SignatureView/assets/77538183/c7d8899f-4627-4073-bf4d-c1c5d2ea7f20">
26+

0 commit comments

Comments
 (0)