Conversion to Swift 4.

This commit is contained in:
Qiu Yuzhou
2017-10-20 18:39:25 +08:00
parent 3faad7b07d
commit d56b108eb8
9 changed files with 117 additions and 112 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ class UserRulesController: NSWindowController {
}
let str = try? String(contentsOfFile: PACUserRuleFilePath, encoding: String.Encoding.utf8)
userRulesView.string = str
userRulesView.string = str!
}
@IBAction func didCancel(_ sender: AnyObject) {
@@ -30,7 +30,7 @@ class UserRulesController: NSWindowController {
}
@IBAction func didOK(_ sender: AnyObject) {
if let str = userRulesView.string {
if let str = userRulesView?.string {
do {
try str.data(using: String.Encoding.utf8)?.write(to: URL(fileURLWithPath: PACUserRuleFilePath), options: .atomic)