Skip to content

Commit ddd2b9f

Browse files
committed
nicer formatting, for book
1 parent eb4fcfc commit ddd2b9f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

bk2ch10p526textFieldDelegate/ch23p810textFieldDelegate/MyTextField.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ class MyTextField: UITextField {
5353
override func copy(_ sender:Any?) {
5454
super.copy(sender)
5555
let pb = UIPasteboard.general
56-
if var s = pb.string {
56+
if let s = pb.string {
5757
// ... alter s here ...
58-
// s = s + "surprise!"
59-
pb.string = s
58+
let ss = s + "surprise!"
59+
pb.string = ss
6060

61-
s = pb.string! // shut the compiler up
62-
print("copied", s)
61+
print("pasteboard contains", pb.string as Any)
6362
}
6463
}
6564
}

bk2ch22p773location/ch35p1032location/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import CoreLocation
55
class ManagerHolder {
66
let locman = CLLocationManager()
77
var doThisWhenAuthorized : (() -> ())?
8-
func checkForLocationAccess(always:Bool = false, andThen f: (()->())? = nil) {
8+
func checkForLocationAccess(always: Bool=false, andThen f: (()->())?=nil) {
99
// no services? fail but try get alert
1010
guard CLLocationManager.locationServicesEnabled() else {
1111
print("no location services")

0 commit comments

Comments
 (0)