Stampoo/SnapshotSafeView

iOS 14.5 Support

Closed this issue · 5 comments

Fails to render view on iOS 14.5:

iOS 14.5 iOS 15.0
Simulator Screen Shot - iPhone 8 - 2022-07-21 at 12 29 47 Simulator Screen Shot - iPhone 8 - 2022-07-21 at 12 30 16

My previous implementation checked for availability:

// iOS 14.1 -> _UITextFieldCanvasView
// iOS 15.0 -> _UITextLayoutCanvasView
if let klass = NSClassFromString("_UITextFieldCanvasView") as? UIView.Type {
    hiddenView = klass.init()
    hiddenView.layer.perform(Selector(("setDisableUpdateMask:")), with: 0x12)
} else {
    let textField = UITextField()
    textField.isSecureTextEntry = true
    hiddenView = textField.layer.sublayers?.first?.delegate as! UIView
    hiddenView.subviews.forEach { $0.removeFromSuperview() }
}

@markst Hi, thanks for solution, this was fixed there 🙃 #2

Thanks @Stampoo! I'll give it a go