IOS-1235 using Thread.threadID IOS-1235
authorDirk Zimmermann <dz@pep.security>
Tue, 04 Dec 2018 11:47:53 +0100
branchIOS-1235
changeset 7299c80af94b5c37
parent 7298 5df62c9d9b16
IOS-1235 using Thread.threadID
pEpForiOS/UI/Util/SuggestTableViewController/SuggestViewModel.swift
     1.1 --- a/pEpForiOS/UI/Util/SuggestTableViewController/SuggestViewModel.swift	Tue Dec 04 11:49:27 2018 +0100
     1.2 +++ b/pEpForiOS/UI/Util/SuggestTableViewController/SuggestViewModel.swift	Tue Dec 04 11:47:53 2018 +0100
     1.3 @@ -60,22 +60,13 @@
     1.4          resultDelegate?.suggestViewModelDidSelectContact(identity: identities[index])
     1.5      }
     1.6  
     1.7 -    private var threadId: String {
     1.8 -        let threadName = Thread.current.name ?? "unknown"
     1.9 -        if Thread.isMainThread {
    1.10 -            return "main (\(threadName))"
    1.11 -        } else {
    1.12 -            return "other (\(threadName))"
    1.13 -        }
    1.14 -    }
    1.15 -
    1.16      public var numRows: Int {
    1.17 -        print("*** \(threadId) numRows \(identities.count)")
    1.18 +        print("*** \(Thread.threadID) numRows \(identities.count)")
    1.19          return identities.count
    1.20      }
    1.21  
    1.22      public func row(at index: Int) -> Row {
    1.23 -        print("*** \(threadId) row at \(index)")
    1.24 +        print("*** \(Thread.threadID) row at \(index)")
    1.25          guard index < identities.count else {
    1.26              Log.shared.errorAndCrash(component: #function, errorString: "Index out of bounds")
    1.27              return Row(name: "Problem", email: "child")
    1.28 @@ -92,7 +83,7 @@
    1.29              identities = Identity.by(snippet: search)
    1.30          }
    1.31          let showResults = identities.count > 0 || showEmptyList
    1.32 -        print("*** \(threadId) updateSuggestion() \(identities.count)")
    1.33 +        print("*** \(Thread.threadID) updateSuggestion() \(identities.count)")
    1.34          delegate?.suggestViewModelDidResetModel(showResults: showResults)
    1.35          resultDelegate?.suggestViewModel(self, didToggleVisibilityTo: showResults)
    1.36      }