Skip to content

Commit b2a8dd7

Browse files
committed
Updated readme
1 parent a775d93 commit b2a8dd7

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ With R.swift we make sure you can use strong typed identifiers like `R.image.som
1111

1212
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. Below you find the different formats:
1313

14-
Type | Format | Without R.swift | With R.swift
15-
----------------|------------------------------------------------------------|-------------------------------------------|-----------------------------
16-
Image | `R.image.[imageName]` | `UIImage(named: "settings-icon")` | `R.image.settingsIcon`
17-
Segue | `R.segue.[segueIdentifier]` | `"openSettingsSegue"` | `R.segue.openSettingsSegue`
18-
Storyboard | `R.storyboard.[storyboardName].instance` | `UIStoryboard(name: "Main", bundle: nil)` | `R.storyboard.main.instance`
19-
ViewController | `R.storyboard.[storyboardName].[viewControllerIdentifier]` | `UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("LoginController") as? LoginController` | `R.storyboard.main.loginController`
20-
Nib | `R.nib.[nibName].instance` | `UINib(nibName: "TextCell", bundle: nil)` | `R.nib.textCell.instance`
21-
Nib all views | `R.nib.[nibName].instantiateWithOwner(nil, options: nil)` | `UINib(nibName: "TextCell", bundle: nil).instantiateWithOwner(nil, options: nil)` | `R.nib.textCell.instantiateWithOwner(nil, options: nil)`
22-
Nib first view | `R.nib.[nibName].firstView(nil, options: nil)` | `UINib(nibName: "TextCell", bundle: nil).instantiateWithOwner(nil, options: nil).first as? TextCell` | `R.nib.textCell.firstView(nil, nil)`
14+
Type | Format | Without R.swift | With R.swift
15+
-----------------|------------------------------------------------------------|-------------------------------------------|-----------------------------
16+
Image | `R.image.[imageName]` | `UIImage(named: "settings-icon")` | `R.image.settingsIcon`
17+
Segue | `R.segue.[segueIdentifier]` | `"openSettingsSegue"` | `R.segue.openSettingsSegue`
18+
Storyboard | `R.storyboard.[storyboardName].instance` | `UIStoryboard(name: "Main", bundle: nil)` | `R.storyboard.main.instance`
19+
ViewController | `R.storyboard.[storyboardName].[viewControllerIdentifier]` | `UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("LoginController") as? LoginController` | `R.storyboard.main.loginController`
20+
Nib | `R.nib.[nibName].instance` | `UINib(nibName: "TextCell", bundle: nil)` | `R.nib.textCell.instance`
21+
Nib all views | `R.nib.[nibName].instantiateWithOwner(nil, options: nil)` | `UINib(nibName: "TextCell", bundle: nil).instantiateWithOwner(nil, options: nil)` | `R.nib.textCell.instantiateWithOwner(nil, options: nil)`
22+
Nib first view | `R.nib.[nibName].firstView(nil, options: nil)` | `UINib(nibName: "TextCell", bundle: nil).instantiateWithOwner(nil, options: nil).first as? TextCell` | `R.nib.textCell.firstView(nil, nil)`
23+
Reuse identifier | `R.reuseIdentifier.[name]` | `"TextCell"` | `R.reuseIdentifier.textCell`
2324

2425
Validate usage of images in Storyboards with `R.validate()` or to validate a specific storyboard use `R.storyboard.[storyboardName].validateImages()`. Please note that this uses `assert` and will only work in unoptimized debug builds.
2526

0 commit comments

Comments
 (0)