2 ms·
You'd present that as `ProgressReporting` or something, because other tasks besides a download would want to report their progress too, and indeed, the Foundati
by Razengan 8y ago
You'd present that as `ProgressReporting` or something, because other tasks besides a download would want to report their progress too, and indeed, the Foundation framework already has such a protocol [0]!
In your first comment you seem to value the ability to "quickly digest key object interfaces and concepts" but you balk at the added clarity afforded by separating different behaviors into distinct protocols?
If by "overhead" you mean a cost to performance, worrying about it at that level falls under premature optimization, until you're certain that the extra protocol noticeably harms performance.
If you really insist on having a single protocol, then make `progress` an optional computed property.
[0] https://developer.apple.com/documentation/foundation/progressreporting https://developer.apple.com/documentation/foundation/progres...
[1] https://developer.apple.com/documentation/foundation/progress https://developer.apple.com/documentation/foundation/progres...