Skip to content

Instantly share code, notes, and snippets.

View pogramos's full-sized avatar
💪
Building resilient software

Guilherme Ramos pogramos

💪
Building resilient software
View GitHub Profile
@pogramos
pogramos / Variables.swift
Last active October 19, 2020 13:28
CustomButton - Variables
override var isEnabled: Bool {
didSet {
updateBackground()
}
}
var style: ButtonStyle {
didSet {
apply(style: style)
}
@pogramos
pogramos / Methods.swift
Last active October 19, 2020 13:29
CustomButton - Methods
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()
@pogramos
pogramos / Initial.swift
Last active October 19, 2020 13:30
CustomButton - Initial
enum ButtonStyle {
case primary
case secondary
}
class CustomButton: UIButton {
var style: ButtonStyle = .primary
init(style: ButtonStyle) {
self.style = style
@pogramos
pogramos / ButtonStyle.swift
Last active October 19, 2020 13:31
Custom Button - Button Configuration
enum ButtonStyle {
case primary
case secondary
var font: UIFont {
switch self {
case .primary:
return .systemFont(ofSize: 13, weight: .bold)
case .secondary:
return .systemFont(ofSize: 13)
@pogramos
pogramos / MyCustomButton.swift
Last active October 19, 2020 13:32
Custom Button - Initial Setup
final class MyCustomButton: UIButton {
override var isEnabled: Bool {
didSet {
updateBackground()
}
}
var style: ButtonStyle {
didSet {
apply(style: style)
@pogramos
pogramos / UIExampleStrings.strings
Last active June 23, 2022 15:11
UI Test extensions to make our life easier (idea of @rafaellage and my collaboration)
/*
UIExampleStrings.strings
Created by Guilherme on 9/15/18.
Copyright © 2018. All rights reserved.
*/
"email" = "login@login.com";
"password" = "123456";
@pogramos
pogramos / Fastfile
Created August 17, 2018 17:01
Custom fastfile lanes
# 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
@pogramos
pogramos / .zshrc
Last active October 9, 2017 01:39
My zshrc configuration for powerlevel9k
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