shinydevelopment / SimulatorStatusMagic

Clean up your status bar for taking screenshots on the iOS simulator.
MIT License
2.35k stars 140 forks source link

Support overriding the date on iPad, fix #72 #77

Closed saagarjha closed 5 years ago

saagarjha commented 5 years ago

I've mostly copy/pasted the time override implementation and tweaked it to work for the date. The localized date format string is a hack (for example, it doesn't work in Chinese because it uses English day of the week names), but I'm not sure what format Apple's using here; hopefully this is good enough as a stopgap.

daveverwer commented 5 years ago

Apologies for not getting to this until now, and thanks very much for taking the time to help with it!

I made a couple more commits before merging:

I'll do a release to CocoaPods now.

saagarjha commented 5 years ago

No problem. However, do you mind if I make the case for keeping the date as Tuesday, January 9, 2007? Apple, on their website, uses the date that the images were "taken"; for the iOS 12 page it's Wednesday, September 12 as that's when it was released. The date and time is supposed to symbolize that of the launch of iPhone, so this is what QuickTime uses (screenshot in #72).

daveverwer commented 5 years ago

Interesting! I used "Tue Oct 30" as it's the date used on the iPad page screenshots. https://www.apple.com/ipad-pro/

Given that there's inconsistencies between the iPad Pro page and the iOS 12 page, I'd be inclined to agree with your 2007 date as a good compromise. It's good that it also matches the QuickTime version in case people take some screenshots with a device connected via QuickTime and some with the Simulator. I'll revert that commit before publishing the new version.

saagarjha commented 5 years ago

Yup, I went through the exact same thought process when writing this pull request, trying to find an "official" date to use. I even checked iPad App Store screenshots!

daveverwer commented 5 years ago

It's weird that they use three different dates. They are usually so consistent!

Thanks very much for the help with this!

daveverwer commented 5 years ago

Alright, my changes needed a bit more work but it's done now and pushed to CocoaPods as v2.4.

saagarjha commented 5 years ago

Thanks. Quick question: why are we using SIMULATOR_MODEL_IDENTIFIER instead of UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad, or [UIDevice.currentDevice.model hasPrefix:@"iPad"]? I don't understand how this code only executing in the simulator is relevant, since this should work both on a real device and the simulator. Is there something I'm missing here?

daveverwer commented 5 years ago

I had it in my head that UIDevice.currentDevice.userInterfaceIdiom had been deprecated, but apparently it hasn't! Changed and released 2.4.1 to CocoaPods.