Slide 28
Slide 28 text
ಈతͳը૾Λ༻ͨ͠Ξχϝʔγϣϯ
func generateImage() -> UIImage {
UIGraphicsBeginImageContextWithOptions(CGSizeMake(100, 100),
false, 0)
let context = UIGraphicsGetCurrentContext()
func colorValue() -> CGFloat{
return CGFloat(arc4random_uniform(255)) / 255.0
}
CGContextSetRGBFillColor(context, colorValue(), colorValue(),
colorValue(), 1)
CGContextFillRect(context, CGRectMake(0, 0, 100, 100))
let generatedImage =
UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return generatedImage
}
ಈతʹ6**NBHFΛੜ͢Δ