Skip to content

Commit

Permalink
Demo: guard not found image
Browse files Browse the repository at this point in the history
  • Loading branch information
ykws committed Jan 18, 2022
1 parent a92a3e6 commit 1fb9c63
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion AKImageCropperViewExample/ImagesTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ extension ImagesTableViewController {
// Configure the cell...

cell.textLabel!.text = name.components(separatedBy: "-").joined(separator: " ")
cell.detailTextLabel?.text = String(format: "Size %0.1f x %0.1f", image?.size.width as CGFloat?, image?.size.height as CGFloat?)

guard let image = image else {
cell.detailTextLabel?.text = "No image"
return cell;
}

cell.detailTextLabel?.text = String(format: "Size %0.1f x %0.1f", image.size.width, image.size.height)

return cell
}
Expand Down

0 comments on commit 1fb9c63

Please sign in to comment.