Swiftpack.co - Package - FabrizioBrancati/BFKit-Swift

BFKit-Swift Banner

Build Status Codecov codebeat badge Swift Package Manager Compatible Carthage Compatible Version License
Language Platforms


Objective-C VersionFeaturesClasses and Extensions CompatibilityRequirementsCommunicationContributingInstalling and UsageDocumentationChangelogExampleTodoAuthorLicense


Objective-C Version

If you are looking for Objective-C version check it out here: BFKit.

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 | ✓ | ✓ | ✓ | ✓ |

UIKit / AppKit

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

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+ * | 2.0+ * | ✓ | | 4.1 | 9.3 | 3.1.2 | 8.0+ * | 10.10+ * | 2.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:4.0
    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: "3.1.2"))
        ],
        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

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
  • [x] Add macOS support
  • [x] Add watchOS support
  • [x] Create Unit Tests and add Codecov badge
  • [x] Add Linux support (Foundation extensions only)
  • [x] Add Carthage support
  • [x] Add to CocoaPods
  • [x] Create a great documentation

Author

Fabrizio Brancati

Website: https://www.fabriziobrancati.com
Email: fabrizio.brancati@gmail.com

License

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

Github

link
Stars: 723
Help us keep the lights on

Dependencies

Releases

3.1.2 - Apr 1, 2018

BFKit-Swift 3.1.2

2 Apr 2018

Added

  • Added support to Xcode 9.3 and Swift 4.1

3.1.1 - Feb 18, 2018

BFKit-Swift 3.1.1

18 Feb 2017

Added

  • Added swift_version property in podspec file for CocoaPods 1.4.0
  • Added Hound CI

Improved

  • Now cornerRadius(corners:, radius:) function in UIView extension uses maskedCorners for iOS 11 only
  • fadeDuration in BFButton class is now a TimeInterval
  • Updated device names based on The iPhone Wiki
  • Updated SwiftLint to 0.25.0

Fixed

  • Now Swift Package Manager correctly builds BFKit-Swift with Swift 4

3.1.0 - Dec 26, 2017

BFKit-Swift 3.1.0

26 Dec 2017

Added

  • Added BFBiometrics struct to help handling Face ID and / or Touch ID
  • Added two new custom operators on Number extension: <> and <=> to check if a number is included in a tuple of values
  • Added isUUID(), isUUIDForAPNS() and replacingMatches(regex:, with:) to Linux in String extension

Improved

  • Improved compilation time in blur() function in UIImage extension
  • Improved debug and release code execution on BFApp struct
  • Changed generateUniqueIdentifier() to generateUniqueIdentifier(save: Bool = default) in UIDevice extension to be able to keep the generated identifier across multiple sessions, defaults to false so no changes are required
  • Updated SwiftLint to 0.24.0
  • Updated README.md to latest Carthage changes

Thanks to @tomasz-czyzak for this release

3.0.0 - Sep 23, 2017

BFKit-Swift 3.0.0

23 Sep 2017

Added

  • Added support to Swift 4 and Xcode 9
  • Added support to App Extensions
  • Added setTabBarVisible(_:, animated:, duration:) and isTabBarVisible in UIViewController extension

Improved

  • Updated SwiftLint to 0.22.0
  • Now gradient(colors:, direction:) returns a CAGradientLayer as a @discardableResult, so no changes are required

Fixed

  • Fixed a bug on substring(to:) function on String extension #32
  • Fixed non designable UIViews

Changed

  • Changed UIViewLinearGradientDirection to UIViewGradientDirection enum name and properties in UIView extension. Easy transition, rename only
  • Changed smoothLinearGradient(colors:, direction:) to smoothGradient(colors:, direction:, type: = default) to allow radial gradients in UIView extension. Easy transition, thanks to default value
  • Removed appDelegate global variable
  • Changed reversed(preserveFormat: = default) to eversed(preserveFormat:) in String extension because is used instead of reversed() original String function

Thanks to @wdcurry for this release

2.6.0 - Jul 26, 2017

BFKit-Swift 2.6.0

26 Jul 2017

Added

  • Added macOS Support
  • Added dateSeparator and timeSeparator to init?(date:, time:) with a default value, so no changes are required
  • Added flatten<T>(_ array:) generic global function in Array extension

Improved

  • Removed Apple Watch device from UIDevice extension (Can't be used)
  • Removed support for iOS 7 in UIImage extension (Refuse)
  • Improved BFPassword struct
  • Improved tests

Fixed

  • Fixed missing style in init(frame:, style:, cellSeparatorStyle:, separatorInset:, dataSource:, delegate:) in UITableView extension
  • Fixed animate(path:, count: = default, duration:, autoreverses: = default) autoreverses
  • Fixed BFButton with a default fadeDuration value
  • Fixed wrong default duration in fade(label:, duration:, toAttributedString:) in WKInterfaceController extension