Skip to content

Instantly share code, notes, and snippets.

View futuretap's full-sized avatar

Ortwin Gentz, FutureTap futuretap

View GitHub Profile
@futuretap
futuretap / WebViewController.m
Created November 8, 2010 17:11
Intercept mailto URLs in a UIWebView and send them to a MFMailComposeViewController
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if ([[[request URL] scheme] isEqualToString:@"mailto"]) {
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
NSArray *rawURLparts = [[[request URL] resourceSpecifier] componentsSeparatedByString:@"?"];
if (rawURLparts.count > 2) {
return NO; // invalid URL
}
@futuretap
futuretap / weak linking error
Created November 23, 2010 23:13
MessageUI framework now linked as "Required", not "Weak". Using LLVM GCC 4.2, BASE SDK iOS 4.2, Deployment target 3.1.
dyld: Symbol not found: _OBJC_CLASS_$_MFMessageComposeViewController
Referenced from: /var/mobile/Applications/C257779B-F488-4890-A08B-883D2D631258/WhereTo.app/WhereTo
Expected in: /System/Library/Frameworks/MessageUI.framework/MessageUI
in /var/mobile/Applications/C257779B-F488-4890-A08B-883D2D631258/WhereTo.app/WhereTo
//
// XPathQuery.m
// FuelFinder
//
// Created by Matt Gallagher on 4/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
// Permission is given to use this source code file, free of charge, in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
@futuretap
futuretap / createAllTestLocalizables.php
Created December 17, 2012 20:37
Script to create a Javascript hash out of all Localizable.strings files. Essential if you're using UIAutomation and want to address buttons etc. by localized title. More info: http://www.innoq.com/blog/phaus/2011/01/using_uiautomation_for_multila.html This is a slightly modified version of the script presented in the blog post that correctly dea…
<?php
//please replace with your settings...
$i18n_folder = "Custom/Resources";
$uiAutomationFolder = "Test/UIAutomationTests/lib";
if(substr($i18n_folder, -1) != "/"){
$i18n_folder.="/";
}
$langs = array();
$ihandle = opendir($i18n_folder);
@futuretap
futuretap / gist:6920492
Last active December 25, 2015 04:49
Logs iOS device color and device enclosure color. Attention: private API, do not use in App Store builds!
UIDevice *device = [UIDevice currentDevice];
SEL selector = NSSelectorFromString([device.systemVersion hasPrefix:@"7"] ? @"_deviceInfoForKey:" : @"deviceInfoForKey:");
NSLog(@"DeviceColor: %@ DeviceEnclosureColor: %@", [device performSelector:selector withObject:@"DeviceColor"], [device performSelector:selector withObject:@"DeviceEnclosureColor"]);
pod --verbose install
Analyzing dependencies
Updating spec repositories
Updating spec repo `master`
$ /usr/bin/git pull
Already up-to-date.
Resolving dependencies of `Podfile`
Pod::Spec.new do |spec|
spec.name = 'DTCoreText'
spec.version = '1.6.9'
spec.platform = :ios, '4.3'
spec.license = 'BSD'
spec.source = { :git => 'https://github.com/Cocoanetics/DTCoreText.git', :tag => spec.version.to_s }
spec.source_files = 'Core/Source/*.{h,m,c}'
spec.dependency 'DTFoundation/Core', '~>1.6.0'
spec.dependency 'DTFoundation/UIKit', '~>1.6.0'
spec.dependency 'DTFoundation/DTHTMLParser', '~>1.6.0'
@futuretap
futuretap / gist:69c6289e791b10b43fba
Created October 21, 2014 20:19
Download the last 12 months of Financial Reports from iTunes Connect (uses Apples Autoingestion tool)
#!/bin/bash
VENDORID=80012345
DATAFOLDER="${HOME}/Sales Reports"
CLASSPATH="${HOME}/bin"
ZVENDORID=`printf %.10d ${VENDORID}`
for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
for REGION in "AE" "AU" "CA" "CH" "CN" "DK" "EU" "GB" "HK" "ID" "IL" "IN" "JP" "MX" "NO" "NZ" "RU" "SA" "SE" "SG" "TR" "TW" "US" "WW" "ZA" ; do
@futuretap
futuretap / UISegmentedControl+Accessibility.m
Created October 27, 2015 22:57
Workaround to make UISegmentedControl with images accessible. See http://openradar.appspot.com/radar?id=118413
//
// UISegmentedControl+Accessibility.m
//
// Created by Ortwin Gentz on 30.05.14.
// Copyright (c) 2014 FutureTap. All rights reserved.
//
@implementation UISegmentedControl (Accessibility)
// Use these convenience setters for easy customization in IB using user defined runtime attributes
@futuretap
futuretap / UIResponder+FTAdditions.h
Created September 14, 2016 18:18
Block based interface to UIKeyCommand
//
// UIResponder+FTAdditions.h
// Streets
//
// Created by Ortwin Gentz on 09.05.16.
// Copyright © 2016 FutureTap. All rights reserved.
//
#import <UIKit/UIKit.h>