alankarmisra / SwiftSignatureView

A lightweight, fast and customizable option for capturing fluid, variable-stroke-width signatures within your app.
MIT License
320 stars 93 forks source link

Black screen on touch #34

Open ppamorim opened 4 years ago

ppamorim commented 4 years ago

Hi, I am getting a black screen when I touch in the component, the code is very simple like below:

class FooViewController: UIViewController {

  private lazy var signatureView: SwiftSignatureView = {
    let signatureView: SwiftSignatureView = SwiftSignatureView()
//    signatureView.translatesAutoresizingMaskIntoConstraints = false //Used for constraints, same problem
    return signatureView
  }()

  override func loadView() {
    super.loadView()
    view.addSubview(signatureView)
  }

  override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    self.signatureView.frame = self.view.frame //The same happens with contraints
  }

}
ppamorim commented 4 years ago

The problem is that window?.overrideUserInterfaceStyle is making the SwiftSignatureView background gets black. So everything is black. The workaround is to set self.signatureView.backgroundColor = UIColor.white.