Skip to content

Instantly share code, notes, and snippets.

@imjhk03
Created January 9, 2021 07:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imjhk03/2cf11f1fabbc0ecb329596ca59e5b015 to your computer and use it in GitHub Desktop.
Save imjhk03/2cf11f1fabbc0ecb329596ca59e5b015 to your computer and use it in GitHub Desktop.
A function to convert Zeplin line height to iOS line spacing
import UIKit
enum UIHelper {
/// Convert Zeplin line height to iOS line spacing
static func lineSpacing(from lineHeight: CGFloat, font: UIFont) -> CGFloat {
let value = lineHeight - font.lineHeight
return value
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment