BFKit is a collection of useful classes and categories to develop Apps faster.

Overview

BFKit Banner

Build Status Carthage compatible Version Language Platform License


Swift VersionWhat does it doLanguage supportRequirementsCommunicationContributingInstalling and UsageDocumentationChangelogDemoTodoAuthorLicense


Swift Version

If you are looking for Swift version check it out here: BFKit Swift

What does it do

BFKit is a collection of useful classes to develop Apps faster. For example you can use every iOS font with just an enum! It also adds some useful method to some classes like:

BFKit:

Foundation:

UIKit:

Language support

  • Brazilian Portuguese (pt-Br)
  • English (en)
  • Indonesian (id)
  • Italian (it)
  • Russian (ru)
  • Simplified Chinese (zh-Hans)
  • Swedish (sv)
  • Traditional Chinese (zh-Hant)
  • Traditional Turkish (tr-TR)
  • Ukrainian (uk)
  • Vietnamese (vi)

Requirements

  • iOS SDK 7.0 if you copy the Framework files (Source folder)
  • iOS SDK 8.0 if you use it as a Framework
  • Xcode 7.0 or later
  • ARC

Communication

  • If you need help, use Stack Overflow.
  • 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 :octocat:

See CONTRIBUTING.md file.

Installing and Usage

iOS 7 or later compatible

Manual

  • Copy the Source folder to the project
  • Add the following frameworks to the project:
    • UIKit
    • Foundation
    • CoreImage
    • CoreGraphics
    • QuartzCore
    • Accelerate
    • AudioToolbox (if you want to use BFSystemSound class)
    • LocalAuthentication (if you want to use BFTouchID class, and set it as weak if your App runs on iOS 7)
  • Import BFKit with #import "BFKit.h"
  • Enjoy!

CocoaPods

Pro version
  • pod 'BFKit'
  • Import the Framework with import BFKit
  • Enjoy!
Newbie version
  • Create a Podfile in your project directory

  • Write:

    platform :ios, '7.0'
    xcodeproj 'Project.xcodeproj'
    
    pod 'BFKit'
  • Change "Project" with your real project name

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

  • Import the Framework with #import <BFKit/BFKit.h>

  • Enjoy!

iOS 8 or later compatible

Manual

  • Open the BFKit folder and build the Framework from the project
  • Import BFKit.framework into your project
  • Add the following frameworks to the project:
    • UIKit
    • Foundation
    • CoreImage
    • CoreGraphics
    • QuartzCore
    • Accelerate
    • AudioToolbox (if you want to use BFSystemSound class)
    • LocalAuthentication (if you want to use BFTouchID class, and set it as weak if your App runs on iOS 7)
  • Import the Framework with import BFKit
  • Enjoy!

Carthage

Pro version
  • github "FabrizioBrancati/BFKit"
  • Import the Framework with import BFKit
  • Enjoy!
Newbie version
  • Create a Cartfile in your project directory

  • Write:

    github "FabrizioBrancati/BFKit"
  • 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 Queuer 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!

Documentation

CocoaDocs - 100% Documented

Changelog

To see what has changed in recent version of BFKit, see the CHANGELOG

Demo

Open and run the BFKitDemo project in Xcode and see BFKit in action!

Todo

  • Create great tests and add Coveralls badge
  • Add support to macOS, watchOS and tvOS
  • Create a new Example App that shows all the functionalities of BFKit
  • ✔️ Add Carthage support
  • ✔️ Add to CocoaPods
  • ✔️ Create a great documentation

Author

Fabrizio Brancati

Website
Email

License

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

Comments
  • Cannot convert value of type '[NSAttributedStringKey : Any]' (aka 'Dictionary<NSString, Any>') to expected argument type '[String : Any]?'

    Cannot convert value of type '[NSAttributedStringKey : Any]' (aka 'Dictionary') to expected argument type '[String : Any]?'

    I recently updates to Xcode 9.4 and I have got this error all over the NSAttributedString+Extentions.swift file. I am on the 3.2.0 version of BFKIT. What should I do to get over this?

    Thanks in advance screen shot 2018-07-17 at 7 10 13 pm

    Question 
    opened by adiahuja07 14
  • Support Language Issues

    Support Language Issues

    When I used BFKit, my app support language on appstory changed to 10 types. I think it's the BFKit language file. Do you have any good Suggestions to solve this problem? I'm not sure it's a BFKit problem. Thank you very much! image

    opened by Connerli 5
  • NSString+BFKit  maybe crash

    NSString+BFKit maybe crash

    • (NSString *)searchInString:(NSString *)string charStart:(char)start charEnd:(char)end

    This method,if I enter two identical characters,it will crash;

    For example: NSString *search = @"Search in #this# string!"; BFLog(@"Search: %@", [search searchCharStart:'#' charEnd:'#']) it will crash. I did a little bit of repair.

    • (NSString *)searchInString:(NSString *)string charStart:(char)start charEnd:(char)end { int inizio = 0, stop = 0;

      for(int i = 0; i < [string length]; i++) { if([string characterAtIndex:i] == start && inizio == 0) { inizio = i+1; i += 1; continue; } if([string characterAtIndex:i] == end) { stop = i; break; } }

      stop -= inizio;

      return [[string substringFromIndex:inizio] substringToIndex:stop]; }

    Bug 
    opened by BoBoMoon 5
  • bug in NSFileManager+BFKit.m

    bug in NSFileManager+BFKit.m

    " [self moveLocalFile:[NSString stringWithFormat:@"%@-Settings.plist", settings] fromDirectory:DirectoryTypeMainBundle toDirectory:DirectoryTypeLibrary withFolderName:@""] " in (id)getSettings:(NSString *)settings objectForKey:(NSString *)objKey and (BOOL)setSettings:NSString *)settings object:(id)value forKey:(NSString *)objKey;

    if "withFolderName:@""" the %@-Settings.plist will be a folder with the name "/Library/App-Settings.plist/",isn't a file

    ([[NSFileManager defaultManager] copyItemAtPath:originPath toPath:destinationPath error:nil]) will fail because there has had a file " %@-Settings.plist ",but it's a folder,can not be read as a pist

    the same bug in swift version

    Bug 
    opened by jiongge 4
  • imageAtRect:(CGRect)rect not working properly for iPhone 6S Plus

    imageAtRect:(CGRect)rect not working properly for iPhone 6S Plus

    File : BFKit/Source/Additions/UIKit/UIImage+BFKit.m Method : - (UIImage * _Nonnull)imageAtRect:(CGRect)rect

    Not working with the image scale > 2 but working image scale <=2

    Bug 
    opened by mihir815 3
  • UIWebView deprecated issue in ObjectiveC Pod file

    UIWebView deprecated issue in ObjectiveC Pod file

    Actually, i'm using this pod file for my ObjectiveC projects. and, it's contains UIWebView classes. As per the apple guidelines this is deprecated & you guys are fixed this issue on Swift pod file.

    pod 'BFKit' Could you please update this for ObjectiveC Pod file?

    opened by Jagathesh-IOS 2
  • Error

    Error "Type of expression is ambiguous" between Timer and NSObject extension

    Hello,

    I'm getting a compiler error "Type of expression is ambiguous without more context". Basically, it's the conflict between NSObject.isValid() and Timer.isValid.

    I've noticed that 'isValid' is quite commonly used in some other third party libraries, e.g: Firebase. I wonder if it should be renamed to something else to avoid this conflict.

    Cheers.

    opened by tony-hoang999 2
  • Translated to Brazilian Portuguese.

    Translated to Brazilian Portuguese.

    I'm not sure if the folder should be pt-Br or just pt, but after I saw the zh-Hans.lproj and zh-Hant.lproj I decided to use pt-Br.lproj.

    (Note: keep in mind that we also have the Portuguese language from Portugal).

    opened by emersonbroga 2
  • Use of @import when modules are disabled

    Use of @import when modules are disabled

    Hey dude,

    when i add BFKit folder to my project and #import "BFKit.h" the errors pop: Use of "@import" when modules are disabled

    and i checked my build settings, it's all good, and i added all the required frameworks, so it's very weird image

    Question 
    opened by tobatha 2
Releases(v3.0.0)
  • v3.0.0(Mar 19, 2020)

  • v2.0.0(Oct 15, 2019)

    2.0.0

    Changed

    • Renamed isValid to isObjectValid to avoid conflicts with other libraries #39
    • Renamed DegreesToRadians to BFDegreesToRadians to avoid conflicts with other libraries #37
    • Renamed RadiansToDegrees to BFRadiansToDegrees to avoid conflicts with other libraries #37

    Added

    • Added support to Objective-C++ projects #37

    Thanks to @ramonvic and tony-hoang999 for this release

    Source code(tar.gz)
    Source code(zip)
  • v1.11.1(Oct 15, 2019)

  • v1.11.0(Dec 26, 2017)

  • v1.10.0(Jun 12, 2017)

  • v1.9.3(Dec 11, 2016)

  • v1.9.2(Jul 13, 2016)

  • v1.9.1(May 8, 2016)

  • v1.9.0(Feb 1, 2016)

    1.9.0

    Added

    • Added CONTRIBUTING.md file
    • Added BFCryptor class to encrypt/decrypt NSString and NSData
    • Added NSData category with convertToUTF8String & convertToASCIIString methods to convert NSData to NSString and convertUUIDToString method to convert an NSData UUID to an APNS valid UUID
    • Added convertToNSData method in NSString category to convert NSData to NSString
    • Added isUUID & isUUIDForAPNS methods in NSString category to check if it is a valid UUID
    • Added updateUniqueIdentifier:block: to UIDevice category to check if the UUID has to be updated (Useful for APNS)
    • Added brightness methods directly to UIScreen category
    • Added Brazilian Portuguese #20 & #22
    • Added BFTextField subclass of UITextField to limit the max characters
    • Added automatic height for width for an UILabel #21
    • Added setFont:fromIndex:toIndex: to sets a custom font from a range of characters #21
    • Added removeAllSubviews from UIView category to remove all the subviews #21
    • Added screen size macros in UIScreen category to check the device's screen size

    Improved

    • Changed how to access lightFont, regularFont and boldFont in UIFont category
    • All the encrypt/decrypt methods has been moved to the new BFCryptor class. The old ones will call the new ones from that class
    • Fixed warnings for deprecated fonts #23
    • Minor enhancements & bug fix

    Thanks to @AshrafAbuBakr, @davidjelliott, @emersonbroga & @liushixiang for this release

    Source code(tar.gz)
    Source code(zip)
  • v1.8.0(Nov 9, 2015)

    1.8.0

    Added

    • Added support to Nullability
    • Added support to Carthage
    • Added flipImageHorizontally & flipImageVertically methods in UIImage category
    • Added missing devices
    • Added more stronger check on BFDataStructures

    Improved

    • Now BFKit can be build as a Framework
    • Moved generateUUID: from UIDevice category to NSString category
    • Minor enhancements
    Source code(tar.gz)
    Source code(zip)
  • v1.7.1(Sep 27, 2015)

    1.7.1

    Added

    • Added new devices (iPhone, iPad and AppleTV)
    • Added new methods for HEX representation

    Fixed

    • Fixed a bug with getSettings:objectForKey: & setSettings:object:forKey in NSFileManager category #15

    Thanks to @jiongge and @fabiosoft for this release

    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(Jul 21, 2015)

    1.7.0

    Added

    • Added UINavigationBar category
    • Added UIToolbar & UIBarButtonItem categories
    • Added BFDataStructures class with primitive data structures
    • Added new substring and indexOf methods in NSString category
    • Added fallbackTitle parameter in showTouchIDAuthenticationWithReason method in BFTouchID class
    • Added touch on screen with BFShowTouchOnScreen and BFHideTouchOnScreen macros
    • Added support for iPod Touch 6G

    Improved

    • Now to create dummy images you have to explicitly call dummyImageNamed: method in UIImage
    • Changed all id to instancetype in instance creation
    • Removed UIScreen methods from UIDevice category and created UIScreen category

    Fixed

    • Changed SCREEN_WIDTH & SCREEN_HEIGHT macros and fixed #13

    Thanks to @jiongge for this release

    Source code(tar.gz)
    Source code(zip)
  • v1.6.8(Jul 9, 2015)

    1.6.8

    Added

    • Added onFirstStart and onFirstStartForCurrentVersion in BFApp class
    • Added stringByReplacingWithRegex:withString: in NSString category

    Improved

    • BFLog now prints: timestamp filename:line function message
    • NSDate category now has nanosecond and use autoupdatingCurrentCalendar

    Fixed

    • Bug fix in DEMO App
    Source code(tar.gz)
    Source code(zip)
  • v1.6.7(Jul 7, 2015)

  • v1.6.6(Jul 5, 2015)

    1.6.6

    Added

    • Added colorForColorString in UIColor category
    • Added getIndexPathsForSection in UITableView category
    • Added takeScreenshotAndSave: and takeScreenshotWithDelay:save:completion: in UIWindow category to save screenshots and make it after a delay

    Improved

    • Minor changes on Documentation

    Fixed

    • Fixed a bug with Retina and Retina HD displays while resizing images
    Source code(tar.gz)
    Source code(zip)
  • v1.6.5(Jul 2, 2015)

  • v1.6.4(Jun 26, 2015)

    1.6.4

    Added

    • Added hex and hexString in UIColor category to easily create HEX colors from strings
    • Added dummy images and any blend mode in UIImage category
    • Added setMaskImage method in UIImageView category and deprecated the oldest ones in UIImage category

    Improved

    • macAddress method in UIDevice category is now deprecated (from iOS 7 you cannot request for mac address)
    • Minor enhancements

    Fixed

    • Fixed quality loss on most UIImage category manipulation methods
    Source code(tar.gz)
    Source code(zip)
  • v1.6.3(Jun 23, 2015)

  • v1.6.2(Jun 23, 2015)

  • v1.6.1(Jun 23, 2015)

  • v1.6.0(Jun 23, 2015)

    1.6.0

    Added

    • Added in NSString category the method hasString:caseSensitive:
    • Added system macros in UIDevice category
    • Added iOS 9 fonts and marked as deprecated that is not available on iOS 9

    Improved

    • Performance improved
    Source code(tar.gz)
    Source code(zip)
  • v1.5.3(May 18, 2015)

  • v1.5.2(May 16, 2015)

    1.5.2

    Added

    • Added in UIView category the method createGradientWithColors:direction:
    • Added a comment on every enum, method or variable

    Fixed

    • Fixed a warning on runOnMainThread method in NSThread category
    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(May 15, 2015)

  • v1.5.0(May 15, 2015)

    1.5.0

    Added

    • Added BFButton class
    • Added in UIImageView category the method initWithImage:center:
    • Added in UIImage category the method imageWithSize:backgroundColor:maskedText:font:
    • Added in UIView category the method translateAroundTheView:duration:direction:repeat:startFromEdge:
    • Added in NSNumber category the methods nextPowerOfTwo and isPowerOfTwo
    • Added Vietnamese

    Improved

    • Enhancements in NSDate category

    Fixed

    • Minor bugfixes

    Thanks to @simonlinj & @masd-duc for this release

    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Feb 25, 2015)

    1.4.0

    Added

    • Added UITextView category
    • Added NSObject category
    • Added BFLogDetailedString to get more detailed log string in BFLog class
    • Added dateInformationDescriptionWithInformation:dateSeparator:usFormat method, to get timestamp in NSDate category
    • Added fileSize:fromDirectory: method, to get size of a file in NSFileManager category
    • Added some @property method, to get the RGB single component in UIColor category
    • Added canProvideRGBComponents, contrastingColor & complementaryColor methods in UIColor category
    • Added imageFromText:font:fontSize:imageSize: method, to create an UIImage from a given text in UIImage category

    Fixed

    • Fixed UIImage category to support al types of display (Retina & Retina HD)
    • Fixed UIImage category to remove all warnings
    Source code(tar.gz)
    Source code(zip)
  • v1.3.2(Feb 21, 2015)

  • v1.3.1(Jan 13, 2015)

  • v1.3.0(Jan 10, 2015)

    1.3.0

    Added

    • Added APP_DELEGATE macro to retrive AppDelegate
    • Added Base64 encode/decode
    • Added NSThread class with function runOnMainThread
    • Added RGB & RGBA macros to create UIColor objects
    • Added missing fonts (iOS 8)
    • Added missing Audio IDs
    • Added some localized strings

    Improved

    • Complete rewrite of BFLog class with more details in log and string of all logs
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Jan 2, 2015)

    1.2.0

    Added

    • Added NSMutableDictionary category
    • Added in NSArray the method objectAtCircleIndex:
    • Added in BFSystemSound the ability to create and dispose custom sound
    • Added BFApp and BFLog classes

    Improved

    • In NSArray the method arrayToJson: now returns the localized string error
    • NSArray & NSMutableArray enhancements

    Thanks to @antwork for this release

    Source code(tar.gz)
    Source code(zip)
Owner
Fabrizio Brancati
A lifelong learner, automation enthusiast, DevOps lover, and Mobile Architect with an eye on design, since iPhone OS 3 | @raywenderlich writer
Fabrizio Brancati
A handy collection of Swift method and Tools to build project faster and more efficient.

SwifterKnife is a collection of Swift extension method and some tools that often use in develop project, with them you might build project faster and

李阳 4 Dec 29, 2022
Tools and helpers to make building apps faster and safer.

The UBFoundation framework provides a set of useful tools and helpers to make building apps faster and safer.

Ubique 7 Dec 19, 2022
A NEWS app which can be used to read,share and bookmark articles of various categories

Scoop A NEWS App for iOS 14 built using Swift which allow the users to read,bookmark and share news articles. Built using MVC architecture Requirement

Sai Balaji 3 Oct 12, 2022
A collection of useful result builders for Swift and Foundation value types

Swift Builders A collection of useful result builders for Swift and Foundation value types. Motivation Arrays, dictionaries, and other collection-base

David Roman 3 Oct 14, 2022
A Collection of useful Swift property wrappers to make coding easier

Swift Property Wrappers A Collection of useful Swift property wrappers to make c

Gordan Glavaš 2 Jan 28, 2022
🏈 Cache CocoaPods for faster rebuild and indexing Xcode project.

?? Cache CocoaPods for faster rebuild and indexing Xcode project.

Vyacheslav Khorkov 489 Jan 6, 2023
Swift library to develop custom Alexa Skills

AlexaSkillsKit AlexaSkillsKit is a Swift library that allows you to develop custom skills for Amazon Alexa, the voice service that powers Echo. It tak

Claus Höfele 170 Dec 27, 2022
LifetimeTracker can surface retain cycle / memory issues right as you develop your application

LifetimeTracker Bar style Circular style LifetimeTracker can surface retain cycle / memory issues right as you develop your application, and it will s

Krzysztof Zabłocki 2.8k Jan 4, 2023
How Swift standard types and classes were supposed to work.

How Swift standard types and classes were supposed to work. A collection of useful extensions for the Swift Standard Library, Foundation, and UIKit.

Goktug Yilmaz 3k Dec 22, 2022
A set of helper classes and functions in Swift

SwiftTools This is a set of tools written in Swift that add some sugar and some small functionality. Mainly meant for small projects and scripts, as a

Vinicius Vendramini 0 Dec 13, 2021
Extensions for Swift Standard Types and Classes

Cent Cent is a library that extends certain Swift object types using the extension feature and gives its two cents to Swift language. Dollar is a Swif

Ankur Patel 225 Dec 7, 2022
Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects

SwiftyPick ?? ?? Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects. Purpose The idea behind t

Manu Herrera 19 May 12, 2022
Useful functions and extensions for sorting in Swift

SwiftSortUtils Motivation This library takes a shot at making comparing and sorting in Swift more pleasant. It also allows you to reuse your old NSSor

Daniel Strittmatter 60 Sep 9, 2022
Extendy - A set of useful string extensions.

Extendy A set of useful string extensions. Requirements iOS 11.0+ Swift 5+ Installation CocoaPods Extendy is available through CocoaPods. To install i

Anton Novichenko 3 Sep 23, 2021
Useful extensions for my Swift code

UIViewController extensions presentAlert(withTitle title: String, message : String) presentAlertDialog(withTitle title: String, message : String, acti

Bogdan Grafonsky 1 Oct 17, 2021
Personally useful Swift Extensions for iOS Development

Useful-Swift-Extensions Personally useful Swift Extensions for iOS Development; cobbled together from a variety of development projects and StackOverf

Nick Arner 5 Dec 13, 2021
💻 A fast and flexible O(n) difference algorithm framework for Swift collection.

A fast and flexible O(n) difference algorithm framework for Swift collection. The algorithm is optimized based on the Paul Heckel's algorithm. Made wi

Ryo Aoyama 3.3k Jan 4, 2023
A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.

ZamzamKit ZamzamKit is a Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and othe

Zamzam Inc. 261 Dec 15, 2022
SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

Gymshark 1 Jul 6, 2021