Skip to content

Commit

Permalink
Small readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
mac-cain13 committed Jul 17, 2015
1 parent a1178c2 commit 260fcef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ _Tool to get strong typed, autocompleted resources like images, cells and segues

## Why use this?

You currently type:
It makes your code that uses resources:
- **Fully typed**, less casting and guessing what a method will return
- **Compiletime checked**, no more incorrect strings that make your app crash on runtime
- **Autocompleted**, never have to guess that image name again

Currently you type:
```swift
let icon = UIImage(names: "settings-icon")
let cell = dequeueReusableCellWithReuseIdentifier("textCell", forIndexPath: indexPath) as? TextCell
Expand All @@ -12,16 +17,11 @@ performSegueWithIdentifier("openSettings")

With R.swift it becomes:
```swift
let icon = R.images.settingsIcon
let icon = R.image.settingsIcon
let cell = dequeueReusableCellWithReuseIdentifier(R.reuseIdentifier.textCell, forIndexPath: indexPath)
performSegueWithIdentifier(R.segue.openSettings)
```

It makes your code that uses resources:
- **Fully typed**, less casting and guessing what a method will return
- **Compiletime checked**, no more incorrect strings that make your app crash on runtime
- **Autocompleted**, never have to guess that image name again

## Usage

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.
Expand Down

0 comments on commit 260fcef

Please sign in to comment.