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
function getQueryParameters(str) { | |
return (str || document.location.search) | |
.replace(/(^\?)/, '') | |
.split('&') | |
.reduce(function (a, x, i) { | |
var n = x.split('='), y = n[0], z = n[1]; | |
try { z = JSON.parse(z); } catch(e) { } | |
a[y] = a[y] ? typeof a[y] == 'object' ? (a[y].push(z) && a[y]) : [a[y], z] : z; | |
return a; | |
}, {}); |
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
@implementation MainViewController | |
- (void)viewWillAppear:(BOOL)animated | |
{ | |
// Lower screen 20px on iOS 7 | |
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { | |
CGRect viewBounds = [self.view bounds]; | |
viewBounds.origin.y = 20; | |
viewBounds.size.height = viewBounds.size.height - 20; | |
self.webView.frame = viewBounds; |