I have a custom UIView subclass inside a UIScrollView that (among other things) overrides
override var intrinsicContentSize: CGSize {
get {
...
}
}
and (minimal example):
override func draw(_ rect: CGRect) {
print(rect)
UIColor.white.set() // it has a dark background
UIBezierPath(rect: CGRect(x: 100, y: 100, width: 10, height: 10)).stroke()
}
Drawing works fine for “smaller” sizes of the view, but above a certain limit nothing draws anymore.
It renders fine for the rects
(0.0, 0.0, 79.5, 7458.5)
(0.0, 0.0, 228.5, 7458.5)
(0.0, 0.0, 149.0, 7738.0)
(0.0, 0.0, 429.0, 7738.0)
But fails for the rects
(0.0, 0.0, 89.5, 8381.0)
(0.0, 0.0, 257.0, 8381.0)
There is no error message or warning. Nothing that would let me know what fails and why. The UIScrollView is still scrollable. Its contents are just empty.
This is happening in a simulated 5th generation iPad and the simulated iPad Pro 9.7".