質問編集履歴
3
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -31,4 +31,5 @@
|
|
31
31
|
コード
|
32
32
|
```
|
33
33
|
|
34
|
-
ちょっと考えてみたところ、なんでこんなのIndexPathのエクステンションで書き始めたんだろう…???
|
34
|
+
ちょっと考えてみたところ、なんでこんなのIndexPathのエクステンションで書き始めたんだろう…???
|
35
|
+
IndexPathのエクステンション以外で書けば、問題自体がなくなるような。
|
2
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -29,4 +29,6 @@
|
|
29
29
|
}
|
30
30
|
|
31
31
|
コード
|
32
|
-
```
|
32
|
+
```
|
33
|
+
|
34
|
+
ちょっと考えてみたところ、なんでこんなのIndexPathのエクステンションで書き始めたんだろう…???
|
1
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,19 +8,24 @@
|
|
8
8
|
[min()](https://developer.apple.com/documentation/foundation/indexpath/1779773-min)と[min(_:_:)](https://developer.apple.com/documentation/swift/1538339-min/)などの区別で必要とかでしょうか?
|
9
9
|
|
10
10
|
```swift
|
11
|
+
import Foundation
|
11
12
|
|
12
13
|
extension IndexPath {
|
13
14
|
|
14
|
-
func createRange(start: IndexPath, end: IndexPath) -> [IndexPath] {
|
15
|
+
func createRange(start: IndexPath, end: IndexPath) -> [IndexPath] {
|
15
16
|
|
16
|
-
|
17
|
+
let s = min(start, end)
|
17
|
-
|
18
|
+
// Use of 'min' refers to instance method 'min()' rather than global function 'min' in module 'Swift'
|
18
|
-
|
19
|
+
// Use 'Swift.' to reference the global function in module 'Swift'
|
19
|
-
let e = max(start, end)
|
20
|
-
// Use of 'min' refers to instance method 'min()' rather than global function 'min' in module 'Swift'
|
21
|
-
// Use 'Swift.' to reference the global function in module 'Swift'
|
22
20
|
|
21
|
+
// let s = Swift.min(start, end) // これでエラーがでなくなる。
|
22
|
+
|
23
|
+
let e = max(start, end)
|
24
|
+
// Use of 'min' refers to instance method 'min()' rather than global function 'min' in module 'Swift'
|
25
|
+
// Use 'Swift.' to reference the global function in module 'Swift'
|
26
|
+
|
23
|
-
|
27
|
+
// (略)
|
28
|
+
}
|
24
29
|
}
|
25
30
|
|
26
31
|
コード
|