efprefix / effoundation Goto Github PK
View Code? Open in Web Editor NEWSwift Extensions.
Home Page: https://swiftpackageindex.com/EFPrefix/EFFoundation
License: MIT License
Swift Extensions.
Home Page: https://swiftpackageindex.com/EFPrefix/EFFoundation
License: MIT License
和系统提供的bool的toggle()冲突
#if os(iOS)
import UIKit
import DeviceKit
public extension UIDevice {
static let model: String = {
return Device.current.description
}()
static let isiPhoneXSeries: Bool = {
struct Anchor {
static var result: Bool?
}
if let result = Anchor.result {
return result
}
/// 注释掉了,Device更新了,这里需要手动更新
// let iPhoneXSeries: [Device] = [
// Device.iPhoneX,
// Device.iPhoneXR,
// Device.iPhoneXS,
// Device.iPhoneXSMax,
// Device.simulator(Device.iPhoneX),
// Device.simulator(Device.iPhoneXR),
// Device.simulator(Device.iPhoneXS),
// Device.simulator(Device.iPhoneXSMax)
// ]
// let result: Bool = nil != iPhoneXSeries.firstIndex(of: Device.current)
// Anchor.result = result
// return result
/// 修改
let iPhoneXSeries: [Device] = Device.allXSeriesDevices + Device.allSimulatorXSeriesDevices
let result = iPhoneXSeries.contains(Device.current)
Anchor.result = result
return result
}()
}
#endif
When i add both EFQRCode and SwifterSwift in cocoapods, compile error comes out. It is showing lots of "ambiguous use of 'xxx'".
Add both EFQRCode and SwifterSwift to project using cocoapods, and call methods like 'nsString' and etc.
I'd suggest to group properties and functions for Foundation Extensions like bellow:
// SwiftKit
public extension UIView {
public class SwiftKit {
public class func someClassMethod() {
print("someClassMethod from Swift Kit")
}
public var someProperty: Double {
print("someProperty from Swift Kit")
return 0
}
}
var SwiftKit:SwiftKit {
return SwiftKit()
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.