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

Black screen on touch

ppamorim opened this issue · comments

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
  }

}

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.