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
// =========================================================================== | |
// Starting point: | |
// - Sketch file with many shapes (icons). | |
// - Ideally each icon category is its own page named appropriately. | |
// How to use it: | |
// - Open Sketch file and press Ctrl + Shift + K. | |
// - Paste script and click "Run". |
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
import UIKit | |
extension UIView { | |
// ---------------------------------------------------------------------- | |
// Make it cleaner to add all your elements as subviews in a single line. | |
// Example: | |
// view.addSubviews([coverImage, titleLabel, followButton, …]) | |
func addSubviews(_ views: [UIView]) { |
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 btn1 = StyledButton(text: "Regular") | |
let btn2 = StyledButton(text: "Tint primary wide", styles: [.tintPrimary, .wide]) | |
let btn3 = StyledButton(text: "Primary large", styles: [.primary, .large]) | |
let btn4 = StyledButton(text: "Large", styles: [.large]) | |
let btn5 = StyledButton(text: "Label Button", styles: [.label, .tintPrimary]) | |
let btn6 = StyledButton(text: "Secondary", styles: [.secondary]) | |
let btn7 = StyledButton(text: "Tag", styles: [.tag]) | |
let btn8 = StyledButton(text: "Vertical", image: UIImage(named: "circle"), styles: [.iconVertical, .tintSecondary]) | |
let btn9 = StyledButton(text: "With icon", image: UIImage(named: "circle"), styles: [.iconHorizontal]) | |
let btn10 = StyledButton(image: UIImage(named: "star")) |
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 setLineSpacing(lineSpacing: CGFloat) { | |
let text = self.text | |
if let text = text { | |
let attributeString = NSMutableAttributedString(string: text) | |
let style = NSMutableParagraphStyle() | |
style.lineSpacing = lineSpacing | |
style.alignment = self.textAlignment | |
attributeString.addAttribute(NSAttributedString.Key.paragraphStyle, value: style, range: NSMakeRange(0, text.count)) | |
self.attributedText = attributeString |
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
// | |
// InstagramFeed.swift | |
// Landmarks | |
// | |
// Created by Fabio Giolito on 04/06/2019. | |
// Copyright © 2019 Apple. All rights reserved. | |
// | |
// =================================================== | |
// This is just a quick UI test. |
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
// | |
// InstagramFeed.swift | |
// Landmarks | |
// | |
// Created by Fabio Giolito on 04/06/2019. | |
// Copyright © 2019 Apple. All rights reserved. | |
// | |
// =================================================== | |
// This is just a quick UI test. |
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
// | |
// FacebookReactions.swift | |
// | |
// Created by Fabio Giolito on 10/06/2019. | |
// Follow me: https://twitter.com/fabiogiolito | |
// | |
import SwiftUI | |
struct FacebookReactions : View { |
OlderNewer