ObjectiveKit alternatives and similar libraries
Based on the "Utility" category.
Alternatively, view ObjectiveKit alternatives based on common mentions on social networks and blogs.
-
SwifterSwift
:A handy collection of more than 360 native Swift 3 extensions to boost your productivity. -
SwiftGen
A collection of Swift tools to generate Swift code (enums for your assets, storyboards, Localizable.strings, …) -
SwiftGen-Storyboard
A tool to auto-generate Swift enums for all your Storyboards, Scenes and Segues constants + appropriate convenience accessors. -
R.swift
Tool to get strong typed, autocompleted resources like images, cells and segues. -
ExSwift
a set of Swift extensions for standard types and classes. -
swift-protobuf
A plugin and runtime library for using Google's Protocol Buffer. -
EZSwiftExtensions
How Swift standard types and classes were supposed to work. -
DifferenceKit
💻 A fast and flexible O(n) difference algorithm framework for Swift collection. -
Result
Swift type modelling the success/failure of arbitrary operations. -
LifetimeTracker
LifetimeTracker can surface retain cycle / memory issues right as you develop your application, and it will surface them to you immediately, so you can find them with more ease. -
Device
Light weight tool for detecting the current device and screen size written in swift. -
WhatsNew
Showcase new features after an app update similar to Pages, Numbers and Keynote. -
SwiftLinkPreview
It makes a preview from an url, grabbing all information such as title, relevant texts and images. -
Codextended
Extensions giving Codable API type inference super powers. -
Popsicle
Delightful, extensible Swift value interpolation framework. -
PinpointKit
An open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots and logs using a simple gesture. -
SwiftyJSONAccelerator
OSX app to generate Swift 3 code for models from JSON. -
Highlighter
Highlight whatever you want! Highlighter will magically find UI objects such as UILabel, UITextView, UITexTfield, UIButton in your UITableViewCell or other Class. -
Compass
Compass helps you setup a central navigation system for your application. -
Playbook
📘A library for isolated developing UI components and automatically snapshots of them. -
ReadabilityKit
Preview extractor for news, articles and full-texts in Swift -
PDFGenerator
A simple Generator of PDF in Swift. Generate PDF from view(s) or image(s). -
Pythonic.swift
Pythonic tool-belt for Swift: a Swift implementation of selected parts of Python standard library. -
SwiftyUtils
All the reusable code that we need in each project. -
Prototope
Swift library of lightweight interfaces for prototyping, bridged to JS. -
Butterfly
A lightweight library for integrating bug-report and feedback features with shake-motion event.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of ObjectiveKit or a related project?
README
ObjectiveKit
ObjectiveKit provides a Swift friendly API for a set of powerful Objective C runtime functions.
Usage
To use ObjectiveKit:
Import ObjectiveKit at the top of your Swift file:
import ObjectiveKit
The next step is to create an ObjectiveClass object typed for the class you want to modify or introspect:
let viewClass = ObjectiveClass<UIView>()
If using ObjectiveKit on a custom Swift class, make sure that it inherits at some point from NSObject and that it is exposed to the Objective C runtime using the @objc flag.
Introspection
You can learn more about classes at runtime with these handy introspection methods:
let mapViewClass = ObjectiveClass<MKMapView>()
let ivars = mapViewClass.ivars // An array of ivars.
let selectors = mapViewClass.selectors // An array of selectors.
let properties = mapViewClass.properties // An array of properties.
let protocols = mapViewClass.protocols // An array of protocols.
Modifying classes at runtime
Add a pre-existing selector from another class to your ObjectiveClass:
let viewClass = ObjectiveClass<UIView>()
viewClass.addSelector(#selector(testSelector), from: self.classForCoder)
let view = UIView()
view.perform(#selector(testSelector))
Add a custom method by providing the implementation with a closure:
let viewClass = ObjectiveClass<UIView>()
viewClass.addMethod(closureName, implementation: {
print("hello world")
})
let view = UIView()
view.performMethod(closureName)
ObjectiveKit also supports exchanging selectors in the same class:
let viewClass = ObjectiveClass<UIView>()
viewClass.exchangeSelector(#selector(UIView.layoutSubviews), with: #selector(UIView.xxx_layoutSubviews))
Creating classes at runtime
Lastly, you can also create a custom ObjC class at runtime:
let runtimeClass = RuntimeClass(superclass: UIView.self)
runtimeClass.addIvar(ivarName, type: .Float)
let runtimeObject = runtimeClass.allocate()
runtimeObject.setValue(4.0, forKey: ivarName)
Setting up
Setting up with CocoaPods
source 'https://github.com/CocoaPods/Specs.git'
pod 'ObjectiveKit', '~> 0.2'
Setting up with Carthage
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate ObjectiveKit into your Xcode project using Carthage, specify it in your Cartfile
:
github "marmelroy/ObjectiveKit"