teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

コードを枠に入れた

2019/12/18 10:18

投稿

marogura
marogura

スコア21

title CHANGED
File without changes
body CHANGED
@@ -7,8 +7,12 @@
7
7
  list1から秒数を選択してスタートすると、timeintervalが〜秒になるよというコードがわからない
8
8
 
9
9
 
10
+
11
+
10
12
  ### 該当のソースコード
11
13
 
14
+ ```ここに言語名を入力
15
+ ソースコード
12
16
  class TimerViewController: UIViewController,UIPickerViewDelegate, UIPickerViewDataSource {
13
17
 
14
18
  @IBOutlet weak var timeCountLabel: UILabel!
@@ -81,14 +85,11 @@
81
85
  DispatchQueue.main.async {
82
86
  self.timeCountLabel.text = String(self.count)
83
87
  }
88
+ if self.count == Int(self.list2[3]) {
89
+ timer.invalidate()
90
+ }
84
91
  }
85
- if self.count == Int(list2[1])
92
+
86
- {
87
-
88
- timer?.invalidate()
89
- } else {
90
-
91
- }
92
93
  }
93
94
 
94
95
  @IBAction func stop() {
@@ -104,4 +105,5 @@
104
105
  }
105
106
 
106
107
 
107
- }
108
+ }
109
+ ```