I'm on a development team that's supporting both Xcode 8 and Xcode 9.
I was developing a feature that used String.UTF16Index(range.location) in Xcode 8. When I upgraded to Xcode 9, that resulted in the error 'init' is deprecated.
So in Xcode 9 I changed it to UTF16Index.init(encodedOffset: range.lowerBound). However, now that doesn't work in Xcode 8 with the error Argument labels '(encodedOffset:)' do not match any available overloads.
Even if I could check the Xcode version and write different code, one of the lines would fail at compile time. How can I manage this? Or am I stuck waiting until we fully move to Xcode 9?