Skip to content

Instantly share code, notes, and snippets.

View conscientiousness's full-sized avatar
🧑‍💻
Coding Mode

Jesse Lin conscientiousness

🧑‍💻
Coding Mode
View GitHub Profile
//=====定義Enum=====
enum MyListType: Int, CustomStringConvertible, EnumCaseCountable {
case waitingForReceive
case overseaReceived
case shipmentNotified
case notifyTransferPay
case transferPayChecked
case overseaShipped
case shipmentDone
//
// Navigator.swift
// tripani
//
// Created by Jesse Lin on 11/8/17.
// Copyright © 2017 Tripani. All rights reserved.
//
import Foundation
import UIKit
@conscientiousness
conscientiousness / TextSize.swift
Created April 25, 2019 07:02 — forked from gnou/TextSize.swift
Calculate height of some text when width is fixed
public struct TextSize {
fileprivate struct CacheEntry: Hashable {
let text: String
let font: UIFont
let width: CGFloat
let insets: UIEdgeInsets
fileprivate var hashValue: Int {
return text.hashValue ^ Int(width) ^ Int(insets.top) ^ Int(insets.left) ^ Int(insets.bottom) ^ Int(insets.right)