Skip to content

Instantly share code, notes, and snippets.

@digitallysavvy
Created December 3, 2019 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitallysavvy/7b3a0639e1361d13f76b6b85cddfa79c to your computer and use it in GitHub Desktop.
Save digitallysavvy/7b3a0639e1361d13f76b6b85cddfa79c to your computer and use it in GitHub Desktop.
Snippet for clearSubLayers within the ARSupportAudienceViewController
func clearSubLayers() {
DispatchQueue.main.async {
// loop through layers drawn from touches and remove them from the view
guard let sublayers = self.drawingView.layer.sublayers else { return }
for layer in sublayers {
layer.isHidden = true
layer.removeFromSuperlayer()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment