TimeZonePicker
TimeZonePicker copied to clipboard
SwiftUI View
Here is the pull request for my SwiftUI version of the TimeZonePicker!
So far, it's worked correctly on macOS. I wasn't able to test it with iOS, unfortunately; for some reason Xcode refused to compile an iOS test app, and it looks like the solution may be to try and reinstall Xcode, which I'm not able to do at the moment. Looking through the code, though, I don't see anything that looks explicitly macOS-specific.
I also updated the README to include some info on using the SwiftUI view.
Hey @Meorge, thanks for the PR. I'll have a look at it in more detail over the next little bit and let you know what I've found.
One thing I did notice though - the CI build failed as you're using Identifiable in CityCountryTimeZone which is iOS 13.0 and above, so to fix this error you might need to mark the support version up from 8.0 to 13.0+
Ah, thanks for noting that! I've never used a CI build system before, so I'm still learning a lot. I'll try upping the iOS version to 13.0.
This is strange - I tried updating the podspec file and pushing, but it seems to be stuck on an error on their end:
- ERROR | [iOS] unknown: Encountered an unknown error (Simulator for iOS 13.0 is not available.
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fourflusher-2.3.1/lib/fourflusher/xcodebuild.rb:9:in `destination'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/validator.rb:1033:in `xcodebuild'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/validator.rb:711:in `block in build_pod'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:145:in `message'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/validator.rb:692:in `build_pod'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/validator.rb:393:in `block in perform_extensive_analysis'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/validator.rb:381:in `all?'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/validator.rb:381:in `perform_extensive_analysis'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/validator.rb:128:in `validate'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command/lib/lint.rb:87:in `block in run'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command/lib/lint.rb:69:in `each'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command/lib/lint.rb:69:in `run'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/Users/vagrant/.rbenv/versions/2.6.3/bin/pod:23:in `load'
/Users/vagrant/.rbenv/versions/2.6.3/bin/pod:23:in `<main>'
) during validation.
I'm guessing this just means I need to choose a different iOS version to target - one that they have the simulator for - but I'm not sure how to find out which ones are available.
Ahhh @Meorge this might need some update on the stack used for the build. I think it might be using XCode 10. I'll look at it soon.
Ah okay, thanks!
Re-running it now with XCode 11.6
Apologies on being absent for a few days, there were some other things I had to work on.
I checked the result of the test and saw that CocoaPods wasn't happy about the iOS version requirement, so I upped it to iOS 13 as well. The error it's hitting now is perplexing me: the example project seems to be unable to find the TimeZonePicker module, but I never modified anything with the example project itself - only added the SwiftUI classes.
No worries at all, it's same with me - and also looks like I won't be able to get to this for another little while sorry. When I do get some time to review, I'll fix the Cocoapod issue as well. Sorry about the delay and thanks for contributing!
Ok, no problem. Thanks again for putting up with my finding my way around the CI system 😅
Sorry both, but is the current version working with SwiftUI and iOS?
Hi @jalurgemilang, sorry I've been busy and not really updating this library at all lately - at this stage I'm not sure I ever will really unless something changes. Feel free to fork it from the branch @Meorge has and use it from there rather than what's released.
Hi @jalurgemilang , from my end I don't currently have plans to continue updating or working on it unless/until I have a project that needs it. I recall my implementation being fairly basic SwiftUI, so if it doesn't still work, it might not be a lot of effort to update it?
Thanks, both of you for your comments!