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
/* | |
* Copyright 2020 Coodly LLC | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
internal class DictionaryDecoder: JSONDecoder { | |
func decode<T>(_ type: T.Type, from dictionary: Any) throws -> T where T : Decodable { | |
let jsonData = try JSONSerialization.data(withJSONObject: dictionary, options: []) | |
return try decode(T.self, from: jsonData) | |
} | |
} |
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
let monospaced = UIFont.monospacedDigitSystemFont(ofSize: UIFont.systemFontSize, weight: .bold) | |
let fontMetrics = UIFontMetrics(forTextStyle: .body) | |
runtime.font = fontMetrics.scaledFont(for: monospaced) |
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
PATH_TO_MODELD="mTimer.xcdatamodeld" | |
OUTPUT_PATH="Classes" | |
type mogenerator >/dev/null 2>&1 || { | |
echo >&2 "warning: mogenerator not found. You will need it when changing core data model"; | |
exit 0; | |
} | |
CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print :_XCCurrentVersionName" "${PATH_TO_MODELD}/.xccurrentversion") |