Apple TV Survival Guide Slides

prednáška na tému zádrhely pri vývoji pre tvOS z 26.6.2016 (Inloop iOS Dev Meetup v Žiline)
pdf export
Deckset zdrojove slajdy

FRP s ReactiveCocoa na mDevCamp 2015

mdevcamp je za nami, slajdy z mojej prednasky stahujte z linku FRP with ReactiveCocoa at mDevCamp 2015 slides
github repo so sample projektom

quick way how to deal with the new rotation paradigm in iOS 8

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
    if (size.width > size.height) {
        [self.view removeConstraints:self.portraitConstraints];
        [self.view addConstraints:self.landscapeConstraints];
    } else {
        [self.view removeConstraints:self.landscapeConstraints];
        [self.view addConstraints:self.portraitConstraints];
    }
}

Ve škole říkali, že z nás nikdy nic nebude a možná měli pravdu. Čím ale být? Chceme hnít svoje životy v kanclu a jako pejsek každej měsíc vrtět na šéfa ocasem za pořádnou výplatu? Nebo se chceme nechat unášet riffama tam, kde je právě lidi chtějí slyšet? Žít cirkusáckej život v dodávce v přátelskym svazku, kde jsou tvoje cíga i moje cíga. Kde je tvoje pivo i moje pivo. Proces tvoření, hodiny zkoušení, přeskakování jisker, objevování nových zákoutí a sama sebe. Je to naše cesta, po který jsme se rozhodli jít. Naše město, který dokonale známe. Další orgán, schovanej kdesi v těle. Třeba to ani není to, co umíme nejlíp na světě, ale rozhodně je to to, co nám dává sílu každý ráno vstát.

retain cycles in Swift

turns out they are still a problem, but instead of the good old weakify-strongify dance we have to use [weak self], like so:

model.errors.subscribeNext {
[weak self] (next: AnyObject!) -> () in
if let error = next as? NSError {
self!.services.showError(error)
}
return
}

 

When to use weak or strong

One unfortunate consequence (if you want to call it that) of ARC is the ambiguity of when a IBOutlet@property should be declared as weak or strong. The ambiguity arises from the fact that most outlets have no discernible behavioral differences between weak or strong—it just works.

…except when it doesn’t… and things crash, or the compiler warns about weak or strong use.

So what should one do? Always declare IBOutlet properties as weak, except when they need to be strong, as explained by Apple in their Resource Programming Guide section on Nib Files:

Outlets should be changed to strong when the outlet should be considered to own the referenced object:

  • This is often the case with File’s Owner—top level objects in a nib file are frequently considered to be owned by the File’s Owner.

  • You may in some situations need an object from a nib file to exist outside of its original container. For example, you might have an outlet for a view that can be temporarily removed from its initial view hierarchy and must therefore be maintained independently.

The reason why most IBOutlet views can get away with weak ownership is that they are already owned within their respective view hierarchy, by their superview. This chain of ownership eventually works its way up to the view owned by the view controller itself. Spurious use of strong ownership on a view outlet has the potential to create a retain cycle.

 

Traveller lyric video

I’ve done this clip for my friends from Holotropic (https://www.facebook.com/holotropic?ref=br_tf). Their debut album is out 27/10/14. It’s my first shot at lyrics videos in general, I *might* make some more in the future, who knows.