Skip to content

Commit

Permalink
Add extension to NSError for localized descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdifran committed Nov 29, 2023
1 parent d1dffa9 commit 230bcbf
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// NSError+LocalizedDescription.swift
//
//
// Created by Mark DiFranco on 2023-11-29.
//

import Foundation

public extension NSError {

convenience init(domain: String = "AppFoundations", description: String) {
self.init(domain: domain, code: 0, userInfo: [NSLocalizedDescriptionKey : description])
}
}

0 comments on commit 230bcbf

Please sign in to comment.