admin管理员组

文章数量:1289362

As Apple introduce the move(fromOffsets:toOffset:) method in their document

I opened a new XcodePlayground and have this variable.

var letters = Array("ABcDefgHIJKlmNO")

However, the move(fromOffsets:toOffset:) seems unavailable to the letters variable.

I thought it might be a type inference issue, so I declared another variable.

var test: [Int] = [1,2,3,4,5] 

But still unable to call the move method, have I done something wrong?

As Apple introduce the move(fromOffsets:toOffset:) method in their document

I opened a new XcodePlayground and have this variable.

var letters = Array("ABcDefgHIJKlmNO")

However, the move(fromOffsets:toOffset:) seems unavailable to the letters variable.

I thought it might be a type inference issue, so I declared another variable.

var test: [Int] = [1,2,3,4,5] 

But still unable to call the move method, have I done something wrong?

Share Improve this question edited Feb 20 at 3:19 HangarRash 15k5 gold badges19 silver badges55 bronze badges asked Feb 20 at 2:29 Avicii4everAvicii4ever 1551 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Based on @HangarRash's comment, you can import the UIKit or SwiftUI to call the move(fromOffsets:toOffset:) method.

I have submitted a feedback for this odd issue: FB16530359.

本文标签: The Swift Move Array method is unavailable in Xcode playgroundStack Overflow