Skip to content

Instantly share code, notes, and snippets.

Christopher Hannah chrishannah

Block or report user

Report or block chrishannah

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chrishannah
chrishannah / InsetLabel.swift
Last active Apr 6, 2019
A simple subclass of UILabel that allows you to add content insets to pad the content.
View InsetLabel.swift
import UIKit
class InsetLabel: UILabel {
var contentInsets = UIEdgeInsets.zero
override func drawText(in rect: CGRect) {
let insetRect = UIEdgeInsetsInsetRect(rect, contentInsets)
super.drawText(in: insetRect)
}
@chrishannah
chrishannah / table.swift
Created Jun 8, 2018
Example code for the post "Hiding Extra Separators on a UITableView" on blog.chrishannah.me
View table.swift
import PlaygroundSupport
import UIKit
class DataSource: NSObject, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
@chrishannah
chrishannah / iOS Icon Sizes.md
Last active Sep 19, 2019
A list containing all the icon names and sizes for iOS and watchOS.
View iOS Icon Sizes.md

iOS 12 Icon Sizes

(Taken from Xcode 10)

iPhone

iPhone Notification (iOS 7-12) 20pt

  • 2x - 40px
  • 3x - 60px
You can’t perform that action at this time.