Swift cleanup: remove duplicate or unnecessary initializers using default values

Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Bryan Montz
2023-07-16 08:00:54 -05:00
committed by William Casarin
parent 6bf5293701
commit 0f1390f412
14 changed files with 31 additions and 139 deletions
+3 -13
View File
@@ -14,11 +14,11 @@ class DirectMessageModel: ObservableObject {
}
}
@Published var draft: String
@Published var draft: String = ""
let pubkey: String
var is_request: Bool
var is_request = false
var our_pubkey: String
func determine_is_request() -> Bool {
@@ -31,19 +31,9 @@ class DirectMessageModel: ObservableObject {
return true
}
init(events: [NostrEvent], our_pubkey: String, pubkey: String) {
init(events: [NostrEvent] = [], our_pubkey: String, pubkey: String) {
self.events = events
self.is_request = false
self.our_pubkey = our_pubkey
self.draft = ""
self.pubkey = pubkey
}
init(our_pubkey: String, pubkey: String) {
self.events = []
self.is_request = false
self.our_pubkey = our_pubkey
self.draft = ""
self.pubkey = pubkey
}
}