Skip to content

Instantly share code, notes, and snippets.

@chrishannah
chrishannah / InsetLabel.swift
Last active March 12, 2022 14:01
A simple subclass of UILabel that allows you to add content insets to pad the content.
import UIKit
class InsetLabel: UILabel {
var contentInsets = UIEdgeInsets.zero
override func drawText(in rect: CGRect) {
let insetRect = UIEdgeInsetsInsetRect(rect, contentInsets)
super.drawText(in: insetRect)
}
//
// UIImage+Ext.swift
// frazeit
//
// Created by Maysam Shahsavari on 9/24/19.
// Copyright © 2019 Maysam Shahsavari. All rights reserved.
//
import Foundation
import UIKit