swift 5.0
SwifterSwift (5.0.0)
let str = "hello world";
let str1 = str[safe: 0..<3]
The above code will prompt an error. I will rewrite an extension and write these functions. It is not. Why?
Hello @ningkexin
This code works for me in Xcode 10.2.1 and I also use SwifterSwift 5.0.0. What Xcode version are you using?
Hey @ningkexin @RomanPodymov :))
@ningkexin Can you elaborate more on what error it is giving you, so we can check?
@RomanPodymov I also use Version 10.2.1 (10E1001)
@LucianoPAlmeida I don't know why this is causing the problem, but I can probably provide my usage environment. I am using it under the old project (Objective-C). In addition, I used swift4.2 before. I didn't use this POD at first. I just tried the extension of String, which didn't cause any problems during the use. Then I tried the swift5.0 version yesterday, and this problem has appeared!

Xcode also indexes two definitions, but I commented out that my extension is not compiled.
This duplication is probably because Xcode didn鈥檛 reindexed after you comment. But my question is more about the error message. What the error log the compiler is outputting?
Sent with GitHawk
@LucianoPAlmeida

Sorry if this is an obvious question, but have you called import SwifterSwift?
Oh, it鈥檚 stupid, I solved my problem!
Most helpful comment
Sorry if this is an obvious question, but have you called
import SwifterSwift?