Closed pfeidemine closed 8 years ago
Perhaps UIAlertView
doesn't appear in the app's list of UIWindow
s?. If this is the case, I'm not sure if there's a way of dealing with it.
As for displaying an overlay over the keyboard, you'll have to make an alteration to the delegate method writeBackgroundFrameInContext:
(or create a new delegate method writeOverlayFrameInContext
).
A quick hack would be to change the following lines in the .m
file:
if (self.delegate) {
[self.delegate writeBackgroundFrameInContext:&bitmapContext];
}
// draw each window into the context (other windows include UIKeyboard, UIAlert)
// FIX: UIKeyboard is currently only rendered correctly in portrait orientation
dispatch_sync(dispatch_get_main_queue(), ^{
UIGraphicsPushContext(bitmapContext); {
for (UIWindow *window in [[UIApplication sharedApplication] windows]) {
[window drawViewHierarchyInRect:CGRectMake(0, 0, _viewSize.width, _viewSize.height) afterScreenUpdates:NO];
}
} UIGraphicsPopContext();
});
to:
// draw each window into the context (other windows include UIKeyboard, UIAlert)
// FIX: UIKeyboard is currently only rendered correctly in portrait orientation
dispatch_sync(dispatch_get_main_queue(), ^{
UIGraphicsPushContext(bitmapContext); {
for (UIWindow *window in [[UIApplication sharedApplication] windows]) {
[window drawViewHierarchyInRect:CGRectMake(0, 0, _viewSize.width, _viewSize.height) afterScreenUpdates:NO];
}
} UIGraphicsPopContext();
});
if (self.delegate) {
[self.delegate writeBackgroundFrameInContext:&bitmapContext];
}
The delegate drawing will now occur on top of the app window (for my use case I needed to draw live video and overlay the app controls over the video, that's why the delegate draws beneath the app window by default).
Then in your view controller, implement the delegate method [ASScreenRecorder sharedInstance].delegate = self;
:
- (void)writeBackgroundFrameInContext:(CGContextRef*)contextRef {
// create overlay CGRect
CGRect overlayRect = …
// set overlay color
CGContextSetFillColor(contextRef, …
// fill rect with overlay color in `contextRef`
CGContextFillRect(contextRef, overlayRect)
}
Thank you so much for the quick answer ! The solution with overlay works perfectly !
The one for UIAlertView didn't had time to test, will come back with an reply to that also in a couple of days.
Hello,
First of all, this is not an issue, but rather a feature that I would like to have. Second, thanks so much for this great recorder, works so nice.
I have noticed that the UIAlertView is not shown in the final recording.
This is my code :
(void)tableView:(UITableView )tableView didSelectRowAtIndexPath:(NSIndexPath )indexPath {
UIAlertView *messageAlert = [[UIAlertView alloc] initWithTitle:@"Row Selected" message:[tableData objectAtIndex:indexPath.row] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
// Display the Hello World Message [messageAlert show];
// Checked the selected row UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; cell.accessoryType = UITableViewCellAccessoryCheckmark;
[tableView deselectRowAtIndexPath:indexPath animated:YES]; }
I can see the selection of the cell, but not the alert.
Also another thing. Is it possible to display an overlay over the keyboard that will be visible only on the recording. I want to accomplish something like a security thing for when a user inputs his credentials, the keyboard and maybe the textfields should be covered, but only in the video. I've seen that lookback.io does something similar but I don't really know how.
Thank you !