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 GradientHelper { | |
/// Set gradient background on view use this method on *draw(_ rect:* **CGRect...***)* | |
/// | |
/// - Parameter colours: A grandient colors args | |
func setGradientBackground(angle: CGFloat = 0, colours: CGColor...) { | |
let colours = colours as CFArray | |
let context = UIGraphicsGetCurrentContext() | |
let gradient = CGGradient(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors: colours, locations: nil)! | |
// Make the right degree |
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
extension UILabel { | |
func letterSpacing(spacing: CGFloat) { | |
guard let text = self.text else { | |
return | |
} | |
var attributedText: NSMutableAttributedString? | |
if self.attributedText == nil { | |
attributedText = NSMutableAttributedString(string: text) | |
} |
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
// | |
// ViewController.swift | |
// IntroAnimation | |
// | |
// Created by Denis Oliveira on 4/19/17. | |
// Copyright © 2017 Denis Oliveira. All rights reserved. | |
// | |
import UIKit |
NewerOlder