This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MCFetchedResultsViewController.h | |
// | |
// | |
// Created by Dave Batton on 5/10/15. | |
// | |
#import <UIKit/UIKit.h> | |
#import <CoreData/CoreData.h> | |
#import "MCTemporaryContextViewController.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MCFetchedResultsViewController.m | |
// MoneyCarta | |
// | |
// Created by Dave Batton on 5/5/15. | |
// Copyright (c) 2015 Project Black. All rights reserved. | |
// | |
#import "MCFetchedResultsViewController.h" | |
#import "AppDelegate.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidAppear(animated: Bool) { | |
super.viewDidAppear(animated) | |
flightView.hidden = false | |
stealImagesFromView(view) | |
} | |
private func stealImagesFromView(view: UIView) { | |
let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) | |
let documentsDirectory = paths.first! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)colorizeView:(UIView *)view | |
{ | |
static CGFloat alpha = 0.1f; | |
view.backgroundColor = [[UIColor blueColor] colorWithAlphaComponent:alpha]; | |
alpha += 0.1f; | |
for (UIView *subview in view.subviews) { | |
[self colorizeView:subview]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)stealImagesFromView:(UIView *)view | |
{ | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentsDirectory = [paths objectAtIndex:0]; // Get documents folder | |
for (UIView *subview in view.subviews) { | |
if ([subview isKindOfClass:[UIImageView class]]) { | |
UIImageView *imageView = (UIImageView *)subview; | |
if (imageView.image) { | |
NSString *filename = [NSString stringWithFormat:@"image (%f)", [NSDate timeIntervalSinceReferenceDate]]; |