This file contains hidden or 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
// Taken from https://stackoverflow.com/a/55409389 | |
public protocol RawComparable : Comparable where Self : RawRepresentable, RawValue: Comparable { } | |
extension RawComparable { | |
public static func < (lhs: Self, rhs: Self) -> Bool { | |
return lhs.rawValue < rhs.rawValue | |
} | |
} |
This file contains hidden or 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
// Taken from https://github.com/kharrison/CodeExamples/blob/master/TableHeader/TableHeaderSwift/TableHeader/ListTableViewController.swift | |
// Calculate the minimum height of the header view that allows | |
// the text label to fit its preferred width. | |
let size = view.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) |
This file contains hidden or 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
// | |
// SnapshotDiffableDataSource.swift | |
// testDiffableDataSource | |
// | |
// Created by Miguel Alcântara on 22/01/2020. | |
// Copyright © 2020 Miguel Alcântara. All rights reserved. | |
// | |
import UIKit |