New features:
- Better checks for color spaces in clr files
- Include base translation in R.strings code
Fixed issues:
- Validating images from nibs now respects bundle
Other:
- We now use swift package manager as our build tool
New features:
- Better checks for color spaces in clr files
Fixed issues:
- Validating images from nibs now respects bundle
Other:
- We now use swift package manager as our build tool
New features:
- Added option to explicitly import modules (fixes #277)
- Support for an ignore file to skip resources (thanks @shiraji / fixes #276)
- Add edge flag to enable new stable feature that are breaking changes
- New nicer casing of identifiers (is behind the edge flag)
Bugfix:
- Load hosting bundle by class instead of identifier (fixes #293)
New features:
- Support for
--accessLevel public
flag that makes allR
things public (handy for libraries) - Handle multiple locales for resource files (
R.file.*
) by @tomlokhorst - Add some more checks while parsing nibs by @Tvede-dk
- Use fully qualified names in the generated file to prevent naming conflicts
- Validation for custom fonts and images in nibs
Deprecated:
- Deprecated
assertValid
method, usevalidate
from a test instead
Bugfix:
- Duplicate printed errors on storyboards
- Validation generated not compilable code when duplicate storyboard identifiers where present
New features:
- Swift 3 support
Breaking changes:
- Swift 2 is not supported anymore, use the 2.* versions for Swift 2
- Some methods are renamed, those are annotated with an availability annotation so the compiler will help you rename
New features:
- Bundle is used in string resources
Bugfix:
- Detect all segues correctly
- Fix namespace problems with validation errors
New features:
- Swift 2.3 support
New features:
- Add
--version
parameter that shows the version of R.swift you are running
Fixed issues:
- Use correct locale for localized strings
- Fix typo in generated comments (by @waywalker)
Fixed issues:
- Fix for using CR + LF in localized strings (by @tomlokhorst)
This is an incorrectly released version and is therefore exactly the same as 2.2.0.
New features:
- Localized string support (by @renrawnalon and @tomlokhorst)
Fixed issues:
- Updated reserved keywords (by @tomlokhorst)
New features:
- Add support for "imagestack" assets, parallax images used on AppleTV (@chillpop)
Fixed issue:
- Use new version of R.swift.Library to avoid Swift 2.2 warnings
- This version is not compatible with Swift 2.1 and therefore a breaking change, use 1.4.2 if you need Swift 2.1 compatibility.
Fixed issue:
- Make this version compatible with Swift 2.1
- This release is exactly the same version as 1.4.0
Note: Do not use this version, use version 2.0.0 or 1.4.2 instead.
Fixed issue:
- Use new version of R.swift.Library to avoid Swift 2.2 warnings
New features:
- Added support for CLR color lists (@tomlokhorst)
- SwiftDoc comments are generated in the
R.generated.swift
file (@tomlokhorst) - R.swift is made available on Homebrew (maintained by @tomasharkema)
- Synthesizing let accessors for storyboard identifiers (@JaviSoto)
- New
NSData(resource: R.file.someFile)
constructor is now available (@tomlokhorst)
Fixed issues:
- Breaking:
R.file.someFile() as String
is removed to prevent ambiguity errors, useR.file.someFile.path()
instead (@tomlokhorst) - Generated variable/function names will never be empty anymore (@tomlokhorst)
- If the first view in a nib is a standard Apple Interface Builder class it will now typecast correctly instead of falling back to
UIView
- NSBundle now falls correctly back on the main bundle, this was documented as such but did not always happen
- Swift keyword list updated to avoid generation of invalid variable/function names
New features:
R.file.*.path()
andR.file.*.url()
are now available
Fixed issues:
- It was possible to invoke segues that didn’t match the source view controller, this is fixed now by restricting some types
- Support
UICollectionReusableView
as root view in a nib
New features:
- Unwind segues are now supported
Fixed issues:
- Avoid creation of empty validate methods
Fixed issues:
- Validate methods could have invalid code in their body
- Help exited with code 1, should be 0
- Also; Improved compile time by 7 seconds with some small code changes
New features:
- Storyboard references are now supported
Fixed issues:
- Segues from views did crash R.swift
Fixed issues:
Validateable
was not written out asRswift.Validateable
in all cases
Fixed issues:
Validatable
collision, since it's quite a common name R.swift now states explicitly it means the one in the R.swift.Library- Imports where missing when the module was only used in the generated code in a inferred way
- The code to call the
_R.validate()
function was always generated, it's now conditional and only generated when needed
Breaking changes:
- iOS 7 support is dropped, use R.swift 0.13 if you still have to support it.
- Generated code now depends on the R.swift.Library, CocoaPods users don't need to do anything. Manual installation users need to include this library themselves, see the readme for instructions.
- In general; properties that created new stuff are now functions to represent better that they actually create a new instance.
R.image.settingsIcon
changed toR.image.settingsIcon()
R.file.someJson
changed toR.file.someJson()
R.storyboard.main.initialViewController
changed toR.storyboard.main.initialViewController()
R.storyboard.main.someViewController
changed toR.storyboard.main.someViewController()
- In general; Where you needed to use
.initialize()
to get the instance, a shorter function is available now:
R.storyboard.main.initialize()
changed toR.storyboard.main()
R.nib.someView.initiate()
changed toR.nib.someView()
- Nib root view loading changed from
R.nib.someView.firstView(nil, options: nil)
toR.nib.someView.firstView(owner: nil)
- Typed segue syntax changed from
segue.typedInfoWithIdentifier(R.segue.someViewController.someSegue)
toR.segue.someViewController.someSegue(segue: segue)
- Runtime validation changed:
R.validate()
now throws errors it encountersR.assertValid()
asserts on errors and only performs action in a debug/non-optimized build- For regular use cases using
R.assertValid()
is recommended
Major features and fixes:
- Writing extensions for R.swift generated code is possible by using the types from the new R.swift.Library
- Improved
import
statements, R.swift will detect modules that you use and import them in the generated file. - Improved error reporting, on incorrect calls to the
rswift
binary as well as during project parsing UITraitCollection
can be specified when loading images- The
String
based path as well as theNSURL
of a file can now easily be accessed thanks to an overloaded function - Constructors are available for all types to provide more flexibility and late initialization (eg. passing a
ImageResource
around and only creating the image with the specialUIImage
constructor when you need it) - Information about resources is now accessible, a few examples:
R.image.settingsIcon.name
returns the name of the imageR.nib.myCell.identifier
returns the reuse identifier string of the cellR.storyboard.main.name
returns the name of the storyboard
New typed segues
- iOS 7 compatible image loading
- Upgrade notice:
- The new R.segue.* structure is a breaking change, upgrading will give you compile errors because the structure has changed.
Old: R.segue.mySegue New: R.segue.myViewController.mySegue
This enables you to reuse segue identifier names between different source view controllers. Segues now also contain type information. See the documentation on how you can leverage from that.
Fixes use of a R.generated.swift-file in a different than the main bundle:
- Loading of assets now use a specific bundle instead of the main bundle
- Mentioning of the bundle name in types is now only done when it's not the bundle the R-file is generated for
- Correct @2x/3x loading for non-PNG files and device specific suffixes like ~ipad and ~iphone
- Use correct product name during build (Thanks @kylejm)
- Support tvOS in podspec (Thanks @tomlokhorst for testing basic tvOS support)
- Better cleanup of invalid characters in filenames when converting to variable names, also preserve capitals for better readability
- Support for images outside of an asset folder (like jpeg images: R.image.gradientJpg)
- Support for resource files in your project (like video files: R.file.myVideoMov)
- Reads projectfile instead of scanning folders (Thanks to Xcode.swift)
- Ability to take flags in the call to R.swift like: rswift --target MyApp ./outputFolder (Thanks to OptionKit)
- Improved documentation and Readme
- Swift 2 support
- Duplicated identifier detection
- A few other small improvements
Fixes incorrect handling of Nib names with a space in them, see issue #56.
When using the assistant editor Xcode will not sugged the R.generated.swift file as a good place to add outlets and such.
Fixes lowercase issue in previous release
- Spaces in image names are now supported
- Introduced registerNibs to register multiple nibs at once
This release adds features to use typed overloads of table- and collectionview methods:
- registerNib with R.nib.*
- dequeueSomethingSomething(R.reuseIdentifier.*) and get an object of the correct type returned
- R.swift now support asset catalog folders/groups
- Fix when using assets that have names that are Swift keywords, they are now properly escaped
- Rewrote codebase to Swift 1.2
- Added R.storyboard.[name].initialViewController to get the initial view controller from a storyboard
- Added missing newline if using multiple storyboard
Fixed a bug where some files where skipped during search and not included in the R-struct. This is now fixed.
- Added support for nibs(/xibs) use R.nib.[name].firstView to get the first view in your nib fully typed!
- All reuse identifiers in your project (nibs and storyboards) are available under R.reuseIdentifier.[name]
- We now leave the generated file untouched if there are no updates
- Errors in executing R.swift will now appear in between you Xcode build errors/warnings
- UIViewController subclasses in your storyboard (like UINavigationController or UISplitviewController) are now correctly typed
- Internal rewrite in the way we generate the R-struct
This release fixes an issue where not importing UIKit import can sometimes give compile errors.
Now you also can load view controllers from a Storyboard without using strings. You can access them with R.storyboard.[name].[viewControllerIdentifier]. They are even validated when you call R.validate()!
In this release a serie of improvements in the codebase as well as in the generated struct. The new resources can be accessed through:
- UIImage: R.image.[imageName]
- UIStoryboardSegue identifier: R.segue.[segueIdentifier]
- UIStoryboard: R.storyboard.[storyboardName].instance
- Validate images used in the given storyboard: R.storyboard.[storyboardName].validateImages()
- Validate all images in all storyboards: R.validate()
R.swift now generated strongly typed segues and provides methods to validate if the images used in your storyboard do exist.
- R.[storyboardName].[segueIdentifier] to get the identifier of a segue
- R.validateStoryboardImages() to validate images in all storyboards
- R.[storyboardName].validateStoryboardImages() to validate images in a single storyboard
Better structure, better name, lots of breaking changes!
- Renamed from TypedImages via Strongly to R.swift
- Refactored about all of the code
- Now use R.[assetFolder].[imageName] instead of the UIImage.* approach
- First public release