Cannot invoke initializer for type 'Range' with an argument list of type '(Range)'

后端 未结 4 1186
谎友^
谎友^ 2020-11-28 10:55

After updating to Xcode 10 beta, which apparently comes with Swift 4.1.50, I\'m seeing the following error which I\'m not sure how to fix:

Cannot invo

4条回答
  •  攒了一身酷
    2020-11-28 11:43

    Turns out, ranges do not have to be initialized but can simply be created as follows:

    let range: Range = start...end
    

    In this case, the code would be fixed by replacing Range(start.. with:

    let range: Range = start..

提交回复
热议问题