Свифт 1.2 Код:
var error:NSError? = nil
if (fileManager.removeItemAtPath(exportPath as String, error: &error))
{
//Error - handle if requried
}
Я не могу скомпилировать этот код в Swift 2.0, когда использую блок try and catch.
Код Swift 2.0
do {
check = try fileManager.removeItemAtPath(exportPath as String)
if(//some condition)
{
// whatever
}
}
catch {
check = nil
}