Skip to content

Instantly share code, notes, and snippets.

@asadm
asadm / README.md
Created January 30, 2020 20:29 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@asadm
asadm / screenshotOfView.m
Created February 9, 2016 07:03 — forked from brennanMKE/screenshotOfView.m
Screenshot of a view excluding views
- (UIImage *)screenshotOfView:(UIView *)view excludingViews:(NSArray *)excludedViews {
if (!floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
NSCAssert(FALSE, @"iOS 7 or later is required.");
}
// hide all excluded views before capturing screen and keep initial value
NSMutableArray *hiddenValues = [@[] mutableCopy];
for (NSUInteger index=0;index<excludedViews.count;index++) {
[hiddenValues addObject:[NSNumber numberWithBool:((UIView *)excludedViews[index]).hidden]];
((UIView *)excludedViews[index]).hidden = TRUE;