https://github.com/globulus/swiftui-digital-signature
Digital signature component for SwiftUI.
https://github.com/globulus/swiftui-digital-signature
Last synced: 3 months ago
JSON representation
Digital signature component for SwiftUI.
- Host: GitHub
- URL: https://github.com/globulus/swiftui-digital-signature
- Owner: globulus
- License: mit
- Created: 2021-06-28T12:46:26.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-08T12:07:44.000Z (almost 4 years ago)
- Last Synced: 2025-04-24T13:34:49.812Z (about 1 year ago)
- Language: Swift
- Size: 1.23 MB
- Stars: 22
- Watchers: 4
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftUIDigitalSignature
**Plug'n' play Digital Signatures in SwiftUI**.
## Features
* Freeform signature drawing.
* Selecting signature image.
* Typing signature in oblique font.
* Choose signature color.
* Choose signature font.
* Callback produces `UIImage` that you can save/use.
* iOS 13/14 compatible.

## Installation
This component is distributed as a **Swift package**. Just add the repo URL to your package list:
```text
https://github.com/globulus/swiftui-digital-signature
```
## Sample usage
```swift
struct SignatureViewTest: View {
@State private var image: UIImage? = nil
var body: some View {
NavigationView {
VStack {
NavigationLink("GO", destination: SignatureView(availableTabs: [.draw, .image, .type],
onSave: { image in
self.image = image
}, onCancel: {
}))
if image != nil {
Image(uiImage: image!)
}
}
}
}
}
```
## Changelog
* 0.1.2 - Added `availableTabs` initializer param.
* 0.1.1 - Fixed drawing bounds.
* 0.1.0 - Initial release.
Check out [SwiftUIRecipes.com](https://swiftuirecipes.com) for more SwiftUI solutions, tips and custom components!