测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可 | MIT |
发布最新发布 | 2017年4月 |
SwiftSwift版本 | 3.0 |
SPM支持SPM | ✗ |
由 Eiji Kushida 维护。
Swift 3 的扩展集合
Swift版本 3.0 或更高
target 'TargetName' do
use_frameworks!
pod "STV-Extensions"
end
import STV_Extensions
类名 | 属性/方法名 | 描述 |
---|---|---|
数据 | toDeviceToken | 将 Data 类型转换为 DeviceToken 格式 |
Date | startOfMonth | 获取月初的日期 |
Date | endOfMonth | 获取月末的日期 |
Date | preMonth | 获取上一个月的日期 |
Date | nextMonth | 获取下一个月的日期 |
Date | toStr | 将 Date 类型转换为 String 类型 |
Date | shortWeekdayStr | 从日期获取星期(例如,月) |
Date | weekdayStr | 从日期获取星期(例如,星期一) |
Date | now | 获取当前日期和时间(yyyy/MM/dd HH:mm:ss),以日本时间为准 |
Dictionary | toJson | 将 Dictionary 类型转换为 JSON |
Int | decimalStr | 将 Int 转换为每3位有逗号的 String |
Bundle | appShortVersion | 获取应用程序版本 |
Bundle | buildNo | 获取应用程序的构建号 |
Bundle | loadJson | 获取本地的 JSON 文件 |
NSObject | className | 获取类名 |
String | toDate | 将 String 类型转换为 Date 类型 |
String | toUrl | 将 String 类型转换为 URL 类型 |
String | base64Decode | 将 String 转换为 UIImage(Base64) |
String | isNumericValid | 是否为数字格式? |
String | isUrlValid | 是否为 URL 格式? |
String | isEmailValid | 是否为电子邮件格式? |
String | isTelephoneValid | 是否为电话号码格式? |
String | isdateValid | 是否为日期格式? |
String | isTimeValid | 是否为时间格式? |
String | localized | 获取 LocalizedString 中设置的值 |
URL | keyVals | 将 URL 的参数转换为 Dictionary 类型 |
类名 | 属性/方法名 | 描述 |
---|---|---|
UICollectionView | isScrollEnd | 是否滚动到了最底部的单元格? |
UIColor | init(hex,alpha) | 使用 16 进制值创建 UIColor |
UIImage | base64Encode | 使用 Base64 将 UIImage 转换为 UIImage |
UIImage | changeColor | 更改图片颜色 |
UIImageView | download | 从服务器下载图片 |
UINavigationBar | transparent | 让NavigationBar透明且去掉下划线 |
UINavigationController | 高度 | 获取NavigationBar的高度 |
UINavigationController | 宽度 | 获取NavigationBar的宽度 |
UINavigationItem | hideBackButtonTitle | 隐藏返回按钮的文字 |
UIScreen | screenwidth | 获取屏幕的宽度 |
UIScreen | screenHeight | 获取屏幕的高度 |
UIStoryboard | viewController | 从Storyboard中获取实例 |
UITabBar | transparent | 让UITabBar透明且去掉下划线 |
UITableView | removeTableFooterView | 删除TableFooterView |
UITableView | removeTableHeaderView | 删除TableHeaderView |
UITableView | scrollToBottom | 将TableView滚动到底部 |
UITableView | scrollToTop | 将TableView滚动到顶部 |
UITableView | isScrollEnd | 是否滚动到了最底部的单元格? |
UITextField | isEmpty | 检查TextField的值是否为空 |
UITextField | trimmedText | 对TextField的值进行裁剪 |
UITextField | clear | 清空TextField的值 |
UITextField | setPlaceHolderTextColor | 更改TextField的占位符颜色 |
UITextView | clear | 清空UITextView的值 |
UITextView | scrollToBottom | 将UITextView滚动到底部 |
UITextView | scrollToTop | 将UITextView滚动到顶部 |
UIView | borderColor | 更改View的边框颜色 |
UIView | borderWidth | 更改View的边框宽度 |
UIView | cornerRadius | 将View的角变圆 |
UIViewController | addNotificationObserver | 注册Notification |
UIViewController | removeNotificationObserver | 解除特定的Notification |
UIViewController | removeNotificationsObserver | 解除Notification |
stv-ekushida, [email protected]
STV-Extensions可以在MIT许可证下使用。有关更多信息,请参阅LICENSE文件。