4 ms·
Can we write a protocol + type like that? https://forums.swift.org/t/how-do-views-like-emptyview-conform-to-the-view-protocol https://forums.swift.org/t/how-do
by Razengan 7y ago
Can we write a protocol + type like that?
https://forums.swift.org/t/how-do-views-like-emptyview-conform-to-the-view-protocol https://forums.swift.org/t/how-do-views-like-emptyview-confo...
- favorited 7y agoI don't see why not. When I trick it into calling `body` on an EmptyView, I get this runtime failure: > Thread 1: Fatal error: body() should not be called on EmptyView. So I don't think the implementation is doing anything beyond the fatalError() call from that forum thread. At least not at this point in time.