这是一个app开发的加速库,个人几款app都是基于这个加速库完成的git
尽可能保持开发的原汁原味,欢迎使用,喜欢star✨缓存
我想目前Swift中没有比这个更合适的加速开发app的框架了,若是有请告诉我。 地址:https://github.com/Tliens/SpeedySwift安全
DLLocalNotification
取消时会崩溃,已修复放在O5_Vendor
中)swift
中的random
变得更加好用)color(day:UIColor,night:UIColor)->UIColor
下载最新代码后,将AppSpeedy
拖入到工程中,暂不支持podmarkdown
要求:Swift5.0
及以上网络
UIColor.hex("#22023b")
复制代码
let height = App.safeBottomHeight
复制代码
"Hello World!"[safe: 3] -> "l"
复制代码
let layout = AppCollectionViewLayout(longitude: 0, latitude: 10.scale, itemSize: CGSize(width: 130.scale, height: 139.scale), sectionInset: .init(top: 10.scale, left: 20.scale, bottom: 0, right: 20.scale), direction: .vertical)
复制代码
/// codable👍
@Default<String.defalut> var name:String
/// 数据持久化👍
@UserDefault("had_shown_guide_view", defaultValue: false)
static var hadShownGuideView: Bool
复制代码
/// 跳转到系统页面
/// - Parameter type: 类型
/// - Parameter completionHandler: block回调,bool表示是否成功
static func systemJump(completionHandler completion: ((AppJumpStatus) -> Void)? = nil){
let urlString = UIApplication.openSettingsURLString
if let url: URL = URL(string: urlString) {
App.jump(url: url, completionHandler: completion)
}else{
completion?(.fail)
}
}
复制代码
/// 获取indexpath
func indexPath(by child:UIView)->IndexPath?{
let point = child.convert(CGPoint.zero, to: self)
return self.indexPathForRow(at: point)
}
/// 获取cell
func cell(by child:UIView)->UITableViewCell?{
let point = child.convert(CGPoint.zero, to: self)
if let indexPath = self.indexPathForRow(at: point){
return self.cellForRow(at: indexPath)
}
return nil
}
复制代码
/// app版本号
static var version: String? {
return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
}
/// 设备名称
static var deviceName: String {
return UIDevice.current.localizedModel
}
/// 设备方向
static var deviceOrientation: UIDeviceOrientation {
return UIDevice.current.orientation
}
/// 主窗口
static var keyWindow: UIView? {
return UIApplication.shared.keyWindow
}
/// 当前系统版本
static var systemVersion: String {
return UIDevice.current.systemVersion
}
/// 判断设备是否是iPhoneX
static var isX : Bool {
var isX = false
if #available(iOS 11.0, *) {
let bottom : CGFloat = UIApplication.shared.delegate?.window??.safeAreaInsets.bottom ?? 0
isX = bottom > 0.0
}
return isX
}
复制代码
等你发现更多······app
地址:github.com/Tliens/Spee… 欢迎使用,喜欢请star✨框架
我根据使用频率以及层次结构分为了:dom
O1_Base
O2_Core
O3_Foundation
O4_UI
O5_Vendor
O6_Resource
O1_Base
文件夹下包含 app跳转、沙盒使用、AppCollectionViewLayout
、Viewcontrolle
、NavigationController
、TabbarController
基础封装
O2_Core
属性包裹器、Debug
、Random
O3_Foundation
Foundation
框架的经常使用扩展
O4_UI UIKit
框架的经常使用扩展
O5_Vendor
强大的CPCollectionViewKit、震动反馈、Snapkit、Toast
O6_Resource
资源文件
地址:github.com/Tliens/Spee… 欢迎使用,喜欢请star✨