AlignmentControl 1.0.1

AlignmentControl 1.0.1

Besla 维护。



AlignmentControl 是一个对齐组件

Twitter CI Status Version iOS 10.0+ Swift 5 License Platform

Artboard

方向

AlignmentDirection
水平
垂直

模式

AlignmentMode
居中
顶部
中间
底部

动画

AnimationType
淡入淡出
平移
弹跳

使用

let alignView = AlingmentView(frame: CGRect(x: 0, y: 0, width: 124, height: 50))
alignView.setBackgroundImage(UIImage(named: "group"))
alignView.delegate = self
alignView.dataSource = self
alignView.animation = .Bounce
alignView.activeAligmentModes = [.Left, .Top]
alignView.isPulse = false

您还需要遵守如 UITableview 中的数据源和代理

public protocol AlingmentViewDelegate: class {
	func didSelectOptionFor(_ mode: AlignmentMode)
}

public protocol AlingmentViewDataSource: class {
	func optionsForAlignment() -> [AlignmentMode]
}

更多详情请参考示例

示例

要运行示例项目,请先克隆仓库,然后从示例目录运行pod install

需求

iOS 10.0+ Xcode Xcode 9.0+ Swift 5.0

安装

AlignmentControl可以通过CocoaPods获得。要安装它,只需在Podfile中添加以下行

pod 'AlignmentControl'

作者

Beslan Tularov | @JiromTomson

Mikhail Kupriyanov | mpkupriyanov

许可

MIT License

Copyright (c) 2018 Beslan Tularov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.