-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from v2ex/xcconfig-improvements
Add build settings to xcconfig.
- Loading branch information
Showing
8 changed files
with
77 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// CLConfiguration.swift | ||
// Launcher | ||
// | ||
// Created by Kai on 1/19/22. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
enum CLConfiguration { | ||
enum Error: Swift.Error { | ||
case missingKey, invalidValue | ||
} | ||
|
||
private static func value<T>(for key: String) throws -> T where T: LosslessStringConvertible { | ||
guard let object = Bundle.main.object(forInfoDictionaryKey:key) else { | ||
throw Error.missingKey | ||
} | ||
|
||
switch object { | ||
case let value as T: | ||
return value | ||
case let string as String: | ||
guard let value = T(string) else { fallthrough } | ||
return value | ||
default: | ||
throw Error.invalidValue | ||
} | ||
} | ||
|
||
static var bundlePrefix: String { | ||
let prefix: String | ||
do { | ||
prefix = try Self.value(for: "ORGANIZATION_IDENTIFIER_PREFIX") | ||
} catch { | ||
prefix = "" | ||
} | ||
return prefix | ||
} | ||
} |
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
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