Use the nextObject()
method of enumerator
:
while let element = enumerator?.nextObject() as? String {
if element.hasSuffix("ext") { // checks the extension
}
}
More Related Contents:
- NSObject subclass in Swift: hash vs hashValue, isEqual vs ==
- Input from the keyboard in command line application
- Convert String to URL (Why is resulting variable nil)
- Saving CGImageRef to a png file?
- Load local web files & resources in WKWebView
- Selecting global or object print function
- Saving WebView to PDF returns blank image?
- Swift: failing to copy files to a newly created folder
- How to listen to global hotkeys with Swift in a macOS app?
- Why is the return value of String.addingPercentEncoding() optional?
- iOS9 Swift File Creating NSFileManager.createDirectoryAtPath with NSURL
- Is there a correct way to determine that an NSNumber is derived from a Bool using Swift?
- creating custom tableview cells in swift
- Return instancetype in Swift
- Swift protocol extension method is called instead of method implemented in subclass
- NSURLSession concurrent requests with Alamofire
- How to update the constant height constraint of a UIView programmatically?
- Does Swift have documentation generation support?
- Get integer value from string in swift
- Why constant constraints the property from a structure instance but not the class instance?
- fatal error: swapping a location with itself is not supported with Swift 2.0
- What is the point of having two different names for the same parameter?
- Swift lazy instantiating using self
- SwiftUI: Pop to root view when selected tab is tapped again
- Is SwiftUI backwards-compatible with iOS 12.x and older?
- No such module ‘RestKit’ with cocoapods and swift
- Why convenience keyword is even needed in Swift?
- Xcode: Using custom fonts inside Dynamic framework
- Using Codable on a dynamic type/object
- Class ‘ViewController’ has no initializers in swift