La soluzione più veloce per aggiungere il bordo ad un’immagine (UIImage) in Objective-C è importare il framework QuartzCore, importare nell’intestazione l’header della libreria:
1 |
#import <QuartzCore/QuartzCore.h> |
e poi inserire nel metodo che lavora sull’immagine il seguente codice:
1 2 |
[imageView.layer setBorderColor: [[UIColor blackColor] CGColor]]; [imageView.layer setBorderWidth: 2.0]; |
enjoy