IconView
public class IconView : UIView
extension IconView: Badgeable
IconView is a class that helps the usage of icons with the Design System, as an UIView
that displays an icon.
The icons are not available with NatDS
; it’s necessary to use the icon library NatDSIcons
.
Example of usage:
let iconView = IconView()
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
-
The alignment of the icon inside the view
Declaration
Swift
public var aligment: NSTextAlignment { get set }
-
The string that comes from
NatDSIcons
and it’s translated as an iconDeclaration
Swift
public var iconText: String? { get set }
-
Sets if should show a default icon or a customized icon
Declaration
Swift
public var shouldShowDefaultIcon: Bool { get set }
-
Undocumented
Declaration
Swift
public override init(frame: CGRect)
-
Undocumented
Declaration
Swift
public convenience init(fontSize: CGFloat, icon: String? = nil)
-
Undocumented
Declaration
Swift
public convenience init(_ icon: String? = nil)
-
Undocumented
Declaration
Swift
public override func tintColorDidChange()
-
Updates the font size, which changes the size of the icon at the view. The method receives an
UIFont
because it uses the font’s pointSizeDeclaration
Swift
public func setFontSize(size: UIFont)
Parameters
size
an font with the chosen size
-
Updates the font size, which changes the size of the icon at the view. The method receives a CGFloat and uses it as the font’s pointSize
Declaration
Swift
public func setFontSize(size: CGFloat)
Parameters
size
a CGFloat that corresponds to the chosen size