MLSwiftBasic 1.1.1

MLSwiftBasic 1.1.1

测试已测试
Lang语言 SwiftSwift
许可证 MIT
发布上次发布2015年7月
SPM支持 SPM

MakeZL 维护。



  • makezl

MLSwiftBasic

包含一系列功能,如自定义导航栏下拉刷新/上拉加载更多视觉效果实用分类等等,而耦合性很低!

示例或动图

image image image

新特性

懒人 Swift 基本框架,提供各种简单、便捷的接口。

目前支持的功能:

1> 自定义导航栏、监听事件

2> 滚动效果

3> 正在筹备一些分类,期待您的 PullRequest

4> 正在准备滑动渐变的导航栏效果

5> 下拉刷新、上拉加载更多(支持自定义动画/自带箭头动画/娃娃脸动画)

准备迭代:

6> iOS7的手势

安装

使用 Cocoapods

pod 'MLSwiftBasic', '1.1.0'

使用

导入类

让 UINavigationController 继承 MBNavigationViewController 就可以实现,让 UIViewController 继承 MBBaseViewController 就可以实现

ViewController 代码

项目名称

override func titleStr() -> String {
    return "Title"
}

override func rightStr() -> String {
    return "rightTitle"
}

override func leftStr() -> String {
    return "leftTitle"
}

右侧标题数组

override func rightTitles() -> NSArray {
    return ["右边按钮1", "右边按钮2"]
}

项目事件

override func rightClick() {

}

override func leftClick() {

} 

override func titleClick() {

}

项目数组事件

override func rightClickAtIndexBtn(button: UIButton) {
    println("点击了btn")
    println(button)
}

项目图片

override func rightImg() -> String {
    return "xx.jpg"
}

override func leftImg() -> String {
    return return "xx.jpg"
}

override func titleImg() -> String {
    return "xx.jpg"
}

配置

MBBaseCommon.swift

// 背景色
let BG_COLOR = UIColor(rgba: "e6e6e6")
// 返回按钮的图片名
let BACK_NAME = "nav_back"
// 自定义导航高度
let NAV_BAR_HEIGHT:CGFloat = 44
// 顶部的Y值
let NAV_BAR_Y:CGFloat = 20
// 按钮的宽度
let NAV_ITEM_LEFT_W:CGFloat = 45
let NAV_ITEM_RIGHT_W:CGFloat = 45
// 按钮的字体
let NAV_ITEM_FONT:UIFont = UIFont.systemFontOfSize(16)
// 标题的字体
let NAV_TITLE_FONT:UIFont = UIFont.systemFontOfSize(18)
// 字体的颜色
let NAV_TEXT_COLOR:UIColor = UIColor.whiteColor()
// 导航栏的颜色
let NAV_BG_COLOR = UIColor(rgba: "ff9814")
// 顶部的Y
let TOP_Y:CGFloat =     (CGFloat((UIDevice.currentDevice().systemVersion as NSString).floatValue) >= 7.0) ? 64.0 : 44.0
// Margin
let MARGIN_8:CGFloat = 8.0

联系方式

@weibo : 我的微博

许可证

MLSwiftBasic 在 MIT 许可证下发布

Copyright (c) 2015 MakeZL (@MakeZL)

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.