File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
bk2ch10p526textFieldDelegate/ch23p810textFieldDelegate
bk2ch22p773location/ch35p1032location Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import CoreLocation
55class 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 " )
You can’t perform that action at this time.
0 commit comments