Skip to content

Instantly share code, notes, and snippets.

@natecook1000
Last active July 10, 2018 19:24
Show Gist options
  • Star 40 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save natecook1000/151d8de423eb77fc87bf to your computer and use it in GitHub Desktop.
Save natecook1000/151d8de423eb77fc87bf to your computer and use it in GitHub Desktop.
NSHipster New Year's 2016

Greetings and salutations, NSHipsters!

As the year winds down, it's a tradition here at NSHipster to ask you, dear readers, to offer up your favorite tricks and tips from the past year as gifts to your fellow hipsters. With iOS 9, El Capitan, brand new watch- and tvOS's, and the open-sourcing of some minor Apple-related tech, there's bound to be lots to share.

Submit your favorite piece of Swift or @objc trivia, helpful hints, unexpected discoveries, useful workarounds, useless fascinations, or anything else you found cool this year. Just comment below!

If you need inspiration, try the list from last year, or from the year before, or from the year before that.

새해 복 많이 받으세요! 🎆

@joemasilotti
Copy link

How to tell if your app is running under UI Tests:

UI Tests:

class UITests: TestCase {
    let app = XCUIApplication()

    override func setUp() {
        super.setUp()
        app.launchArguments = ["UI-TESTING"]
        app.launch()
    }
}

App Code:

func UITesting() -> Bool {
    return NSProcessInfo.processInfo().arguments.contains("UI-TESTING")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment