mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
21 lines
405 B
Swift
21 lines
405 B
Swift
|
|
//
|
||
|
|
// MyInfoEntityExtension.swift
|
||
|
|
// Meshtastic
|
||
|
|
//
|
||
|
|
// Copyright(c) Garth Vander Houwen 9/3/23.
|
||
|
|
//
|
||
|
|
|
||
|
|
import Foundation
|
||
|
|
|
||
|
|
extension MyInfoEntity {
|
||
|
|
|
||
|
|
var messageList: [MessageEntity] {
|
||
|
|
self.value(forKey: "allMessages") as? [MessageEntity] ?? [MessageEntity]()
|
||
|
|
}
|
||
|
|
|
||
|
|
var unreadMessages: Int {
|
||
|
|
let unreadMessages = messageList.filter{ ($0 as AnyObject).read == false }
|
||
|
|
return unreadMessages.count
|
||
|
|
}
|
||
|
|
}
|