Code organization question: supporting both iOS 16 and iOS 17 and using new language features on the latter

Maybe the approach outlined here is an option.