shinydevelopment / SimulatorStatusMagic

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

Add Xcode 10, Swift 4.2 + Carthage example #73

Closed justinswart closed 5 years ago

justinswart commented 5 years ago

Thanks for your work on SimulatorStatusMagic, it's been very helpful to get the right screenshots for our app.

I wasn't able to find an example of how to include the framework on demand using Xcode 10, Swift 4.2 and Carthage so I thought I would contribute this example.

If you think it would be useful then I will also add a link from your README.md.

daveverwer commented 5 years ago

Hi, and apologies for not getting to this for so long.

I'm not a Carthage user so haven't tested this. I wonder though, it looks like this replaces the Carthage instructions in INSTALLATION.md? Maybe we should replace those with these?

justinswart commented 5 years ago

No problem! Thanks for your weekly newsletter by the way 👍

I think that the current installation instructions are fine, this is more to complement them for folks that would like to include the library via Carthage and only for DEBUG builds without having to comment/uncomment code.

I decided to PR this after reading this blog post in which the author needed a directive like #if canImport() in order to not have to change his code each time he wanted to use SimulatorStatusMagic.

daveverwer commented 5 years ago

I think though that the fact that you shouldn't really be including the library in anything other than DEBUG builds makes this a great fit for installation instructions where people do look, rather than another document people may not look at.

Also, given that the CocoaPods installation instructions already limit the library to being installed only in a DEBUG config, I think the code could be made generic and bring Carthage in line with that and just have one set of instructions that cover debug installation using both tools with some generic code using the canImport code below it. What do you think?

justinswart commented 5 years ago

Fair points! So do you think it'll be sufficient to just append the additional information for Carthage installations toINSTALLATION.md?

daveverwer commented 5 years ago

Yes, I think so, if you're interested in doing that! I'm sorry this turned into more of a task than you probably expected it to be! 😄

justinswart commented 5 years ago

No trouble at all, I'll do so within this week 👍

justinswart commented 5 years ago

Woops, haven't forgotten, let's say... this week! 😄

justinswart commented 5 years ago

Happy new year! Finally got around to moving this.

daveverwer commented 5 years ago

Thanks!