I need to record the screen to make a ten-seconds video when someone is broadcasting like the record function of "live.me" app. I can't use replaykit because I need to support iOS8.
when user click the record button,I start to screen shot twenty-four times in a second.
public func screenShot() -> UIImage? { UIGraphicsBeginImageContextWithOptions(self.bounds.size, true, 0) self.drawViewHierarchyInRect(self.bounds, afterScreenUpdates: true) let img = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return img }
then I use AVasset to put all pictures to video
This way, there are too many disadvantages,such as high cpu low performance of mobile phones can't use it。
Is this way wrong or the way works I need to optimize?