Skip to content

Commit 39dc2f4

Browse files
committed
update for Swift 1.2, Xcode 6.3
1 parent 2dc6c83 commit 39dc2f4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

bk2ch20p740social/Electrocute/ShareViewController.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import MobileCoreServices
66

77
class ShareViewController: SLComposeServiceViewController {
88

9-
let desiredType = kUTTypePlainText as NSString
9+
let desiredType = kUTTypePlainText as String
1010
var voltage = "High"
1111

1212
override func viewDidLoad() {
@@ -19,15 +19,15 @@ class ShareViewController: SLComposeServiceViewController {
1919
config.title = "Voltage"
2020
config.value = self.voltage
2121
config.tapHandler = {
22-
[weak self] in
23-
// should be able to get rid of sself at this point
24-
if let sself = self { // one, two, cha-cha-cha
22+
[unowned self] in
23+
// // should be able to get rid of sself at this point
24+
// if let sself = self { // one, two, cha-cha-cha
2525
// I tried to give VoltageChooser an init override but this caused a crash
2626
// so we set the delegate separately instead
2727
let vc = VoltageChooser()
28-
vc.delegate = sself
29-
sself.pushConfigurationViewController(vc)
30-
}
28+
vc.delegate = self
29+
self.pushConfigurationViewController(vc)
30+
// }
3131
}
3232
return [config]
3333
}
@@ -43,7 +43,7 @@ class ShareViewController: SLComposeServiceViewController {
4343
// Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context.
4444

4545
// I don't actually run an "Electrocute" server so we just return without networking :)
46-
self.extensionContext!.completeRequestReturningItems(NSArray(), completionHandler: nil)
46+
self.extensionContext!.completeRequestReturningItems([AnyObject](), completionHandler: nil)
4747
}
4848

4949
func userChose (s : String) {

bk2ch20p740social/ch33p1004social/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ViewController: UIViewController, MFMailComposeViewControllerDelegate, MFM
7070
}
7171
self.presentViewController(act, animated: true, completion: nil)
7272
if let pop = act.popoverPresentationController {
73-
let v = sender as UIView
73+
let v = sender as! UIView
7474
pop.sourceView = v
7575
pop.sourceRect = v.bounds
7676
}

0 commit comments

Comments
 (0)