Git Product home page Git Product logo

effoundation's Introduction

EFFoundation

CI Status Carthage SPM Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 10.2+
  • Swift 5.0+
  • iOS 9.3+

Installation

EFFoundation is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'EFFoundation'

Author

EyreFree, [email protected]

License

EFFoundation is available under the MIT license. See the LICENSE file for more info.

effoundation's People

Contributors

eyrefree avatar kittenyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

effoundation's Issues

iPhoneXSeries判断

#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

Group the properties and functions for Foundation Extensions

Issue Description

Description

When i add both EFQRCode and SwifterSwift in cocoapods, compile error comes out. It is showing lots of "ambiguous use of 'xxx'".

Reproduce

Add both EFQRCode and SwifterSwift to project using cocoapods, and call methods like 'nsString' and etc.

Other Comment

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()
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.