@@ -9,43 +9,41 @@ import UIKit
99
1010class ErrorDetailsViewController : UITableViewController {
1111 let error : Error
12- let errorDetails : [ ( key: String , value: String ) ]
12+ let errorDetails : [ ( key: String , value: String ) ]
1313
1414 init ( error: Error ) {
1515 self . error = error
1616 if let localizedError = error as? LocalizedError {
17- var list : [ ( key: String , value: String ) ] = [ ]
17+ var list : [ ( key: String , value: String ) ] = [ ]
1818 if let errorDescription = localizedError. errorDescription {
19- list. append ( ( " 简述 " , errorDescription) )
19+ list. append ( ( " 简述 " , errorDescription) )
2020 }
2121 if let failureReason = localizedError. failureReason {
22- list. append ( ( " 原因 " , failureReason) )
23-
22+ list. append ( ( " 原因 " , failureReason) )
2423 }
2524 if let helpAnchor = localizedError. helpAnchor {
26- list. append ( ( " 解决 " , helpAnchor) )
27-
25+ list. append ( ( " 解决 " , helpAnchor) )
2826 }
2927 if let recoverySuggestion = localizedError. recoverySuggestion {
30- list. append ( ( " 恢复 " , recoverySuggestion) )
31-
28+ list. append ( ( " 恢复 " , recoverySuggestion) )
3229 }
33- errorDetails = list
34- } else {
35- errorDetails = [ ( " 错误 " , error. localizedDescription) ]
30+ self . errorDetails = list
31+ } else {
32+ self . errorDetails = [ ( " 错误 " , error. localizedDescription) ]
3633 }
3734 super. init ( style: . insetGrouped)
3835 }
3936
37+ @available ( * , unavailable)
4038 required init ? ( coder: NSCoder ) {
4139 fatalError ( " init(coder:) has not been implemented " )
4240 }
43-
41+
4442 override func viewWillAppear( _ animated: Bool ) {
4543 super. viewWillAppear ( animated)
46- self . title = " 错误信息 "
44+ title = " 错误信息 "
4745 }
48-
46+
4947 override func viewDidLoad( ) {
5048 super. viewDidLoad ( )
5149 tableView. allowsSelection = false
0 commit comments