Jaydeep Patel
Jaydeep Patel

Reputation: 1739

stringByAppendingPathComponent no more valid for swift2

NSTemporaryDirectory().stringByAppendingPathComponent("Library/Caches") which method can replace it & please give sentence for that thank you in advance

Upvotes: 0

Views: 300

Answers (1)

vadian
vadian

Reputation: 285082

A solution is a simple type cast to NSString

(NSTemporaryDirectory() as NSString).stringByAppendingPathComponent("Library/Caches")

Other standard folders like NSHomeDirectory() can be specified with URLForDirectory:inDomain:appropriateForURL:create of NSFileManager to be able to use the path modification methods of NSURL.

Upvotes: 1

Related Questions