alankarmisra / SwiftSignatureView

A lightweight, fast and customizable option for capturing fluid, variable-stroke-width signatures within your app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Background color is not changing from white

gyounes93 opened this issue · comments

Hi,

I've been using SwiftSignatureView for a few months now and everything has been great. Recently, I've been working on a revamp of my application and when I go to use SwiftSignatureView, the background color is not changing to whatever I set it to (in the IB).

I've even tried changing the settings of the SwiftSignatureView (view) programmatically and it still doesn't hold.

Using XCode 12.1 and iOS 13.4 (also tried iOS 14.1). Let me know if anyone has any ideas why this is..

Thank you!

You can set background color using the below code

import PencilKit
`
if let signaturInnerView = viewSignature.subviews.first(where: {$0 is ISignatureView}) {
if let canvasView = signaturInnerView.subviews.first(where: {$0 is PKCanvasView}) {
canvasView.backgroundColor = UIColor.red
}
}

`

// viewSignature is object of the SwiftSignatureView

@yogeshmakwanavolansys above solution works perfectly for UI, but i need that background color to be attached to image when exported. Any solution for this ?

Appreciate !