iOS App Development Book/Video Series
The Series on How to Create iPhone & iPad Apps
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
SMF - Just Installed!
Home
Help
Search
Login
Register
iOS App Development Book/Video Series
»
General Category
»
FAQs
»
Fixing the "pathExtension is unavailable" error in Swift 2.0
« previous
next »
Print
Pages: [
1
]
Author
Topic: Fixing the "pathExtension is unavailable" error in Swift 2.0 (Read 4648 times)
kjmcneish
Administrator
Posts: 719
Fixing the "pathExtension is unavailable" error in Swift 2.0
«
on:
September 11, 2015, 08:44:48 PM »
In Swift 2.0, the pathExtension property has been removed from the String class. You can use NSURL's pathExtension instead, but if you want to keep this property on the String class, just use this extension:
Code:
[Select]
var pathExtension: String {
get {
return (self as NSString).pathExtension
}
}
All the best!
Kevin McNeish
Author of
Learn to Code in Swift
:
https://itunes.apple.com/us/book/learn-to-code-in-swift/id942956811?mt=11
Check out our
Robot Tic-Tac-Toe
app:
https://itunes.apple.com/us/app/robot-tic-tac-toe/id990638517?mt=8
«
Last Edit: November 15, 2015, 10:13:04 AM by kjmcneish
»
Logged
Print
Pages: [
1
]
« previous
next »
iOS App Development Book/Video Series
»
General Category
»
FAQs
»
Fixing the "pathExtension is unavailable" error in Swift 2.0