Last active
August 15, 2017 15:37
-
-
Save wvdk/e3dd57620c53f338978e6d5d022d3672 to your computer and use it in GitHub Desktop.
if UIApplication.isRunningOnSimulator.swift { ... } else { ... }
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIApplication+isRunningOnSimulator.swift | |
// MusicMind | |
// | |
// Created by Wesley Van der Klomp on 5/11/17. | |
// https://gist.github.com/wvdk/e3dd57620c53f338978e6d5d022d3672 | |
// Thanks to http://stackoverflow.com/a/30284266/6407050 | |
// | |
import Foundation | |
extension UIApplication { | |
static var isRunningOnSimulator: Bool { | |
return TARGET_OS_SIMULATOR != 0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moved to https://github.com/wvdk/A-Swift-Vocabulary/blob/master/UIApplication%2BisRunningOnSimulator.swift