質問編集履歴
11
文章を修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
## 2つの問題点
|
2
2
|
|
3
3
|
|
4
|
+
######①
|
4
|
-
|
5
|
+
**onError()**は書いていないのはなぜ? ↓
|
5
6
|
```API
|
6
7
|
class hogehoge {
|
7
8
|
static func signIn(email: String, password: String, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMassage: String?) -> Void) {
|
@@ -11,12 +12,13 @@
|
|
11
12
|
return
|
12
13
|
}
|
13
14
|
onSuccess()
|
14
|
-
onError() <--これ
|
15
|
+
onError() <--これを書いていないのはなぜ?
|
15
16
|
}
|
16
17
|
}
|
17
18
|
}
|
18
19
|
```
|
20
|
+
######②
|
19
|
-
|
21
|
+
エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか? エラーが出た時にreturnで抜けて、APIのErrorの値がsignInViewControllerの(error)に勝手に入るのでしょうか?
|
20
22
|
|
21
23
|
|
22
24
|
|
10
tagの修正
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
9
tagの追加
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
8
文章の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
## 2つの問題点
|
2
2
|
|
3
3
|
|
4
|
-
#####①**onError()**は書かなくていいんでしょうか? ↓
|
4
|
+
######①**onError()**は書かなくていいんでしょうか? ↓
|
5
5
|
```API
|
6
6
|
class hogehoge {
|
7
7
|
static func signIn(email: String, password: String, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMassage: String?) -> Void) {
|
@@ -16,12 +16,12 @@
|
|
16
16
|
}
|
17
17
|
}
|
18
18
|
```
|
19
|
-
#####②エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか? エラーが出た時にreturnで抜けて、APIのErrorの値がsignInViewControllerの(error)に勝手に入るのでしょうか?
|
19
|
+
######②エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか? エラーが出た時にreturnで抜けて、APIのErrorの値がsignInViewControllerの(error)に勝手に入るのでしょうか?
|
20
20
|
|
21
21
|
|
22
22
|
|
23
23
|
|
24
|
-
##
|
24
|
+
##元のコード
|
25
25
|
```API
|
26
26
|
class hogehoge {
|
27
27
|
static func signIn(email: String, password: String, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMassage: String?) -> Void) {
|
7
文章を修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
##
|
1
|
+
## 2つの問題点
|
2
|
-
swiftとfirebaseでアプリを作成中
|
3
2
|
|
4
3
|
|
5
|
-
|
6
|
-
##
|
4
|
+
#####①**onError()**は書かなくていいんでしょうか? ↓
|
7
5
|
```API
|
8
6
|
class hogehoge {
|
9
7
|
static func signIn(email: String, password: String, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMassage: String?) -> Void) {
|
@@ -13,26 +11,17 @@
|
|
13
11
|
return
|
14
12
|
}
|
15
13
|
onSuccess()
|
14
|
+
onError() <--これ
|
16
15
|
}
|
17
16
|
}
|
18
17
|
}
|
19
18
|
```
|
20
|
-
```signInViewController
|
21
|
-
@IBAction func signInButton_TouchUpInside(_ sender: Any) {
|
22
|
-
|
19
|
+
#####②エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか? エラーが出た時にreturnで抜けて、APIのErrorの値がsignInViewControllerの(error)に勝手に入るのでしょうか?
|
23
|
-
self.performSegue(withIdentifier: "hogehoge", sender: nil)
|
24
|
-
}) { (error) in
|
25
|
-
print(error!.description)
|
26
|
-
}
|
27
|
-
}
|
28
|
-
```
|
29
20
|
|
30
21
|
|
31
22
|
|
32
|
-
## 分からない部分が2つあります
|
33
23
|
|
34
|
-
|
35
|
-
##
|
24
|
+
## コード
|
36
25
|
```API
|
37
26
|
class hogehoge {
|
38
27
|
static func signIn(email: String, password: String, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMassage: String?) -> Void) {
|
@@ -42,14 +31,24 @@
|
|
42
31
|
return
|
43
32
|
}
|
44
33
|
onSuccess()
|
45
|
-
onError() <--これ
|
46
34
|
}
|
47
35
|
}
|
48
36
|
}
|
49
37
|
```
|
38
|
+
```signInViewController
|
39
|
+
@IBAction func signInButton_TouchUpInside(_ sender: Any) {
|
50
|
-
|
40
|
+
hogehoge.signIn(email: emailTextField.text!, password: passwordTextField.text!, onSuccess: {
|
41
|
+
self.performSegue(withIdentifier: "hogehoge", sender: nil)
|
42
|
+
}) { (error) in
|
43
|
+
print(error!.description)
|
44
|
+
}
|
45
|
+
}
|
46
|
+
```
|
51
47
|
|
52
|
-
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
53
52
|
すみませんが、よろしくお願いします。
|
54
53
|
|
55
54
|
|
6
タイトルの修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
このクロージャー
|
1
|
+
このクロージャーが良く理解できない
|
body
CHANGED
File without changes
|
5
タイトルの修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
このクロージャーの
|
1
|
+
このクロージャーの良く理解できない
|
body
CHANGED
File without changes
|
4
文章の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -47,7 +47,7 @@
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
```
|
50
|
-
#####②エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか?
|
50
|
+
#####②エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか? エラーが出た時にreturnで抜けて、APIのErrorの値がsignInViewControllerの(error)に勝手に入るのでしょうか?
|
51
51
|
|
52
52
|
以上2つになります。
|
53
53
|
すみませんが、よろしくお願いします。
|
3
文章を修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -29,17 +29,10 @@
|
|
29
29
|
|
30
30
|
|
31
31
|
|
32
|
-
## 分からない部分が
|
32
|
+
## 分からない部分が2つあります
|
33
|
-
#####① signIn()の中に引数の**onError**が入っていないのはなぜ?普通に書いたらこうならないでしょうか? ↓
|
34
|
-
```signInViewController
|
35
|
-
hogehoge.signIn(email: emailTextField.text!, password: passwordTextField.text!, onSuccess: {
|
36
|
-
self.performSegue(withIdentifier: "hogehoge", sender: nil)
|
37
|
-
}, onError: { (error) in
|
38
|
-
print(error!.description)
|
39
|
-
} )
|
40
|
-
```
|
41
33
|
|
34
|
+
|
42
|
-
#####
|
35
|
+
#####①**onError()**は書かなくていいんでしょうか? ↓
|
43
36
|
```API
|
44
37
|
class hogehoge {
|
45
38
|
static func signIn(email: String, password: String, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMassage: String?) -> Void) {
|
@@ -54,9 +47,9 @@
|
|
54
47
|
}
|
55
48
|
}
|
56
49
|
```
|
57
|
-
#####
|
50
|
+
#####②エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか?
|
58
51
|
|
59
|
-
以上
|
52
|
+
以上2つになります。
|
60
53
|
すみませんが、よろしくお願いします。
|
61
54
|
|
62
55
|
|
2
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
|
32
32
|
## 分からない部分が3つあります
|
33
|
-
#####① signIn()の中に引数の**onError**が入っていないのはなぜ?普通に書いたらこうならないでしょうか?
|
33
|
+
#####① signIn()の中に引数の**onError**が入っていないのはなぜ?普通に書いたらこうならないでしょうか? ↓
|
34
34
|
```signInViewController
|
35
35
|
hogehoge.signIn(email: emailTextField.text!, password: passwordTextField.text!, onSuccess: {
|
36
36
|
self.performSegue(withIdentifier: "hogehoge", sender: nil)
|
@@ -39,7 +39,7 @@
|
|
39
39
|
} )
|
40
40
|
```
|
41
41
|
|
42
|
-
#####②**onError()**は書かなくていいんでしょうか?
|
42
|
+
#####②**onError()**は書かなくていいんでしょうか? ↓
|
43
43
|
```API
|
44
44
|
class hogehoge {
|
45
45
|
static func signIn(email: String, password: String, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMassage: String?) -> Void) {
|
1
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
|
32
32
|
## 分からない部分が3つあります
|
33
|
-
① signIn()の中に引数の**onError**が入っていないのはなぜ?普通に書いたらこうならないでしょうか?
|
33
|
+
#####① signIn()の中に引数の**onError**が入っていないのはなぜ?普通に書いたらこうならないでしょうか?
|
34
34
|
```signInViewController
|
35
35
|
hogehoge.signIn(email: emailTextField.text!, password: passwordTextField.text!, onSuccess: {
|
36
36
|
self.performSegue(withIdentifier: "hogehoge", sender: nil)
|
@@ -39,7 +39,7 @@
|
|
39
39
|
} )
|
40
40
|
```
|
41
41
|
|
42
|
-
②**onError()**は書かなくていいんでしょうか?
|
42
|
+
#####②**onError()**は書かなくていいんでしょうか?
|
43
43
|
```API
|
44
44
|
class hogehoge {
|
45
45
|
static func signIn(email: String, password: String, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMassage: String?) -> Void) {
|
@@ -54,7 +54,7 @@
|
|
54
54
|
}
|
55
55
|
}
|
56
56
|
```
|
57
|
-
③エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか?
|
57
|
+
#####③エラーが出た時に、signViewControllerの**(error)**に値が入ると思うのですが、どこから値が渡されるのでしょうか?
|
58
58
|
|
59
59
|
以上3つになります。
|
60
60
|
すみませんが、よろしくお願いします。
|