Skip to content

Instantly share code, notes, and snippets.

View HHuckebein's full-sized avatar

Bernd Rabe HHuckebein

View GitHub Profile
@HHuckebein
HHuckebein / UIViewControllerCategory
Created August 27, 2013 07:15
UIViewController category to for TDD manually triggered segues.
static const char *storyboardSegueKey = "TestAssociatedStoryboardKey";
static const char *senderKey = "TestAssociatedSenderKey";
@implementation YourViewController (Testing)
- (void)documentsBrowserTest_prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
objc_setAssociatedObject(self, storyboardSegueKey, segue, OBJC_ASSOCIATION_RETAIN);
objc_setAssociatedObject(self, senderKey, sender, OBJC_ASSOCIATION_RETAIN);
}
@implementation DocumentsBrowserTest
{
BOOL _isPad;
SEL realPrepareForSegue, testPrepareForSegue;
}
- (void)setUp
{
[super setUp];
@interface CounterLayer : CALayer
@property (nonatomic, assign) NSInteger count;
@end
@interface MovingCounterView : UIView
@property (nonatomic, strong) CounterLayer *counterLayer;
@end
@HHuckebein
HHuckebein / .travis.yml
Created December 12, 2015 11:57
travis-ci.yml file with basic configuration for Swift with Slack integration
language: objective-c
notifications:
slack:
on_success: always
on_failure: change
rooms:
secure: generated-secret
xcode_project: YourProjectName.xcodeproj
xcode_scheme: YourSharedSchemeName
@HHuckebein
HHuckebein / StoryboardRepresentable.swift
Created February 8, 2016 07:46
UIStoryboard extension to load a storyboard by means of a StoryboardRepresentable type
extension UIStoryboard {
class func storyboard(storyboard: StoryboardRepresentable, bundle: NSBundle? = nil) -> UIStoryboard {
return UIStoryboard(name: storyboard.storyboardName, bundle: bundle)
}
}
protocol StoryboardRepresentable {
var storyboardName: String { get }
}