소스 검색

add comments about the timer checks

cyberta 4 년 전
부모
커밋
faf6e53840
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      deltachat-ios/Chat/ChatViewController.swift

+ 2 - 0
deltachat-ios/Chat/ChatViewController.swift

@@ -282,6 +282,7 @@ class ChatViewController: UITableViewController {
     }
 
     private func startTimer() {
+        // check if the timer is not yet started
         if !(timer?.isValid ?? false) {
             timer = Timer.scheduledTimer(withTimeInterval: 60, repeats: true) { [weak self] _ in
                 //reload table
@@ -295,6 +296,7 @@ class ChatViewController: UITableViewController {
     }
 
     private func stopTimer() {
+        // check if the timer is not already stopped
         if timer?.isValid ?? false {
             timer?.invalidate()
         }