SwiftGen
R.swift
Our great sponsors
SwiftGen | R.swift | |
---|---|---|
9 | 5 | |
9,084 | 9,394 | |
0.6% | - | |
4.1 | 6.5 | |
about 1 month ago | 19 days ago | |
Swift | Swift | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
SwiftGen
-
Create, Push, and Present Any View Controller in 1 LOC using Metaprogramming
It is important to say that there is an elegant solution to the resource consistency problem that we haven’t adapted yet. Instead of testing raw values of UIStoryboard.Name cases, we could just generate the UIStoryboard.Name enum. Please refer to SwiftGen for the details.
-
Localization strings files have a new format/convention?
Your strings should work as-is if you use a tool like SwiftGen (it generates compiler-enforced types for use in your app).
- Do you guys/gals use the "Costants.swift" file or the "Localizations.strings" method?
- What are the most underrated third party libraries for Native iOS?
-
How would you solve this localization issue?
Tools like https://github.com/SwiftGen/SwiftGen can be used to ensure at compile time that all keys used in your app are actually defined. Having keys organized as hierarchical enums, with auto-completion in Xcode is also a nice plus.
-
Can I install SwiftGen through a Gemfile?
Our project includes a Gemfile which we use to specify some external dependencies. I'm trying to add SwiftGen (https://github.com/SwiftGen/SwiftGen) to the project. We want to eventually deprecate Cocoapods so I can't use that installation method.
-
Can I use SwiftGen to map Lottie files?
https://github.com/SwiftGen/SwiftGen/issues/627#issuecomment-715259788
- Bamboo Agent On Apple Silicon M1 Any Success Yet
-
Did you also know? In Xcode you can use the refactoring tool to wrap a literal string into a call to NSLocalizedString! Even better, you can assign a keyboard shortcut to make it even more efficient 🤓
Or you can use something like SwiftGen and have code generation for your localized strings and have it checked at compile time instead of getting those pesky typo errors at runtime that you never check ;)
R.swift
- SPM and localization
-
Simple, but accurate drawing for iOS
I was having trouble getting R.swift to work with with SPM, potentially it's not supported yet? https://github.com/mac-cain13/R.swift/issues/735
-
Custom styling similar to Android for iOS
All resources in Android are referenced in a static class called R, so accessing to individual resources is pretty easy using R.[typeOfResource].resourceName. For iOS we use a library that does something similar, is called R.swift With that we can access resources in iOS using an 'Android like' sintax
-
Did you also know? In Xcode you can use the refactoring tool to wrap a literal string into a call to NSLocalizedString! Even better, you can assign a keyboard shortcut to make it even more efficient 🤓
Same was posted on the /r/iOSProgramming post for this, but I'm definitely not going back to using the raw NSLocalizedString call or extensions after I started using R.swift. Type safety and auto complete for all your assets is a real win in my book.
Or R.swift Clean and convenient solution.
What are some alternatives?
XcodeGen - A Swift command line tool for generating your Xcode project
fastlane-plugin-appicon - Generate required icon sizes and iconset from a master application icon.
Shark - Swift CLI for strong-typing images, colors, storyboards, fonts and localizations
Localize-Swift - Swift friendly localization and i18n with in-app language switching
SwifterSwift - A handy collection of more than 500 native Swift extensions to boost your productivity.
BartyCrouch - Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
infer - A static analyzer for Java, C, C++, and Objective-C
SwiftGen - The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!
Xtrace - Trace Objective-C method calls by class or instance
L10n-swift - Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Dollar - A functional tool-belt for Swift Language similar to Lo-Dash or Underscore.js in Javascript