Any way to combine for and if-let?
Any way to combine for and if-let?
- Subject: Any way to combine for and if-let?
- From: Rick Mann <email@hidden>
- Date: Tue, 07 Jul 2015 16:42:08 -0700
Is there any way to combine the for and if-let into one line that gives me unwrapped NSURL objects to work on? I believe the enumerator (which came from NSFileManager) will only have valid NSURLs in it.
for item in enumerator!
{
if let url = item as? NSURL
{
let sid = url.lastPathComponent!
print("Found: \(sid), \(url.path)")
processModel(url)
}
}
--
Rick Mann
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden