How can i make i circle picture with swift ?
My ViewController :
import UIKit
import Foundation
class FriendsViewController : UIViewController{
@IBOutlet weak var profilPicture: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
profilPicture = UIImageView(frame: CGRectMake(0, 0, 100, 100))
}
}
My profilPicture = UIImageView(frame: CGRectMake(0, 0, 100, 100))
do nothing ..
Exemple: http://www.appcoda.com/ios-programming-circular-image-calayer/
profilPicture = UIImageView(frame: CGRectMake(0, 0, 100, 100))
does not "do nothing". It definitely does something! But what it does is rather unfortunate. It creates a UIImageView and assigns it to a weak reference. The image view is empty; it has no image. Moreover, the reference is weak, so the image view vanishes immediately in a puff of smoke. It's hard to see from this code what you imagined would happen here. – Drool