R.swift alternatives and similar libraries
Based on the "Tools" category.
Alternatively, view R.swift alternatives based on common mentions on social networks and blogs.
-
Awesome-Design-Tools
The best design tools and plugins for everything ๐ -
SwiftGen
The Swift code generator for your assets, storyboards, Localizable.strings, โฆ โ Get rid of all String-based APIs! -
Lona
A tool for defining design systems and using them to generate cross-platform UI code, Sketch files, and other artifacts. -
Tweaks
An easy way to fine-tune, and adjust parameters for iOS apps in development. -
FBSimulatorControl
idb is a flexible command line interface for automating iOS simulators and devices -
Xcodes.app
The easiest way to install and switch between multiple versions of Xcode - with a mouse click. -
SourceKitten
An adorable little framework and command line tool for interacting with SourceKit. -
GDPerformanceView-Swift
Shows FPS, CPU and memory usage, device model, app and iOS versions above the status bar and report FPS, CPU and memory usage via delegate. -
ProvisionQL
Quick Look plugin for apps and provisioning profile files -
LicensePlist
A license list generator of all your dependencies for iOS applications -
AppDevKit
AppDevKit is an iOS development library that provides developers with useful features to fulfill their everyday iOS app development needs. -
Laurine
Laurine - Localization code generator written in Swift. Sweet! -
ThisCouldBeUsButYouPlaying
:black_joker: Generate Swift Playgrounds for any library. -
DBDebugToolkit
Set of easy to use debugging tools for iOS developers & QA engineers. -
iSimulator
iSimulator is a GUI utility to control the Simulator, and manage the app installed on the simulator. -
Blade
Better asset workflow for iOS developers. Generate Xcode image catalogs for iOS / OSX app icons, universal images, and more. -
Realm Browser
DEPRECATED - Realm Browser for Mac OS X has been replaced by realm-studio which is cross platform. -
Cookiecutter
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file -
SuperDelegate
SuperDelegate provides a clean application delegate interface and protects you from bugs in the application lifecycle -
WatchdogInspector
Shows your current framerate (fps) in the status bar of your iOS app -
abandoned-strings
Command line program that detects unused resource strings in an iOS or OS X application. -
fastlane-plugin-appicon
Generate required icon sizes and iconset from a master application icon. -
AVXCAssets-Generator
AVXCAssets Generator takes path for your assets images and creates appiconset and imageset for you in just one click -
Shark
Swift CLI for strong-typing images, colors, storyboards, fonts and localizations -
SwiftLintXcode
An Xcode plug-in to format your code using SwiftLint.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of R.swift or a related project?
Popular Comparisons
README
R.swift
[
](blob/master/License) 
Get strong typed, autocompleted resources like images, fonts and segues in Swift projects
Why use this?
It makes your code that uses resources:
- Fully typed, less casting and guessing what a method will return
- Compile time checked, no more incorrect strings that make your app crash at runtime
- Autocompleted, never have to guess that image name again
Currently you type:
let icon = UIImage(named: "settings-icon")
let font = UIFont(name: "San Francisco", size: 42)
let color = UIColor(named: "indicator highlight")
let viewController = CustomViewController(nibName: "CustomView", bundle: nil)
let string = String(format: NSLocalizedString("welcome.withName", comment: ""), locale: NSLocale.current, "Arthur Dent")
With R.swift it becomes:
let icon = R.image.settingsIcon()
let font = R.font.sanFrancisco(size: 42)
let color = R.color.indicatorHighlight()
let viewController = CustomViewController(nib: R.nib.customView)
let string = R.string.localizable.welcomeWithName("Arthur Dent")
Check out [more examples](Documentation/Examples.md) or hear about how Fabric.app uses R.swift!
Demo
Autocompleted images:
[Autocompleted images](Documentation/Images/DemoUseImage.gif)
Compiletime checked images:
[Compiletime checked images](Documentation/Images/DemoRenameImage.gif)
This is only the beginning, check out [more examples](Documentation/Examples.md)!
CocoaHeadsNL presentation
Mathijs Kadijk presented R.swift at the September 2016 CocoaHeadsNL meetup. Talking about the ideas behind R.swift and demonstrating how to move from plain stringly-typed iOS code to statically typed code.
Features
After installing R.swift into your project you can use the R
-struct to access resources. If the struct is outdated just build and R.swift will correct any missing/changed/added resources.
R.swift currently supports these types of resources:
- [Images](Documentation/Examples.md#images)
- [Fonts](Documentation/Examples.md#custom-fonts)
- [Resource files](Documentation/Examples.md#resource-files)
- [Colors](Documentation/Examples.md#colors)
- [Localized strings](Documentation/Examples.md#localized-strings)
- [Storyboards](Documentation/Examples.md#storyboards)
- [Segues](Documentation/Examples.md#segues)
- [Nibs](Documentation/Examples.md#nibs)
- [Reusable cells](Documentation/Examples.md#reusable-table-view-cells)
Runtime validation with [R.validate()
](Documentation/Examples.md#runtime-validation):
- If all images used in storyboards and nibs are available
- If all named colors used in storyboards and nibs are available
- If all view controllers with storyboard identifiers can be loaded
- If all custom fonts can be loaded
Q&A
- [Why was R.swift created?](Documentation/QandA.md#why-was-rswift-created)
- [Why should I choose R.swift over alternative X or Y?](Documentation/QandA.md#why-should-i-choose-rswift-over-alternative-x-or-y)
- [What are the requirements to run R.swift?](Documentation/QandA.md#what-are-the-requirements-to-run-rswift)
- [How to use methods with a
Void
argument?](Documentation/QandA.md#how-to-use-methods-with-a-void-argument) - [How to fix missing imports in the generated file?](Documentation/QandA.md#how-to-fix-missing-imports-in-the-generated-file)
- [How to use classes with the same name as their module?](Documentation/QandA.md#how-to-use-classes-with-the-same-name-as-their-module)
- [Can I ignore resources?](Documentation/Ignoring.md)
- [Can I use R.swift in a library?](Documentation/QandA.md#can-i-use-rswift-in-a-library)
- [How does R.swift work?](Documentation/QandA.md#how-does-rswift-work)
- [How to upgrade to a new major version?](Documentation/Migration.md)
- How can I only run specific generators?
Installation
CocoaPods is the recommended way of installation, as this avoids including any binary files into your project.
Note on Carthage: R.swift is a tool used in a build step, it is not a dynamic library. Therefore it is not possible to install it with Carthage.
CocoaPods (recommended)
- Add
pod 'R.swift'
to your Podfile and runpod install
- In Xcode: Click on your project in the file list, choose your target under
TARGETS
, click theBuild Phases
tab and add aNew Run Script Phase
by clicking the little plus icon in the top left - Drag the new
Run Script
phase above theCompile Sources
phase and belowCheck Pods Manifest.lock
, expand it and paste the following script:
bash "$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"
- Add
$SRCROOT/R.generated.swift
to the "Output Files" of the Build Phase - Uncheck "Based on dependency analysis" so that R.swift is run on each build
- Build your project, in Finder you will now see a
R.generated.swift
in the$SRCROOT
-folder, drag theR.generated.swift
files into your project and uncheckCopy items if needed
Screenshot of the Build Phase can be found [here](Documentation/Images/BuildPhaseExample.png)
Tip: Add the *.generated.swift
pattern to your .gitignore
file to prevent unnecessary conflicts.
Mint
First, Install R.Swift
Binary and Run Script Phase
- Add
mac-cain13/R.swift
to your Mintfile and runmint bootstrap
to install this package without linking it globally (recommended) - In Xcode: Click on your project in the file list, choose your target under
TARGETS
, click theBuild Phases
tab and add aNew Run Script Phase
by clicking the little plus icon in the top left - Drag the new
Run Script
phase above theCompile Sources
phase, expand it and paste the following script:
bash if mint list | grep -q 'R.swift'; then mint run R.swift rswift generate "$SRCROOT/R.generated.swift" else echo "error: R.swift not installed; run 'mint bootstrap' to install" return -1 fi
- Add
$SRCROOT/R.generated.swift
to the "Output Files" of the Build Phase - Uncheck "Based on dependency analysis" so that R.swift is run on each build
- Build your project, in Finder you will now see a
R.generated.swift
in the$SRCROOT
-folder, drag theR.generated.swift
files into your project and uncheckCopy items if needed
Tip: Add the *.generated.swift
pattern to your .gitignore
file to prevent unnecessary conflicts.
Second, Install R.Swift.Library
via the Swift Package Manager (requires Xcode 11)
If you see a build error No such module 'Rswift'
when trying to #import Rswift
at the top of the R.generated.swift
file, then you will also need to install the library via the Swift Package Manager available in Xcode 11+.
Head over to the R.Swift.Library repo and follow the Swift Package Manager installation instructions.
Homebrew
R.swift is also available through Homebrew. This makes it possible to install R.swift globally on your system. Install R.swift by running: brew install rswift
. The Homebrew formula is maintained by @tomasharkema.
Manually
- Add the R.swift.Library to your project
- Download a R.swift release, unzip it and put it into your source root directory
- In Xcode: Click on your project in the file list, choose your target under
TARGETS
, click theBuild Phases
tab and add aNew Run Script Phase
by clicking the little plus icon in the top left - Drag the new
Run Script
phase above theCompile Sources
phase, expand it and paste the following script:
bash "$SRCROOT/rswift" generate "$SRCROOT/R.generated.swift"
- Add
$SRCROOT/R.generated.swift
to the "Output Files" of the Build Phase - Uncheck "Based on dependency analysis" so that R.swift is run on each build
- Build your project, in Finder you will now see a
R.generated.swift
in the$SRCROOT
-folder, drag theR.generated.swift
files into your project and uncheckCopy items if needed
Screenshot of the Build Phase can be found [here](Documentation/Images/ManualBuildPhaseExample.png)
Tip: Add the *.generated.swift
pattern to your .gitignore
file to prevent unnecessary conflicts.
Building from source
R.swift is built using Swift Package Manager (SPM).
- Check out the code
- Run
swift build -c release
from the root directory - Follow the manual installation steps with the binary you now have
For developing on R.swift in Xcode, run swift package generate-xcodeproj --xcconfig-overrides RswiftConfig.xcconfig
.
Contribute
We'll love contributions, read the [contribute docs](Documentation/Contribute.md) for info on how to report issues, submit ideas and submit pull requests!
License
R.swift and R.swift.Library are created by Mathijs Kadijk and released under a [MIT License](License).
Special thanks to Tom Lokhorst for his major contributions and help maintaining this project.
*Note that all licence references and agreements mentioned in the R.swift README section above
are relevant to that project's source code only.