Take a snapshot of current screen with Metal in swift
问题 I tried: let scale = UIScreen.mainScreen().scale UIGraphicsBeginImageContextWithOptions(metalLayer.bounds.size,false,scale) // metalLayer.renderInContext(UIGraphicsGetCurrentContext()!) // self.view.layer ... metalLayer.presentationLayer()!.renderInContext(UIGraphicsGetCurrentContext()!) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil) But the result is a empty screenshot. Any help would be nice! Please