Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

xcode create image from calayer

func imageFromLayer(layer:CALayer) -> UIImage {
    UIGraphicsBeginImageContextWithOptions(layer.frame.size, layer.isOpaque, 0)
    layer.render(in: UIGraphicsGetCurrentContext()!)
    let outputImage = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()
    return outputImage!
}
Comment

PREVIOUS NEXT
Code Example
Swift :: swift ranges 
Swift :: Why Inheritance? 
Swift :: how to print body moya swift 
Swift :: Swift self property 
Swift :: how to switch tabs in xcode 
Swift :: function parameters swift 
Swift :: change textview link color swift 
Swift :: do something when your HTTP response finishes. swift 
Swift :: swift print statement 
Swift :: Nested Loops in Swift 
Swift :: Swift Variables names must start with either a letter 
Swift :: corner radius with animation swift 
Swift :: declare multiple variables at once in swift 
Swift :: Swift Assign Values to Variables 
Swift :: swift convert frame to another view 
Swift :: swift variable 
Swift :: flutter create custom appbar 
Ruby :: ruby raise error 
Ruby :: ruby reorder keys in hash 
Ruby :: integer to string ruby 
Ruby :: ruby check if exists 
Ruby :: ruby exponent 
Ruby :: table name from rails console 
Ruby :: ruby get decimal 
Ruby :: rails scopes 
Ruby :: ruby loop through array 
Ruby :: rails faker 
Ruby :: pg_ctl: no database directory specified and environment variable PGDATA unset 
Ruby :: remove order by from query in rails 
Ruby :: ruby join hash to string 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =