Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Creating Class Extensions/Giants/UIImage+Cropping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ extension UIImage {

let newImage = UIGraphicsGetImageFromCurrentImageContext()

CGContextRelease(context)

return newImage
}

Expand Down
18 changes: 11 additions & 7 deletions Creating Class Extensions/Giants/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@
import UIKit

class ViewController: UIViewController {
@IBOutlet var imageView : UIImageView = nil

@IBOutlet var imageView:UIImageView?

override func viewDidLoad() {
super.viewDidLoad()

let img = imageView.image
imageView.image = img.cropToCircleWithBorderColor(UIColor(red:0.91, green:0.34, blue:0.16, alpha:1.00), lineWidth: 20)
if let img = imageView?.image{

imageView!.image = img.cropToCircleWithBorderColor(UIColor(red:0.91, green:0.34, blue:0.16, alpha:1.00), lineWidth: 20)

}

}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}


}