diff --git a/Sources/SwiftMathRender/MathRender/MTConfig.swift b/Sources/SwiftMathRender/MathRender/MTConfig.swift index d3a1df8..85c698e 100644 --- a/Sources/SwiftMathRender/MathRender/MTConfig.swift +++ b/Sources/SwiftMathRender/MathRender/MTConfig.swift @@ -11,11 +11,11 @@ import Foundation import UIKit -typealias MTView = UIView -typealias MTColor = UIColor -typealias MTBezierPath = UIBezierPath -typealias MTLabel = UILabel -typealias MTRect = CGRect +public typealias MTView = UIView +public typealias MTColor = UIColor +public typealias MTBezierPath = UIBezierPath +public typealias MTLabel = UILabel +public typealias MTRect = CGRect let MTEdgeInsetsZero = UIEdgeInsets.zero func MTGraphicsGetCurrentContext() -> CGContext? { UIGraphicsGetCurrentContext() } @@ -24,11 +24,11 @@ func MTGraphicsGetCurrentContext() -> CGContext? { UIGraphicsGetCurrentContext() import AppKit -typealias MTView = NSView -typealias MTColor = NSColor -typealias MTBezierPath = NSBezierPath -typealias MTEdgeInsets = NSEdgeInsets -typealias MTRect = NSRect +public typealias MTView = NSView +public typealias MTColor = NSColor +public typealias MTBezierPath = NSBezierPath +public typealias MTEdgeInsets = NSEdgeInsets +public typealias MTRect = NSRect let MTEdgeInsetsZero = NSEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0) func MTGraphicsGetCurrentContext() -> CGContext? { NSGraphicsContext.current?.cgContext } diff --git a/Sources/SwiftMathRender/MathRender/MTMathUILabel.swift b/Sources/SwiftMathRender/MathRender/MTMathUILabel.swift index d3d8efa..7685cc1 100644 --- a/Sources/SwiftMathRender/MathRender/MTMathUILabel.swift +++ b/Sources/SwiftMathRender/MathRender/MTMathUILabel.swift @@ -48,7 +48,7 @@ public enum MTTextAlignment : UInt { the `font` parameter. */ @IBDesignable -class MTMathUILabel : MTView { +public class MTMathUILabel : MTView { /** The `MTMathList` to render. Setting this will remove any `latex` that has already been set. If `latex` has been set, this will @@ -70,7 +70,7 @@ class MTMathUILabel : MTView { `mathList` that is set. @see error */ @IBInspectable - var latex = "" { + public var latex = "" { didSet { self.error = nil var error : NSError? = nil @@ -105,7 +105,7 @@ class MTMathUILabel : MTView { /** Convenience method to just set the size of the font without changing the fontface. */ @IBInspectable - var fontSize = MTFontManager.fontManager.kDefaultFontSize { + public var fontSize = MTFontManager.fontManager.kDefaultFontSize { didSet { self.font = font?.copy(withSize: fontSize) } @@ -113,7 +113,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 { + public var textColor:MTColor? = MTColor.black { didSet { self.displayList?.textColor = textColor self.setNeedsDisplay() @@ -125,7 +125,7 @@ class MTMathUILabel : MTView { the border/background color. sizeThatFits: will have its returned size increased by these insets. */ @IBInspectable - var contentInsets = MTEdgeInsetsZero { + public var contentInsets = MTEdgeInsetsZero { didSet { self.invalidateIntrinsicContentSize() self.setNeedsLayout() @@ -185,7 +185,7 @@ class MTMathUILabel : MTView { self.addSubview(errorLabel!) } - override func draw(_ dirtyRect: MTRect) { + override public func draw(_ dirtyRect: MTRect) { super.draw(dirtyRect) if self.mathList == nil { return } @@ -237,19 +237,19 @@ class MTMathUILabel : MTView { return size } - override var intrinsicContentSize: CGSize { _sizeThatFits(CGSizeZero) } + override public var intrinsicContentSize: CGSize { _sizeThatFits(CGSizeZero) } #if os(macOS) - override var isFlipped: Bool { false } + override public var isFlipped: Bool { false } func setNeedsDisplay() { self.needsDisplay = true } func setNeedsLayout() { self.needsLayout = true } - override func layout() { + override public func layout() { self._layoutSubviews() super.layout() } #else - override func layoutSubviews() { self._layoutSubviews() } - override func sizeThatFits(_ size: CGSize) -> CGSize { self._sizeThatFits(size) } + override public func layoutSubviews() { self._layoutSubviews() } + override public func sizeThatFits(_ size: CGSize) -> CGSize { self._sizeThatFits(size) } #endif }