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
# skip if we don't run in debug | |
if [ "$CONFIGURATION" != "Debug" ]; then | |
echo "Skip certificate check" | |
exit 0 | |
fi | |
# 1 Create file for storing last shown date | |
if [ ! -d ~/.cache/ ]; then | |
mkdir ~/.cache/ |
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
#!/usr/bin/env bash | |
############################################################### | |
# DEPLOY SCRIPT # | |
# # | |
# Script used for creating the specific # | |
# tag used for triggering the CI deployment # | |
# # | |
# End tag should look like this: # | |
# internal-all/v1.0.0-1234 # |
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
ThemeManager.apply(.red) |
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
// application.keyWindow?.reload() | |
// Implementation | |
public extension UIWindow { | |
/// Unload all views and add them back | |
/// Used for applying `UIAppearance` changes to existing views | |
func reload() { | |
subviews.forEach { view in | |
view.removeFromSuperview() |
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
class BlueTheme: ThemeProtocol { | |
var assets: Themeable { | |
return ThemeAssets( | |
labelAssets: AppLabelAssets( | |
color: UIColor.blue.primary, | |
font: .systemFont(ofSize: 18) | |
), | |
buttonAssets: AppButtonAssets( | |
normalBackgroundColor: UIColor.blue.primary, |
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
func updateLabel(using themeAssets: LabelAssets) { | |
AppLabel.appearance().textColor = themeAssets.textColor | |
} |
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
struct ThemeManager { | |
static func apply(_ theme: Theme, application: UIApplication) { | |
// 1 | |
let appTheme = theme.appTheme | |
// 2 | |
updateLabel(using: appTheme.assets.labelAssets) | |
// 3 | |
appTheme.extension?() | |
// 4 |
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
struct LabelAssets { | |
var textColor: UIColor { get } | |
} |
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
protocol Themeable { | |
var labelAssets: LabelAssets { get } | |
var buttonAssets: ButtonAssets { get } | |
var switchAssets: SwitchAssets { get } | |
// ... | |
} |
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
protocol ThemeProtocol { | |
var assets: Themeable { get } | |
var `extension`: (() -> Void)? { get } | |
} |
NewerOlder