Giter Site home page Giter Site logo

fabriziobrancati / bfkit-swift Goto Github PK

View Code? Open in Web Editor NEW
997.0 26.0 106.0 24.87 MB

BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.

Home Page: https://www.fabriziobrancati.com

License: MIT License

Swift 99.28% Ruby 0.25% Objective-C 0.22% Shell 0.24%
carthage swift swift-extensions xcode swift-package-manager ios linux cocoapods foundation uikit

bfkit-swift's Introduction

BFKit-Swift Banner

Build Status Coverage Status Maintainability Codebeat Badge Codacy Badge
Documentation Swift Package Manager Compatible Carthage Compatible
Version Language Platforms License


FeaturesClasses and Extensions CompatibilityRequirementsCommunicationContributingInstalling and UsageDocumentationChangelogExampleTodoAuthorLicense


Features

BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.
For example you can use every iOS font with just an enum!
It also adds some useful functions with Custom classes and extends Foundation, UIKit, AppKit and WatchKit classes.

Classes and Extensions Compatibility

BFKit

iOS macOS watchOS Linux
BFApp ✓ ✓ ✓ ✓
BFBiometric ✓
BFButton ✓
BFDataStructures
(List - Queue - Stack)
✓ ✓ ✓ ✓
BFLog ✓ ✓ ✓ ✓
BFPassword ✓ ✓ ✓ ✓
BFSystemSound ✓
BFTextField ✓
BFTouchID ✓  

Foundation

iOS macOS watchOS Linux
Array ✓ ✓ ✓ ✓
Collection ✓ ✓ ✓ ✓
Data ✓ ✓ ✓ ✓
Date ✓ ✓ ✓ ✓
FileManager ✓ ✓ ✓ ✓
Number ✓ ✓ ✓ ✓
NSObject ✓ ✓ ✓ ✓
NSAttributedString ✓ ✓ ✓
NSPointerArray ✓ ✓ ✓
ProcessInfo ✓ ✓ ✓ ✓
Set ✓ ✓ ✓ ✓
String ✓ ✓ ✓ ✓
Thread ✓ ✓ ✓ ✓

Core Graphics

iOS macOS watchOS Linux
CGPoint ✓ ✓ ✓  

UIKit / AppKit

iOS macOS watchOS Linux
UIBarButtonItem ✓
UIButton ✓
UIColor ✓ ✓ ✓
UIDevice ✓
UIFont ✓ ✓
UIImage ✓ ✓
UIImageView ✓
UILabel ✓
UINavigationBar ✓
UIPasteboard ✓
UIScreen ✓
UIScrollView ✓
UITableView ✓
UITextField ✓
UITextView ✓
UIToolbar ✓
UIView ✓
UIViewController ✓
UIWindow ✓  

WebKit

iOS macOS watchOS Linux
UIWebView ✓ ✓  

WatchKit

iOS macOS watchOS Linux
WKInterfaceController ✓  

Requirements

Swift Xcode BFKit-Swift iOS macOS watchOS Linux
1.2 6.3 1.0.0...1.4.1 7.0+
2.0...2.1 7.0 1.5.0...1.6.2 7.0+
2.2 7.3 1.6.3...1.7.0 7.0+
2.3 8.0 1.8.0 7.0+
3.0...3.1 8.0...8.3 2.0.0...2.3.0 8.0+ ✓
3.0...3.1 8.0...8.3 2.4.0...2.5.0 8.0+ 2.0+ ✓
3.0...3.2 8.0...9.0 2.6.0 8.0+ 10.10+ 2.0+ ✓
4.0 9.0...9.2 3.0.0...3.1.1 8.0+ * 10.10+ * 3.0+ * ✓
4.1 9.3...9.4 3.1.2...3.2.1 8.0+ * 10.10+ * 3.0+ * ✓
4.2 10.0 4.0.0...4.1.0 8.0+ * 10.10+ * 3.0+ * ✓
5.0 10.2...10.3 5.0.0 8.0+ * 10.10+ * 3.0+ * ✓
5.1 11.2 6.0.0...6.0.1 8.0+ * 10.10+ * 3.0+ * ✓

* With App Extension Support

Communication

  • If you need help, open an issue
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, see Contributing section.

Contributing

See CONTRIBUTING.md file.

Installing and Usage

See Requirements section to check Swift, Xcode, BFKit-Swift and OS versions.

Manual

  • Open and build the framework from the project (BFKit.xcodeproj)
  • Import BFKit.framework into your project
  • Import the framework with import BFKit
  • Enjoy!

CocoaPods

  • Create a Podfile in your project directory and write into:

    platform :ios, '8.0'
    xcodeproj 'Project.xcodeproj'
    use_frameworks!
    
    pod 'BFKit-Swift'
  • Change "Project" with your real project name

  • Open Terminal, go to your project directory and type: pod install

  • Import the framework with import BFKit

  • Enjoy!

Carthage

  • Create a Cartfile in your project directory and write into:

    github "FabrizioBrancati/BFKit-Swift"
  • Open Terminal, go to project directory and type: carthage update

  • Include the created Framework in your project

  • Add Build Phase with the following contents:

    /usr/local/bin/carthage copy-frameworks

    Add the paths to the BFKit-Swift framework under Input Files

    $(SRCROOT)/Carthage/Build/iOS/BFKit.framework

    Add the paths to the copied frameworks to the Output Files

    $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/BFKit.framework

    This script works around an App Store submission bug triggered by universal binaries and ensures that necessary bitcode-related files are copied when archiving

  • (Optional) Add Build Phase with the following contents

    /usr/local/bin/carthage outdated --xcode-warnings

    To automatically warn you when one of your dependencies is out of date

  • Import the framework with import BFKit

  • Enjoy!

Swift Package Manager

  • Create a Package.swift file in your project directory and write into:

    // swift-tools-version:5.1
    import PackageDescription
    
    let package = Package(
        name: "Project",
        products: [
            .executable(name: "Project", targets: ["Project"])
        ],
        dependencies: [
            .package(url: "https://github.com/FabrizioBrancati/BFKit-Swift.git", .upToNextMajor(from: "4.0.0"))
        ],
        targets: [
            .target(name: "Project", dependencies: ["BFKit"])
        ]
    )
  • Change "Project" with your real project name

  • Open Terminal, go to project directory and type: swift build

  • Import the framework with import BFKit

  • Enjoy!

Documentation

Jazzy generated documentation - 100% Documented

Changelog

To see what has changed in recent versions of BFKit-Swift, see the CHANGELOG.md file.

Example

Open and run the BFKitExample project in Example folder in this repo with Xcode and see BFKit-Swift in action!

Todo

  • Add tvOS support
  • Create a new Example App that shows all the functionalities of BFKit-Swift
  • ~100% of code coverage with Unit Tests
  • Improve code to get an A from codebeat
  • Add macOS support
  • Add watchOS support
  • Create Unit Tests and add Codecov badge
  • Add Linux support (Foundation extensions only)
  • Add Carthage support
  • Add to CocoaPods
  • Create a great documentation

Author

Fabrizio Brancati

Website: https://www.fabriziobrancati.com
Email: [email protected]

License

BFKit-Swift is available under the MIT license. See the LICENSE file for more info.

bfkit-swift's People

Contributors

astrokin avatar calebkleveter avatar ewg777 avatar fabriziobrancati avatar gabrielpeart avatar gennick avatar ianrahman avatar lucasmpaim avatar pontus-andersson avatar rere61 avatar sabatinomasala avatar the0neyouseek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bfkit-swift's Issues

BFTouchID error after ios10.0

after iOS 10.0,when I call showTouchID function, it will callback systemCancel error first。

I set the breakpoint and see the error. when call context.evaluatePolicy , system will show the touchID alert, and then this function will callback systemCancel error first. After I auth the touchID, it callback success.

this error can not see in ios 9.0 。

some one know why

FileManagerExtension.swift mainBundlePath() return nil

// MARK: - Functions

/// Get the path for a PathType.
///
/// - Parameter path: Path type.
/// - Returns: Returns the path type String.
public func pathFor(_ path: PathType) -> String? {
    var pathString: String?
    
    switch path {
    case .mainBundle:
        pathString = self.mainBundlePath()
   ...
    }
    
    return pathString
}

self.mainBundlePath() always return nil

I recommend to switch

/// Get Main Bundle path for a filename.
///
/// - Parameter file: Filename
/// - Returns: Returns the path as a String.
public func mainBundlePath(file: String = "") -> String? {
return file.isEmpty ? Bundle.main.bundlePath : Bundle.main.path(forResource: file.deletingPathExtension, ofType: file.pathExtension)
}

about SCREEN_WIDTH in UIDevice+BFKit.swift

UIScreen.mainScreen().bounds.size is same regardless of the direction of mobile phone before iOS_7_1 ,but it's changed after iOS_7_1

for example:
////////////////////////
func getFixedScreenSize()->CGSize{
let screenSize=UIScreen.mainScreen().bounds.size
if((NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1)&&UIInterfaceOrientationIsLandscape(UIApplication.sharedApplication().statusBarOrientation)){
return CGSizeMake(screenSize.height, screenSize.width)
}
return screenSize
}

Compile failure with swiftUI

Type conflicts are found. Color in SwiftUI is an existing class, and BFKit contains the following code
public typealias Color = UIColor
This caused me to compile failure and had to remove the relevant code

UIView @IBDesignable/@IBInspectable can't show in storyboard

I see in BFKit has a UIView extension that used IBDesignable/IBInspectable, But it's can't show in the storyboard。And now I only can use A empty custom view to inherit UIView and in storyboard select the customView。I want now if there any other way to do that

Extension Array - method random() does never select last element

Hi,

I think the function "random()" in the array extension does only return a random element besides the last one.

The function randomInt(range: ClosedRange<Int>) -> Int which is used, never returns the upperBound of the range, but only the upperBound -1.

e.g.

var myArray = ["One","Two","Three"]
for i in 1...100 {
    print(myArray.random())
}

will never print "Three".

for i in 1...100 {
    print("\(randomInt(range: 0...1))")
}

will never print "1"

Should be easy to fix :-)

Oliver

Documentation issue warnings

Hi,

I keep getting allot of warnings about Documentation issues when building my project. They all are about parameters which are not found in the function declaration. Like this one:
/Pods/BFKit/Source/BFKit/BFCryptor.h:118:12: Parameter 'data' not found in the function declaration
/Pods/BFKit/Source/BFKit/BFCryptor.m:29:9: In file included from /Pods/BFKit/Source/BFKit/BFCryptor.m:29:

It's not really a bug but I like my projects warning free :)

Thx!

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.