Skip to content

Instantly share code, notes, and snippets.

View OliverLetterer's full-sized avatar
👨‍💻
Happy coding :)

Oliver Letterer OliverLetterer

👨‍💻
Happy coding :)
View GitHub Profile

When dismissing a view controller on top of a view controller with UIModalPresentationPageSheet or UIModalPresentationFormSheet, the presenting view controllers frame and transform can get miscomputed on iOS 7. Here is a fix I used in SPLSpeechBubblePopoverController:

@implementation UIViewController (SPLSpeechBubblePopoverControllerHack)

+ (void)load
{
    class_swizzleSelector(self, @selector(dismissViewControllerAnimated:completion:), @selector(__SPLSpeechBubblePopoverControllerDismissViewControllerAnimated:completion:));
}

Keybase proof

I hereby claim:

  • I am OliverLetterer on github.
  • I am oletterer (https://keybase.io/oletterer) on keybase.
  • I have a public key whose fingerprint is 9910 2A1F 6875 18FD DD01 24B0 A3CC E071 1958 9637

To claim this, I am signing this object:

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@implementation NSArray (BadThirdPartyImplementation)
- (id)firstObject
{
return self[0];
}
@end

Record a screencast with QuickTime Player

  1. Connect an iOS defice with a cable
  2. In QuickTime Player: Option-Cmd-N (New Movie Recording) -> Select your device from the recording menu:

http://cl.ly/image/1w0y3Y0H2g2X/record.png

Install gifify

@OliverLetterer
OliverLetterer / terminal
Created April 3, 2015 10:28
Count insertions / deletions in git repo
git log HEAD...3649b6a056d72524205b57791e7c78f3ac209f7e --numstat | grep ViewController.m | awk '{ INS += $1; DEL += $2 } END { print "+" INS " -" DEL }'
@OliverLetterer
OliverLetterer / command
Created August 4, 2011 08:14
mac os x - extract current user image
dscl . -read /Users/oliver JPEGPhoto | tail -1 | xxd -r -p > ~/Desktop/accountImage.jpg
# define _DLog(format, ...) NSLog((@"%s [%d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
# ifdef DEBUG
# define DLog(format, ...) _DLog(format, ##__VA_ARGS__)
# else
# define DLog(...)
# endif
@OliverLetterer
OliverLetterer / Test
Created October 1, 2011 10:35
Test Gist
Content 111