SmoothTab 1.2.0

SmoothTab 1.2.0

Yervand Saribekyan 维护。



SmoothTab 1.2.0

  • Yervand Saribekyan

SmoothTab

iOS 11.0+ Swift 5.x Badge w/ Version

Preview

要求

  • iOS 11.0+
  • Swift 5.x
  • Xcode 10+

安装

CocoaPods

pod 'SmoothTab'

如何使用

完整屏幕

为了设置和自定义组件,您应该使用 SmoothTabItem 创建项。

// Set Smooth Tab View on UIView in stroyboard
@IBOutlet weak var smoothTabView: SmoothTabView!

// Or create it without storyboard
let smoothTabView = SmoothTabView()
self.addSubview(smoothTabView)

let items: [SmoothTabItem] = [...]

// For configuring styles create new SmoothTabOptions
var options = SmoothTabOptions()
options.titleColor = UIColor.white
options.titleFont = .systemFont(ofSize: 16)
options.shadow = .default

// Finally call setup smoothTabView with items, options and give delegate
smoothTabView.setup(with: items, options: options, delegate: self)

您可以使用选项 SmoothTabOptions, SmoothTabShadowOptions来自定义视图。

/// For set corner radius to selected view
///
/// - rounded: for calculating rounded view
/// - fixed: fixed corner radius with corner option
public enum CornerRadius {
	case rounded
	case fixed(corner: CGFloat)
}

public struct SmoothTabOptions {

	/// Tabs parent view options
	public var backgroundColor: UIColor
	public var imageContentMode: UIViewContentMode
	public var itemsMargin: CGFloat
	public var shadow: SmoothTabShadowOptions?
    public var align: ContentPreferredAlign

	/// Selected View Options
	public var titleFont: UIFont
	public var titleColor: UIColor
	public var cornerRadius: CornerRadius
	public var borderWidth: CGFloat
	public var borderColor: UIColor
	public var innerPadding: CGFloat
	public var imageTitleMargin: CGFloat

}

public struct SmoothTabShadowOptions {

	public var color: UIColor
	public var offset: CGSize
	public var opacity: Float
	public var radius: CGFloat

}

请实现 SmoothTabDelegate 以用于标签选择动作。

@objc public protocol SmoothTabDelegate: class {
    func smootItemSelected(at index: Int)
}

支持

欢迎提出任何建议、错误报告、功能请求或问题,开启问题

联系我们!

如果您在我们的组件中使用了项目,欢迎发送链接给我们。只需发邮件到 [email protected],并对动画有任何问题或建议。

许可证

MIT许可证 (MIT)

版权所有 (c) 2018 Yervand

任何人可以免费获得本软件和相关文档的副本(“软件”),无需任何限制地处理该软件,包括但不仅限于使用、复制、修改、合并、发布、分发、再许可和/或销售软件的副本,并允许软件提供者进行上述操作,但需遵守以下条件:

上述版权声明和许可声明应包含在本软件的副本或主要内容中。

软件按“现状”提供,不提供任何形式的明示或暗示保证,包括但不限于适用性、针对特定目的的适用性和非侵权性保证。在任何情况下,作者或版权所有者不对任何索赔、损害或其他责任承担任何责任,无论源于合同、侵权或其他原因,包括但不限于使用或与其他软件或其使用相关联的结果。