TabBarItem

@objc(FWTabBarItem)
@objcMembers
open class TabBarItem : UITabBarItem

FWTabBarItem inherits from UITabBarItem, the purpose is to provide UITabBarItem property settings for FWTabBarItemContentView. Support most commonly used attributes, such as image, selectedImage, title, tag etc.

Unsupport properties: MARK: UIBarItem properties 1. var landscapeImagePhone: UIImage? 2. var imageInsets: UIEdgeInsets 3. var landscapeImagePhoneInsets: UIEdgeInsets 4. func setTitleTextAttributes(_ attributes: [String : Any]?, for state: UIControlState) 5. func titleTextAttributes(for state: UIControlState) -> [String : Any]? MARK: UITabBarItem properties 1. func setBadgeTextAttributes(_ textAttributes: [String : Any]?, for state: UIControlState) 2. func badgeTextAttributes(for state: UIControlState) -> [String : Any]?

UIView properties

  • tag

    The receiver’s tag, an application-supplied integer that you can use to identify bar item objects in your application. default is 0

    Declaration

    Swift

    open override var tag: Int { get set }

UIBarItem properties

  • A Boolean value indicating whether the item is enabled, default is YES.

    Declaration

    Swift

    open override var isEnabled: Bool { get set }
  • The title displayed on the item, default is nil

    Declaration

    Swift

    open override var title: String? { get set }
  • The image used to represent the item, default is nil

    Declaration

    Swift

    open override var image: UIImage? { get set }
  • The imageURL used to represent the item, default is nil

    Declaration

    Swift

    open var imageURL: String? { get set }

UITabBarItem properties

  • The image displayed when the tab bar item is selected, default is nil.

    Declaration

    Swift

    open override var selectedImage: UIImage? { get set }
  • The imageURL displayed when the tab bar item is selected, default is nil.

    Declaration

    Swift

    open var selectedImageURL: String? { get set }
  • Text that is displayed in the upper-right corner of the item with a surrounding red oval, default is nil.

    Declaration

    Swift

    open override var badgeValue: String? { get set }
  • The offset to use to adjust the title position, default is UIOffset.zero.

    Declaration

    Swift

    open override var titlePositionAdjustment: UIOffset { get set }
  • The background color to apply to the badge, make it available for iOS8.0 and later. If this item displays a badge, this color will be used for the badge’s background. If set to nil, the default background color will be used instead.

    Declaration

    Swift

    open override var badgeColor: UIColor? { get set }

FWTabBarItem properties

  • Customize content view, default is TabBarItemContentView

    Declaration

    Swift

    open var contentView: TabBarItemContentView { get set }
  • The unselected image is autogenerated from the image argument. The selected image is autogenerated from the selectedImage if provided and the image argument otherwise. To prevent system coloring, provide images with UIImageRenderingModeAlwaysOriginal (see UIImage.h)

    Declaration

    Swift

    public init(_ contentView: TabBarItemContentView = TabBarItemContentView(), title: String? = nil, image: Any? = nil, selectedImage: Any? = nil, tag: Int = 0)
  • Undocumented

    Declaration

    Swift

    public override init()
  • Undocumented

    Declaration

    Swift

    public required init?(coder aDecoder: NSCoder)