Skip to content

Commit ea5a62a

Browse files
committed
minor, shortening code lines for book formatting
1 parent 0ea2b70 commit ea5a62a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

bk2ch08p411individualCells/ch21p710addCellSubviewsInStoryboard/RootViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RootViewController : UITableViewController {
2424

2525
let lab = cell.theLabel
2626
// prove that many rows does not mean many cell objects
27-
lab.text = "This is row \(indexPath.row) of section \(indexPath.section)"
27+
lab.text = "Row \(indexPath.row) of section \(indexPath.section)"
2828
if lab.tag != 999 {
2929
lab.tag = 999
3030
println("New cell \(++self.cells)")

bk2ch09p476popovers/ch22p751popovers/MyPopoverBackgroundView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ class MyPopoverBackgroundView : UIPopoverBackgroundView {
4848

4949
let con = UIGraphicsGetCurrentContext()
5050
CGContextSaveGState(con)
51-
var proposedX = self.arrowOffset
51+
var propX = self.arrowOffset
5252
let limit : CGFloat = 22.0
5353
let maxX = rect.size.width/2.0 - limit
54-
if proposedX > maxX {
55-
proposedX = maxX
54+
if propX > maxX {
55+
propX = maxX
5656
}
57-
if proposedX < limit {
58-
proposedX = limit
57+
if propX < limit {
58+
propX = limit
5959
}
60-
CGContextTranslateCTM(con, rect.size.width/2.0 + proposedX - Arrow.ARBASE/2.0, 0)
60+
CGContextTranslateCTM(con, rect.size.width/2.0 + propX - Arrow.ARBASE/2.0, 0)
6161
CGContextMoveToPoint(con, 0, Arrow.ARHEIGHT)
6262
CGContextAddLineToPoint(con, Arrow.ARBASE / 2.0, 0)
6363
CGContextAddLineToPoint(con, Arrow.ARBASE, Arrow.ARHEIGHT)

0 commit comments

Comments
 (0)