I am currently writing a iOS App using AWS Mobile Hub and the AWS services. I'm in the middle of implementing API Gateway into my app after connecting it with an AWS Lambda function. After doing all that, AWS generated an SDK for me to implement into my project but the problem is, is that the code is in Swift 2.0. I am trying to convert it into Swift 3.0 but I have no idea what this code is supposed to do/trying to do, so I don't know how to convert it.
My question is, how do I convert this line into Swift 3.0?
var URLString: String = "https://XXXXX.execute-api.XXXX.amazonaws.com/prod" if URLString.hasSuffix("/") { URLString = URLString.substringToIndex(URLString.startIndex.advancedBy(URLString.lengthOfBytesUsingEncoding(NSUTF8StringEncoding) - 1)) } The problem is the line of code in the "if" statement. Thank you.