From fd09540d115a93a1f549b4066bd907eafb7516bc Mon Sep 17 00:00:00 2001 From: Michael Griebling Date: Mon, 16 Jan 2023 08:18:04 -0500 Subject: [PATCH] Added inspectable/designable tags to the MathUILabel. --- Sources/SwiftMathRender/MathRender/MTMathUILabel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/SwiftMathRender/MathRender/MTMathUILabel.swift b/Sources/SwiftMathRender/MathRender/MTMathUILabel.swift index adcaaf8..d3d8efa 100644 --- a/Sources/SwiftMathRender/MathRender/MTMathUILabel.swift +++ b/Sources/SwiftMathRender/MathRender/MTMathUILabel.swift @@ -47,6 +47,7 @@ public enum MTTextAlignment : UInt { When created it uses `[MTFontManager defaultFont]` as its font. This can be changed using the `font` parameter. */ +@IBDesignable class MTMathUILabel : MTView { /** The `MTMathList` to render. Setting this will remove any @@ -68,6 +69,7 @@ class MTMathUILabel : MTView { has been set. If latex has not been set, this will return the latex output for the `mathList` that is set. @see error */ + @IBInspectable var latex = "" { didSet { self.error = nil @@ -102,6 +104,7 @@ class MTMathUILabel : MTView { } /** Convenience method to just set the size of the font without changing the fontface. */ + @IBInspectable var fontSize = MTFontManager.fontManager.kDefaultFontSize { didSet { self.font = font?.copy(withSize: fontSize) @@ -109,6 +112,7 @@ class MTMathUILabel : MTView { } /** This sets the text color of the rendered math formula. The default color is black. */ + @IBInspectable var textColor:MTColor? = MTColor.black { didSet { self.displayList?.textColor = textColor @@ -120,6 +124,7 @@ class MTMathUILabel : MTView { `UIEdgeInsetsZero` by default. This is useful if you need some padding between the math and the border/background color. sizeThatFits: will have its returned size increased by these insets. */ + @IBInspectable var contentInsets = MTEdgeInsetsZero { didSet { self.invalidateIntrinsicContentSize()