Swift 5.0 update:
As pointed out in the comment, you can use this.
let filename: NSString = "bottom_bar.png" let pathExtention = filename.pathExtension let pathPrefix = filename.deletingPathExtension
More Related Contents:
- Cannot convert value of type string to type url in coercion
- Swift extract regex matches
- Split a String into an array in Swift?
- How to input currency format on a text field (from right to left) using Swift?
- How can I convert string date to NSDate?
- Get the length of a String
- Convert Swift string to array
- Find out if Character in String is emoji?
- Working with Unicode code points in Swift
- Swift Get string between 2 strings in a string
- Convert array to JSON string in swift
- How add separator to string at every N characters in swift?
- How to know if two emojis will be displayed as one emoji?
- Swift apply .uppercaseString to only the first letter of a string
- How to implement the Hashable Protocol in Swift for an Int array (a custom string struct)
- Store [String] in NSUserDefaults
- (Swift) how to print “\” character in a string?
- Formatting Phone number in Swift
- How to convert an Int to Hex String in Swift
- Set the maximum character length of a UITextField in Swift
- How to remove special characters from string in Swift 2?
- How to use Facebook iOS SDK on iOS 10
- How to find file UTI for file, withouth pathExtension, in a path in Swift
- iOS UINavigationBar button remains faded after segue back
- How to throttle search (based on typing speed) in iOS UISearchBar?
- How to use addTarget method in swift 3
- Check if optional array is empty
- performSegueWithIdentifier very slow when segue is modal
- Xcode Version 6.1 (6A1030) – Apple Mach O-Linker Error – Building
- Using UIPageViewController with swift and multiple view controllers