Created
Mar 13, 2020 10:25 AM
Tags
Swift
Keywords
if isInDevelopment([.username("muukii")]) {
// Run development code to develop
} else {
// Run stable code
}
#if DEBUG
@inline(__always)
func isInDevelopment(_ conditions: [DebugFilterOption]) -> Bool {
for condition in conditions {
switch condition {
case .username(let username):
if #file.description.contains(username) {
return true
}
}
}
return false
}
#else
@inline(__always)
func isInDevelopment(_ conditions: [DebugFilterOption]) -> Bool {
return false
}
#endif