Tutorial on Krzysztof Zabłockihttp://merowing.info/tags/tutorial/
Recent content in Tutorial on Krzysztof ZabłockiHugo -- gohugo.ioen-usWed, 18 Oct 2017 12:30:51 +0200Finding exact difference between 2 instanceshttp://merowing.info/2017/10/finding-exact-difference-between-2-instances/
Wed, 18 Oct 2017 12:30:51 +0200http://merowing.info/2017/10/finding-exact-difference-between-2-instances/<p>Have you ever written tests? Usually, they use equality asserts, e.g. XCTAssertEqual, what happens if the object isn&rsquo;t equal? Xcode throws a wall of text at you:</p>
<figure class="center">
<img src="https://raw.githubusercontent.com/krzysztofzablocki/Difference/master/Resources/before.png" />
</figure>
<p>This forces you to manually scan the text and try to figure out exactly whats wrong, what if instead you could just learn which property is different?</p>
<figure class="center">
<img src="https://raw.githubusercontent.com/krzysztofzablocki/Difference/master/Resources/after.png" />
</figure>
<p></p>How to find retain cycles and memory leaks soonerhttp://merowing.info/2017/10/how-to-find-retain-cycles-and-memory-leaks-sooner/
Sun, 01 Oct 2017 12:30:51 +0200http://merowing.info/2017/10/how-to-find-retain-cycles-and-memory-leaks-sooner/<p><a href="https://github.com/krzysztofzablocki/LifetimeTracker">
<figure class="center">
<img src="https://raw.githubusercontent.com/krzysztofzablocki/LifetimeTracker/master/Resources/demo.gif" />
</figure>
</a></p>
<p>LifetimeTracker can surface retain cycle / memory issues right as you develop your application, and it will surface them to you immediately, so you can find them with more ease.</p>
<p>Instruments and Memory Graph Debugger are great, but too many times developers forget to check for issues as they close the feature implementation.</p>
<p>If you use those tools sporadicaly many of the issues they surface will require you to investigate the cause, and cost you a lot of time in the process.</p>
<p></p>Stop weak-strong dancehttp://merowing.info/2017/04/stop-weak-strong-dance/
Mon, 03 Apr 2017 16:52:42 +0200http://merowing.info/2017/04/stop-weak-strong-dance/<p>Closures in Swift are extremely useful, they are interchangeable with functions and that creates a lot of opportunities for useful use-cases. One thing we have to be careful when using them is to avoid <strong>retain cycles</strong>.</p>
<p>We have to do it so often that it begs the question:</p>
<p><strong>Can we improve the call-site API?</strong></p>
<p></p>How hard would it be to adjust your iOS app in real-time?http://merowing.info/2017/01/how-hard-would-it-be-to-adjust-your-ios-app-in-real-time/
Mon, 02 Jan 2017 17:21:09 +0200http://merowing.info/2017/01/how-hard-would-it-be-to-adjust-your-ios-app-in-real-time/<p><a href="https://github.com/krzysztofzablocki/Traits">
<figure class="center">
<img src="http://merowing.info/2017/01/demo.gif" />
</figure>
</a></p>
<p>Iterating over design that needs to be reflected in code can be tedious and time-consuming.</p>
<p>Typically the designer works in graphics editing software and then submits flat art to the developer who implements the design in code. Refining the design requires going through the same laborious process.</p>
<p>Even harder if we want to support multiple themes in our apps. How would we even approach that if we were using Interface Builder?</p>
<p>Let&rsquo;s look at how we can approach implementing a simple library that could solve all of the above concerns.</p>
<p></p>Logging in Swifthttp://merowing.info/2016/07/logging-in-swift/
Wed, 13 Jul 2016 17:36:06 +0200http://merowing.info/2016/07/logging-in-swift/<p>Logging is one of the rare cases when you could probably justify having a singleton, but with Swift Protocol Extension you don&rsquo;t need to.</p>
<p>Let&rsquo;s integrate Logging in a way that:</p>
<ul>
<li>Doesn&rsquo;t cause 3rd party dependencies to leak across your codebase</li>
<li>Hides the existence of singleton from the codebase</li>
<li>Supports writing fully testable code</li>
<li>Ability to suppress logs from specific modules or classes</li>
</ul>
<p></p>Improve your iOS Architecture with FlowControllershttp://merowing.info/2016/01/improve-your-ios-architecture-with-flowcontrollers/
Tue, 05 Jan 2016 11:23:46 +0100http://merowing.info/2016/01/improve-your-ios-architecture-with-flowcontrollers/<p>When working on iOS app, now more than ever one should avoid having view controllers pushing other view controllers around.</p>
<p>Why?</p>
<p></p>Details matter - harnessing the power of Core Animationhttp://merowing.info/2015/12/details-matter---harnessing-the-power-of-coreanimation/
Wed, 16 Dec 2015 22:23:13 +0100http://merowing.info/2015/12/details-matter---harnessing-the-power-of-coreanimation/<p>A friend showed me animations from <a href="https://medium.com/bridge-collection/improve-the-payment-experience-with-animations-3d1b0a9b810e#.15j1me98l">Stripe Checkout</a> and asked: &ldquo;how could we implement that on iOS?&rdquo;</p>
<p>Quite simply, Core Animation is very powerful and if one learns how to harness that power, they do not need write a lot of code.</p>
<video autoplay loop>
<source src="http://merowing.info/2015/12/details.mov" type="video/mp4">
</video>
<p></p>The beauty of imperfectionhttp://merowing.info/2015/11/the-beauty-of-imperfection/
Tue, 24 Nov 2015 12:29:37 +0100http://merowing.info/2015/11/the-beauty-of-imperfection/<video autoplay loop>
<source src="http://merowing.info/2015/12/dot-animated.mov" type="video/mp4">
</video>
<p>Perfection is not something one can truly achieve, so it’s very smart that one of the best meditation services called <a href="https://www.headspace.com">Headspace</a> is using an imperfect dot as their brand logo.</p>
<p>If you ever used their iOS app, you can notice how their dot slightly deforms, captivating your focus.</p>
<p>When it comes to graphics, if you are able to cheat (if user can’t tell the difference) and make tech stuff easier, just do it.</p>
<p></p>Prototyping floating burger menu with CAShapeLayerhttp://merowing.info/2015/11/prototyping-floating-burger-menu-with-cashapelayer/
Wed, 04 Nov 2015 13:29:44 +0100http://merowing.info/2015/11/prototyping-floating-burger-menu-with-cashapelayer/<video autoplay loop>
<source src="http://merowing.info/2015/11/Header-small.mp4" type="video/mp4">
</video>
<p>Reproducing above effect is very simple with CAShapeLayer and CoreAnimation&hellip;</p>
<p></p>A Swift introduction into fitnesshttp://merowing.info/2014/09/a-swift-introduction-into-fitness/
Tue, 30 Sep 2014 00:00:00 +0000http://merowing.info/2014/09/a-swift-introduction-into-fitness/<p>Many people think getting fit is hard, the fitness industry is full of myths and unnecessary complications.</p>
<p>Doesn’t matter if your goal is to lose weight or gain it, what matter is Physics and law of energy:</p>
<blockquote>
<p>If you burn more calories than you eat you will lose weight</p>
</blockquote>
<p>Two questions arise:</p>
<ol>
<li>how to estimate our caloric needs?</li>
<li>how fast should we lose or gain weight?</li>
</ol>
<p>We&rsquo;ll use Swift Playgrounds to explain it.</p>
<p></p>Behaviours and Xcode 6http://merowing.info/2014/06/behaviours-and-xcode-6/
Sun, 22 Jun 2014 00:00:00 +0000http://merowing.info/2014/06/behaviours-and-xcode-6/<p>Last time I&rsquo;ve written about Behaviours in <a href="http://www.objc.io/issue-13/behaviors.html">objc.io</a> Architecture Series.</p>
<p>Xcode 6 has some great improvements, few people realise that <strong>IBInspectable</strong> works on any class, not just views.</p>
<p>Let&rsquo;s use that to improve upon my original Behaviours.
</p>iOS App Architecture, Part 2: Data parsinghttp://merowing.info/2014/04/subjective-guide-to-writing-ios-apps-part-2-data-parsing/
Thu, 03 Apr 2014 00:00:00 +0000http://merowing.info/2014/04/subjective-guide-to-writing-ios-apps-part-2-data-parsing/<p><a href="http://merowing.info/2014/03/subjective-guide-to-writing-ios-apps-part-1-introduction">Last time</a> we set our project, this time we look at how we could create a simple yet flexible architecture for our model layer.</p>
<p></p>iOS App Architecture, Part 1: Setting uphttp://merowing.info/2014/03/subjective-guide-to-writing-ios-apps-part-1-introduction/
Fri, 14 Mar 2014 00:00:00 +0000http://merowing.info/2014/03/subjective-guide-to-writing-ios-apps-part-1-introduction/<p>This will be subjective look at creating iOS app, first part will focus on basics like project setup, folder structure, version control and some quality metrics.</p>
<p></p>Expanded use of assertshttp://merowing.info/2013/07/expanded-use-of-asserts/
Wed, 03 Jul 2013 00:00:00 +0000http://merowing.info/2013/07/expanded-use-of-asserts/<p>Do you use assertions in your code? What for? How do you handle release builds ?</p>
<p>There is a better way than NSAssert&hellip;</p>
<p></p>iOS Game with Interface Builderhttp://merowing.info/2013/04/learn-ios-game-dev-level-0/
Thu, 11 Apr 2013 00:00:00 +0000http://merowing.info/2013/04/learn-ios-game-dev-level-0/<figure >
<img src="http://merowing.info/2013/04/clone-small.png" />
</figure>
<p>By the end of this tutorial you will have a simple game with level editor under 250 lines of code.</p>
<p></p>Pinch to reveal animation, like in Boeing Milestoneshttp://merowing.info/2012/07/pinch-to-reveal-animation-like-in-boeing-milestones/
Sun, 01 Jul 2012 00:00:00 +0000http://merowing.info/2012/07/pinch-to-reveal-animation-like-in-boeing-milestones/<p><a href="http://itunes.apple.com/us/app/boeing-milestones/id510294916?mt=8">Boeing made a nice app for iPad</a></p>
<p>I was shown this app and asked if it’s hard to do this pinch to reveal animation.
It’s actually quite easy to do with CoreAnimation.</p>
<video width="100%" controls>
<source src="http://merowing.info/2012/07/Boening-proof-of-concept.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<p></p>Drawing smooth lines with cocos2d ios inspired by Paperhttp://merowing.info/2012/04/drawing-smooth-lines-with-cocos2d-ios-inspired-by-paper/
Mon, 23 Apr 2012 00:00:00 +0000http://merowing.info/2012/04/drawing-smooth-lines-with-cocos2d-ios-inspired-by-paper/<p>You’ve probably seen <a href="http://www.fiftythree.com/">Paper</a>, the app is pretty cool and the drawings look really nice and smooth.</p>
<p>I’m working on my personal app that needs something similar, and after doing some research I’ve not seen a proper solution.</p>
<p>So I wrote one.
</p>