github mac-cain13/R.swift v1.0.0
1.0.0

latest releases: 7.5.1-alpha.3, 7.5.1-alpha.2, 7.5.1-alpha.1...
8 years ago

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 to R.image.settingsIcon()
    • R.file.someJson changed to R.file.someJson()
    • R.storyboard.main.initialViewController changed to R.storyboard.main.initialViewController()
    • R.storyboard.main.someViewController changed to R.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 to R.storyboard.main()
    • R.nib.someView.initiate() changed to R.nib.someView()
  • Nib root view loading changed from R.nib.someView.firstView(nil, options: nil) to R.nib.someView.firstView(owner: nil)
  • Typed segue syntax changed from segue.typedInfoWithIdentifier(R.segue.someViewController.someSegue) to R.segue.someViewController.someSegue(segue: segue)
  • Runtime validation changed:
    • R.validate() now throws errors it encounters
    • R.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 importstatements, 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 the NSURL 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 special UIImage constructor when you need it)
  • Information about resources is now accessible, a few examples:
    • R.image.settingsIcon.name returns the name of the image
    • R.nib.myCell.identifier returns the reuse identifier string of the cell
    • R.storyboard.main.name returns the name of the storyboard

Don't miss a new R.swift release

NewReleases is sending notifications on new releases.