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
override var isEnabled: Bool { | |
didSet { | |
updateBackground() | |
} | |
} | |
var style: ButtonStyle { | |
didSet { | |
apply(style: style) | |
} |
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
private func apply(style: ButtonStyle) { | |
titleLabel?.font = style.font | |
setTitleColor(style.enabledTextColor, for: .normal) | |
setTitleColor(style.disabledTextColor, for: .disabled) | |
layer.borderWidth = style.borderWidth | |
layer.borderColor = style.borderColor.cgColor | |
layer.cornerRadius = style.cornerRadius | |
updateBackground() |
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
enum ButtonStyle { | |
case primary | |
case secondary | |
} | |
class CustomButton: UIButton { | |
var style: ButtonStyle = .primary | |
init(style: ButtonStyle) { | |
self.style = style |
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
/* | |
UIExampleStrings.strings | |
Created by Guilherme on 9/15/18. | |
Copyright © 2018. All rights reserved. | |
*/ | |
"email" = "login@login.com"; | |
"password" = "123456"; |
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
# Customize this file, documentation can be found here: | |
# https://docs.fastlane.tools/actions/ | |
# All available actions: https://docs.fastlane.tools/actions | |
# can also be listed using the `fastlane actions` command | |
# Change the syntax highlighting to Ruby | |
# All lines starting with a # are ignored when running `fastlane` | |
# If you want to automatically update fastlane if a new version is available: | |
# update_fastlane |
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
export TERM="xterm-256color" | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=~/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |