Swift 4 Compatibility
pbible opened this issue · comments
Swift Compiler Error: Subscripts returning String were obsoleted in Swift 4; explicit construct a String from subscripted result.
This error occurs in the file AutoRotatingFileDestination.swift (v5.0.1) compiling in Xcode 9.
Does is work with Swift 3.2?
Fairly easy (temporary) fix:
Line 113
From:
baseFileName = baseFileName[baseFileName.startIndex ..< fileExtensionRange.lowerBound]
To:
baseFileName = String(baseFileName[baseFileName.startIndex ..< fileExtensionRange.lowerBound])
Line 120
From:
let archiveFolderPath: String = filePath[filePath.startIndex ..< logFileNameRange.lowerBound]
To:
let archiveFolderPath = String(filePath[filePath.startIndex ..< logFileNameRange.lowerBound])
Agreed, easy fix, but I’d like to be able to use the code directly from github via CocoaPods.
Definitely - I just had to do this exact hack in a pinch on Monday .. so .. timely. :)
I'm interested in having this fixed as we're moving to Swift4 in all our projects and naturally we're using XCGLogger in all of them. :) I guess I could have a post_install hook for setting 3.2 as the Swift version for XCGLogger specifically, but I'd rather not.
Yep. Will have a Swift 4 version up shortly. Just cleaning up a bunch of things and then I'll push it all. Probably in a couple of hours.
In the meantime, please download my new app! https://alltherings.fit/.
LEGEND! @DaveWoodCom
6.0.0 is the new version for Swift 4. Please let me know if you see any issues. If there are, we can get a point release done quickly to address them.
BTW, please (yes, I'm begging a bit), download my new app: https://alltherings.fit/ And tell your friends about it. I need to get the sales up, or get a real job. lol. Wife's patience is running out...
@DaveWoodCom I am on 6.0.1 in Xcode 9.1.
I am getting warning 'characters' is deprecated: Please use String or Substring directly
AutoRotatingFileDestination.swift line no 277.