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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
UIStoryboard *destinationChooser = [UIStoryboard storyboardWithName:@"DestinationChooser" bundle:nil]; | |
self.window.rootViewController = [destinationChooser instantiateInitialViewController]; | |
[self.window makeKeyAndVisible]; | |
if (![[AfarCurrentUser sharedCurrentUser] isSignedIn]) { | |
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Welcome" bundle:nil]; | |
UINavigationController *nav = [storyboard instantiateInitialViewController]; |
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
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
UINavController *centerNav = [[UINavController alloc] initWithRootViewController:[FeaturedViewController new]]; | |
centerNav.restorationIdentifier = @"centerNav"; | |
UINavigationController *leftDrawerNavController = [[UINavigationController alloc] initWithRootViewController:[LeftDrawerViewController new]]; | |
leftDrawerNavController.restorationIdentifier = @"leftDrawerNav"; | |
MMDrawerController *drawerViewController = [[MMDrawerController alloc] initWithCenterViewController:centerNav leftDrawerViewController:leftDrawerNavController]; | |
// no restoration class, since this will always be created before state restoration resumes, and therefore will be found implicitly |
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
/* | |
Basic setup of my app: | |
MMDrawerViewController (custom container view controller | |
LeftDrawerViewController | |
CenterViewController | |
FeaturedViewController (wrapped in a NavControlelr, initial vc at launch, but can be swapped out by interacting with menu in LeftDrawerVC) | |
SearchViewController (wrapped in a NavControlelr, loads within CenterVC when appropriate menu item is tapped in LeftDrawerVC) | |
I can get one scenario to work. as mentioned above, Featured is the first VC that is shown as a child of CenterViewController. | |
If I tap a button in FeaturedVC to change it's background color, when the app is restored, so is the background color. |
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
module Experiment | |
class MagazineRegisterWall | |
CONTROL_ALTERNATIVE = 'full_article' | |
def initialize(signed_in) | |
@signed_in = signed_in | |
@alternative ||= alternative | |
@analytics_group ||= analytics_group | |
end |
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
# the data we get from google looks like: | |
# - close: | |
# day: 0 | |
# time: '1700' | |
# open: | |
# day: 0 | |
# time: '1000' | |
# - close: | |
# day: 3 | |
# time: '1700' |
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)scrollViewDidScroll:(UIScrollView *)scrollView | |
{ | |
// loading the map seems to be the most taxing to the main thread, so | |
// we hold off on loading it until absolutely necessary of if we think | |
// we can do it without the user experiencing any scrolling hitches. | |
// here, we're seeing if the user has scrolled down to the mapShell. | |
// if so, we load the map. | |
// top left of our mapShell | |
float targetPixel = CGRectGetMinY(self.mapShell.frame); |