I am new to Swift programming language. I want to download a movie from some tubular servers and want to play offline. I use Alamofire to download parts. I can specify the file as follows:
var file:String?
if let files = NSFileManager.defaultManager().contentsOfDirectoryAtPath(documentsDirectory, error: &error) as? [String] {
for filename in files {
file = filename
println(filename)
}
}
But the problem is how I can use this file for my purpose. Suppose its image file, and I want to show in imageview.
myImageView.image = UIImage(contentsOfFile: file)
Thank you for any help.
source
share