Created
January 9, 2021 07:26
-
-
Save imjhk03/2cf11f1fabbc0ecb329596ca59e5b015 to your computer and use it in GitHub Desktop.
A function to convert Zeplin line height to iOS line spacing
This file contains 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
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