Skip to content

Commit

Permalink
Merge pull request mac-cain13#121 from tomlokhorst/patch-2
Browse files Browse the repository at this point in the history
Fixes some issues in Examples.md
  • Loading branch information
mac-cain13 committed Dec 5, 2015
2 parents efd86dc + c06577e commit 749a9c3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions Documentation/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ performSegueWithIdentifier(R.segue.overviewController.openSettings, sender: self

// And then prepare it:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let typedInfo = segue.typedInfoWithIdentifierR.segue.overviewController.openSettings) {
typedInfo.segue.animationType = .LockAnimation
if let typedInfo = segue.typedInfoWithIdentifier(R.segue.overviewController.openSettings) {
typedInfo.segue.animationType = .LockAnimation
typedInfo.destinationViewController.lockSettings = true
}
}
Expand Down Expand Up @@ -103,33 +103,33 @@ let viewControllerWithNib = CustomViewController(nib: R.nib.customView)
*Vanilla*
```swift
class FaqAnswerController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
let textCellNib = UINib(nibName: "TextCell", bundle: nil)
tableView.registerNib(textCellNib, forCellReuseIdentifier: "TextCellIdentifier")
}

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let textCell = tableView.dequeueReusableCellWithIdentifier("TextCellIdentifier", forIndexPath: indexPath) as? TextCell
textCell?.mainLabel.text = "Hello World"
return textCell
}
override func viewDidLoad() {
super.viewDidLoad()
let textCellNib = UINib(nibName: "TextCell", bundle: nil)
tableView.registerNib(textCellNib, forCellReuseIdentifier: "TextCellIdentifier")
}

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let textCell = tableView.dequeueReusableCellWithIdentifier("TextCellIdentifier", forIndexPath: indexPath) as! TextCell
textCell.mainLabel.text = "Hello World"
return textCell
}
}
```

*With R.swift*
```swift
class FaqAnswerController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
tableView.registerNib(R.nib.textCell)
}

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let textCell = tableView.dequeueReusableCellWithIdentifier(R.nib.textCell.reuseIdentifier, forIndexPath: indexPath)
textCell?.mainLabel.text = "Hello World"
return textCell
}
override func viewDidLoad() {
super.viewDidLoad()
tableView.registerNib(R.nib.textCell)
}

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let textCell = tableView.dequeueReusableCellWithIdentifier(R.nib.textCell.reuseIdentifier, forIndexPath: indexPath)!
textCell.mainLabel.text = "Hello World"
return textCell
}
}
```

Expand Down

0 comments on commit 749a9c3

Please sign in to comment.