PodSearch

Under the Radar

Under the Radar 48: Late Bloomers

 

00:00:00   welcome to under the radar a show about

00:00:02   independent iOS app development I'm

00:00:04   Marco Arment and I'm David Smith under

00:00:06   the radar is never longer than 30

00:00:07   minutes so let's get started today we

00:00:10   want to talk about a topic that is near

00:00:12   and dear to me it is coming late to

00:00:14   things being late bloomers to new

00:00:16   technologies and new techniques or new

00:00:17   abilities things like interface builder

00:00:20   use things like you know if you

00:00:22   controller containment you know they

00:00:23   basically things that that I either

00:00:26   didn't do early on or that I minimally

00:00:28   used early on or just never even gave a

00:00:31   shot and and that I later and more

00:00:33   recently have come to come to realize oh

00:00:35   this is actually useful or even maybe

00:00:39   now it's useful you know maybe it wasn't

00:00:41   that useful in 1.0 but maybe now it has

00:00:43   become more useful over time as Apple

00:00:45   has made these things better this

00:00:47   happens to me all the time my default

00:00:50   reaction to new technologies coming

00:00:52   coming by is I probably don't need that

00:00:55   because much of the time that's true but

00:00:58   but that that attitude makes it hard to

00:01:00   find those times when it's not true and

00:01:02   it often makes me come late to things

00:01:04   now the benefit of coming late to things

00:01:05   any of the issues that 1.0 brought those

00:01:08   have probably been worked out or you

00:01:10   will have heard from a bunch of people

00:01:11   like this this technology or this thing

00:01:13   is not worth using but the ones that are

00:01:15   worth using by the time you come late to

00:01:17   them yeah you've missed some time of

00:01:19   potential improvements and efficiencies

00:01:21   and everything but when you get there

00:01:23   it's really awesome and easy to use and

00:01:25   the tools are better and everything's

00:01:27   more stable

00:01:27   so it isn't all bad being being a

00:01:30   conservative curmudgeon like I am about

00:01:32   new technologies are you that way at all

00:01:34   yes so I I'm a very strange person in

00:01:37   terms of I have like these two different

00:01:40   mindsets when it comes to like new

00:01:41   technology so you know wEDC

00:01:43   Apple announces here's the whole new set

00:01:46   of stuff that are nowadays now available

00:01:48   for Apple developers and I get really

00:01:51   excited and look into and very often

00:01:55   start using like totally new

00:01:57   technologies you know things that

00:01:59   weren't possible before that are now

00:02:01   possible and I'll be one of the first

00:02:03   people in the world to run down that and

00:02:04   try and use it and see we're all it's

00:02:06   often it's you know kind of whore half

00:02:08   broken and the beta period is really

00:02:09   tricky but I like that part of the

00:02:11   development cycle and enjoy it

00:02:14   whenever Apple introduces something that

00:02:15   is a a replacement or extension to

00:02:19   something existing you know and so this

00:02:21   is a pattern that I think Apple I've

00:02:23   seen Apple do many times you know I

00:02:25   started developing on iPhone OS 2.2 I

00:02:29   think was the first OS version that I

00:02:31   was building against Wow it was just way

00:02:32   back in the day and you see what it took

00:02:35   to build something then and now so much

00:02:39   of the stuff that we would write custom

00:02:41   you know custom frameworks for or have

00:02:44   to do ourselves is now just like built

00:02:45   into the system they're all these things

00:02:48   that you know a problem that we had to

00:02:51   solve manually or directly before and

00:02:53   then Apple comes along and says you know

00:02:54   enough people are doing this that we

00:02:57   should probably create a system method

00:02:58   for doing this that'll be more stable

00:03:00   and almost certainly more better

00:03:04   resilient against iOS changes you know

00:03:06   cuz I you know like when iOS 9 goes to

00:03:09   iOS 10 Apple's gonna make sure that you

00:03:12   know collectionview still works

00:03:13   correctly

00:03:14   whereas if I've had my own custom

00:03:16   collection view class suddenly I'm the

00:03:18   one who has to go in and make all the

00:03:20   changes to make sure that it works

00:03:21   nicely on the new OS and so Apple is

00:03:23   rightfully so extending and expanding

00:03:26   the universe of things that we can do

00:03:28   but I always struggle with the feeling

00:03:30   of if I have an existing solution for

00:03:33   something that kind of works and that

00:03:36   I'm familiar with is a really a hard

00:03:38   sell to kind of tear down everything

00:03:41   that I built and then replace it with

00:03:42   apples thing and especially like you

00:03:45   said early on because in that early

00:03:48   phase is when there's the most bugs and

00:03:51   then you can have the really bad feeling

00:03:52   of like regret where it's like oh I

00:03:54   should just go back to doing it the way

00:03:55   that I used to do it because I knew that

00:03:57   I knew at least I knew where all the

00:03:58   problems were if there was a bug I could

00:04:00   fix it and that was the you know a

00:04:02   mindset that's a very easy trap to get

00:04:04   into but on the flip side I definitely

00:04:06   look at some of these things and I

00:04:08   wonder if I'm missing out and history

00:04:13   maybe has shown them some ways I'm

00:04:14   missing out in some ways I'm not you

00:04:15   know obviously the best thing is when

00:04:16   you see a technology fly by you don't

00:04:19   embrace it and then it ends up dying

00:04:21   you know like iCloud core data sync for

00:04:24   example like as a technology that when

00:04:26   it came out I was like

00:04:27   that is interesting like I use core data

00:04:29   and I sync data to a server I wonder if

00:04:33   this would be cool and I kind of poked

00:04:35   my veena poked around a little bit but

00:04:36   never really went down their road

00:04:38   because I had an existing infrastructure

00:04:39   because it turns out that was a great

00:04:41   situation right I think that was you

00:04:44   know officially killed this last summer

00:04:46   and if I had gone all gone all you know

00:04:48   all in on that I would have been in a

00:04:50   world of hurt but on the flip side here

00:04:52   if I had seen cloud kit when it came out

00:04:54   and went in on that that's the vastness

00:04:58   a technology that seems to be ascendant

00:05:00   that seems to be on its way up and so at

00:05:03   this point this part it's like huh maybe

00:05:05   I should be using that maybe that would

00:05:07   be a wise thing for me to be using and

00:05:10   having the benefit of time makes that

00:05:12   choice a lot easier I think and so you

00:05:14   there is certainly a benefit to if a

00:05:16   technology is being replaced and/or

00:05:20   improved upon that I think you can be

00:05:22   more conservative than if it's something

00:05:24   totally new

00:05:25   you know then just go for it and try it

00:05:27   and you know if it doesn't work well

00:05:29   yeah what have you lost but that having

00:05:33   being a bit more conservative when it's

00:05:35   something that is just an extension for

00:05:37   me in any way feels like the right

00:05:38   approach it also it helps to you know as

00:05:41   you mentioned like catching things when

00:05:42   they're when they're ascendant that

00:05:44   really helps with keeping up with Apple

00:05:48   basically keeping up with the new

00:05:49   devices that launch new OS capabilities

00:05:52   Apple makes it easy on you if you kind

00:05:55   of follow their guidelines if you if you

00:05:58   kind of like take like the tracks they

00:05:59   lay out for you like they pave out a way

00:06:02   that they want you to do things whether

00:06:04   it's the language choice in this case

00:06:05   they do now its Swift whether it's

00:06:07   things like using interface builder

00:06:09   using storyboards you know using

00:06:11   adaptive layouts like all these things

00:06:13   like Apple makes things easy to do

00:06:16   things their way and then generally

00:06:19   speaking if you do things their way you

00:06:22   will have less friction or things will

00:06:24   be easier for you in the near future as

00:06:26   they introduce new technologies new

00:06:28   devices things like that and and you

00:06:30   don't have to do things their way but if

00:06:32   you don't you're generally setting

00:06:34   yourself up for more work like for me

00:06:36   one of the biggest things about that was

00:06:38   was when they brought an adaptive

00:06:40   for the iPad like that that changed a

00:06:43   lot of things for a lot of people

00:06:44   because like if you if you had first of

00:06:47   all feel like a separate iPad app and an

00:06:48   iPhone app that broke everything because

00:06:51   all of a sudden Lee well now your iPad

00:06:53   app kind of has a reason to have the

00:06:55   entire iPhone app with it so that it can

00:06:56   run in skinny mode on the sidebar and if

00:06:59   you if you were doing things in a basic

00:07:01   way with like a typical you know UI

00:07:03   split view controller things like that

00:07:05   like then things were easier for you but

00:07:08   if you if you were you know away from

00:07:10   the Apple way you had more work to do I

00:07:13   think - it's an interesting point about

00:07:15   how Apple tends to strongly sort of

00:07:18   Telegraph where they're going yeah with

00:07:20   their announcements that this has been a

00:07:22   pattern that we've seen many times where

00:07:24   Apple introduces a you know a they solve

00:07:29   a problem or they make something easier

00:07:30   that you know either you know end of

00:07:33   that fall sometimes when it's yeah I

00:07:35   remember when you know they first

00:07:37   changed the size of the iPhone like that

00:07:39   was the year that we got Auto layout if

00:07:41   I remember right yep

00:07:42   and like they do those kinds of moves

00:07:44   where they can because obviously they

00:07:46   know what their road map is for the next

00:07:48   six months for the next year for the

00:07:50   next two years and they can look forward

00:07:52   to what that look what that's going to

00:07:54   be and start preparing you know pairing

00:07:57   the ground for what that's what's going

00:07:59   to make development on that platform the

00:08:01   best now and so there's definitely a

00:08:04   wisdom in looking at what what in order

00:08:07   these new technologies and extensions

00:08:08   that they're adding to the to the

00:08:10   frameworks that what is like asking

00:08:13   yourself well what could this mean like

00:08:14   they started adding the size classes and

00:08:17   there's I always remember there was in

00:08:19   the first size class WC session where

00:08:22   there's like they have the quadrant of

00:08:23   like the compact and wide and so they

00:08:27   have like this one is this you know

00:08:29   these devices fall in this category this

00:08:30   these devices fall in this category

00:08:32   these devices fall in this category and

00:08:33   this to this category we don't actually

00:08:35   have any devices that category yet and

00:08:38   obviously like super visual you could

00:08:40   say like huh you know that's just the

00:08:41   way it fell out it's like no Apple is

00:08:43   actually telling us that I think in that

00:08:45   case it was the I believe it was the the

00:08:47   6 plus and landscape which which has I

00:08:50   believe it has the the normal which is

00:08:52   like iPad size or

00:08:54   chantal class and the compact vertical

00:08:56   class yeah exactly like those types of

00:08:59   things like Apple is telling you

00:09:00   something there and so being aware of it

00:09:02   even if you're not going to adopt the

00:09:04   new technology it's probably a good

00:09:05   thing to be kind of suspicious when they

00:09:07   start changing things to see like what

00:09:09   could this mean down the road cuz

00:09:12   they're not gonna waste their time just

00:09:13   adding you know adding stuff for no

00:09:15   reason

00:09:16   yeah I mean one of the things for me

00:09:17   that so to get into some specific

00:09:19   examples here one of the things for me

00:09:21   in this area was viewcontroller

00:09:23   containment or have having child view

00:09:25   controllers basically and implementing

00:09:27   your own parent view controllers and you

00:09:29   know for I think for most iOS developers

00:09:31   you've seen you know kind of view

00:09:33   controller bloat disease it is so easy

00:09:36   to have tons of code in view controllers

00:09:39   because that's kind of just where

00:09:40   everything falls and I know there's

00:09:42   different models there's like mvvm and

00:09:43   stuff I haven't like gotten some any of

00:09:45   those yet so I can't really speak to

00:09:46   them but every iOS developer has seen

00:09:49   the the massive view controller syndrome

00:09:50   and one of the things that helps that a

00:09:52   lot is by making child view controller

00:09:55   so like you know like an overcast you

00:09:57   know I'll have like different panels and

00:09:59   everything and rather than having like

00:10:00   on the nap playing screen they're like

00:10:01   the effects panel rather than having

00:10:03   that be part of the now playing view

00:10:05   controller that is its own view

00:10:07   controller that can be presented or

00:10:08   stuck in various places you know just

00:10:10   using the stock stuff using things like

00:10:12   popovers and split views and navigation

00:10:14   of course you know all these things page

00:10:15   view controllers using all those things

00:10:17   can get you very very far but one of the

00:10:19   biggest things I've done recently I

00:10:20   started making my own parent view

00:10:22   controllers also now one of the things I

00:10:24   did was I I have replaced UI split view

00:10:27   controller with my own custom version of

00:10:29   something that does fairly similar

00:10:31   things but does them kind of more my way

00:10:33   because when I when I was looking at

00:10:35   overcast code I have spent so much time

00:10:37   and there were so much like hacky weird

00:10:40   like configuration and exception code

00:10:42   things like in you know intercepting

00:10:44   traitcollection changes and weird things

00:10:46   like that all to get UI split view

00:10:49   controller to do what I wanted the

00:10:51   amount of code I have to just bend this

00:10:53   existing component to my will is so much

00:10:56   and so fragile and and so hacky I can

00:10:59   actually make my own split view

00:11:01   equivalent controller that just does

00:11:02   things the way I want them to want the

00:11:03   way I want it to with actually far less

00:11:06   code like buy it by a mile

00:11:08   because the built-in components they

00:11:10   have all these limitations in place that

00:11:12   you know Apple thinks they should be

00:11:13   designed this way but the reason one of

00:11:15   the reasons necessary is because like

00:11:16   they have all these different options

00:11:18   and how you can configure them if they

00:11:19   have to work in all the different ways

00:11:20   they have they can't make as many

00:11:21   assumptions as you can

00:11:23   they can't rule out certain options that

00:11:25   you won't use so in their

00:11:26   implementations they're never going to

00:11:28   accommodate everything but at the same

00:11:29   time they have to be like so complex to

00:11:31   accommodate all the things they do

00:11:32   manage to to encompass when you make one

00:11:35   for yourself you can do anything you

00:11:38   want and only what you want and that's

00:11:41   incredibly powerful and you know writing

00:11:43   everything yourself is not always the

00:11:44   best solution that's not always a good

00:11:46   use of time but in cases like this like

00:11:48   I've been fighting with UI splitview

00:11:49   controller and and various like adaptive

00:11:52   layout things for over a year now and

00:11:54   it's just like this I I don't need to do

00:11:56   this like why am I doing this when I

00:11:57   could just write and so I took one day

00:11:59   like let me see if I can write my own in

00:12:00   one day and sure enough of course it was

00:12:03   it was easier than I ever imagined

00:12:04   because the the you know if you control

00:12:06   containment stuff is very much here and

00:12:07   how it's it's been a wrap for a while I

00:12:09   think was ins Iowa it's like five or six

00:12:11   it's it's kind of old right six I think

00:12:13   yeah yeah so it's been out for a while

00:12:16   so all the stuff was very very easy to

00:12:18   do I also made a custom UI page view

00:12:21   controller it basically didn't I want to

00:12:23   do some some custom gesture and view

00:12:26   handling that it just was not capable of

00:12:27   doing without tons of hacks so I just

00:12:29   made my own and my the one I made is not

00:12:32   as good as theirs for general purpose

00:12:34   use but for my use it's way better and

00:12:36   it really is not that much code and it

00:12:38   it's more it's more of like basically

00:12:41   removing times where you have to really

00:12:44   hack with UI kit because you like it's

00:12:46   so complex there's so much there that it

00:12:47   has to do and so much of my of my time

00:12:50   designing interfaces in the past has

00:12:51   been fighting UI kit to just try to

00:12:54   customize something the way I want it

00:12:56   and over time it's become easier but

00:12:58   there's still places where you have to

00:12:59   do it especially like around new

00:13:01   technologies like adaptive UI and stuff

00:13:03   like that when those things kind of come

00:13:04   out and so to to hit yourself out of the

00:13:07   business of hacking UI kit is so freeing

00:13:10   and so so good for your overall code

00:13:12   health and technical debt I highly

00:13:14   recommend it and one of the biggest ways

00:13:16   is view controller that you basically

00:13:18   use and view controllers properly and

00:13:19   not trying to hack the existing ones if

00:13:21   they don't fit your needs

00:13:22   yeah but I think what you're speaking

00:13:24   there is such the strange tension that

00:13:27   when you are looking at these new

00:13:28   technologies because the base building

00:13:30   blocks in iOS are overall I would say

00:13:34   really really good like the number of

00:13:37   things that you can build was just a

00:13:38   scrollview

00:13:39   his immense like I mean I was one of my

00:13:41   favorite talks wotc I don't know if they

00:13:44   did one this last year because I

00:13:45   previously had always been like what's

00:13:47   new in UI scrollview mmm and they would

00:13:49   build these really sophisticated

00:13:52   interactions that were just a scrollview

00:13:54   at the end of the day and but it's that

00:13:57   strange tension where if you use a page

00:14:00   controller like it's like you can get

00:14:02   that first thing working really quickly

00:14:05   but you very cool you'll start to run

00:14:09   out of runway and it's a question I

00:14:11   suppose of how much control you want to

00:14:14   have and how much you want to be

00:14:15   responsible for all the weird edge cases

00:14:17   all the strange issues that are gonna

00:14:20   happen I suppose either way if you use

00:14:22   UI page controller like there's just

00:14:24   gonna be there's gonna be some issues

00:14:26   that you just can't work around and

00:14:27   you're just like oh well like it just

00:14:29   doesn't work the way I like it to in

00:14:30   this particular situation so then you're

00:14:33   like okay let me just build my own and

00:14:34   now of course you're like the important

00:14:37   thing I think maybe is to say is when

00:14:39   you do that you are it's good to be sort

00:14:41   of cognizant and keep your eyes open for

00:14:44   what you're taking on when you do that

00:14:47   because you know apples engineering

00:14:50   teams are know like they're not they're

00:14:52   no slouches like they are really good at

00:14:55   what they're doing and it takes a lot of

00:14:56   engineering work to build the UI

00:14:58   pagecontroller for example like that's

00:15:00   not just a simple thing they threw

00:15:02   together in a day and so if you're gonna

00:15:05   replace it you probably need to be aware

00:15:07   that you're it's gonna be a lot more

00:15:08   work than you think and there's gonna be

00:15:09   weird edges and problems that you're

00:15:13   gonna have to run into you like I

00:15:14   remember this with activity plus plus

00:15:17   where it has this kind of custom

00:15:20   animation where you starts off with the

00:15:22   Rings and if you tap it like the Rings

00:15:24   unfurl and turn into the bar graph which

00:15:27   is this kind of cool animation that I

00:15:29   thought of and I was like oh I really

00:15:30   want to build this and I started to see

00:15:33   if I could build this with UI view

00:15:34   animation

00:15:35   because I would far prefer to do it with

00:15:37   some kind of built-in mechanism and in

00:15:40   the end I couldn't because just it was

00:15:43   just too complicated of a thing to get

00:15:45   performant and to get to look right and

00:15:47   so I ended up just building it myself

00:15:48   using like raw core graphics that I you

00:15:52   know I do the animation of each frame of

00:15:54   that animation and draw its you know

00:15:57   just like I'm just essentially just

00:15:58   drawing that to a bit a bitmap and

00:16:02   displaying it each frame which is great

00:16:04   it looks just how I want it but it means

00:16:06   there's all kinds of weird issues and

00:16:09   performance problems and compatibility

00:16:11   things between different platforms that

00:16:13   if I was just using UI view animation

00:16:16   just wouldn't happen and so really the

00:16:19   trade-off was worth it like I couldn't

00:16:20   do it at the other way but I kind of

00:16:23   wish that I was able to use do so do it

00:16:25   the other way and I think that's

00:16:26   something when I don't think of these

00:16:27   new technologies that Apple puts out

00:16:28   like there's this I definitely always

00:16:30   have that tugging sense of aw man I wish

00:16:32   I could just use whatever it is I wish I

00:16:34   could just use auto layout I wish I

00:16:36   could just use size classes but then as

00:16:39   soon as I hit that edge I have such this

00:16:41   tension it's just saying like oh I'll

00:16:42   just throw my hands up and walk away

00:16:43   which is perhaps a bit childish well but

00:16:46   you know it's you have to always be

00:16:48   defensive of your time like when you're

00:16:49   when you're trying out something new or

00:16:51   when you're thinking about rewriting a

00:16:52   system component for your own use like

00:16:54   it's very easy to fall into a time hole

00:16:56   here and just burn tons of time doing

00:16:59   something that actually isn't productive

00:17:00   part of the the judgement of when to do

00:17:02   that and when not to just comes with

00:17:04   doing it wrong for a number of years and

00:17:06   eventually gaining that wisdom and part

00:17:07   of it is kind of just luck you know a

00:17:09   lot of times you can't really tell

00:17:10   what's gonna be a good use of your time

00:17:11   upfront but you know that's the risk you

00:17:13   take with new stuff all right a sponsor

00:17:15   this week is Braintree go to Braintree

00:17:17   payments comm slash radar by next year

00:17:21   maybe even next week there could be a

00:17:22   whole new way to pay for things maybe

00:17:25   it'll be the next Bitcoin or the next

00:17:26   Apple pay or maybe even both fortunately

00:17:29   Braintree its full stack payment

00:17:31   platform is easily adaptable to whatever

00:17:34   the future holds so you can adapt easily

00:17:36   to if you use Braintree in your apps you

00:17:38   can accept everything from pounds to

00:17:40   PayPal to whatever the next big

00:17:41   innovation is from any device with just

00:17:44   one integration and when that new

00:17:46   payment method comes out all you have to

00:17:47   do is update a few lines of

00:17:49   no late nights no complicated recoding

00:17:52   no stress about staying ahead of the

00:17:53   curve

00:17:54   Braintree is here to help you find out

00:17:56   more at Braintree payments comm slash

00:17:59   radar

00:17:59   that's Braintree payments comm / radar

00:18:02   thank you very much to Braintree for

00:18:04   sponsoring our show one other thing that

00:18:06   I was thinking about with this topic

00:18:07   though is it's something that I wrote

00:18:10   that I you run into if you are behind

00:18:12   the times like I'm very often behind the

00:18:15   way you know like Apple has this new

00:18:16   technology this new approach that

00:18:18   they're recommending and I'm late in

00:18:20   adopting it the thing that I always

00:18:22   noticed too is that you'll run into that

00:18:24   can be really annoying is suddenly all

00:18:26   the documentation all the example code

00:18:28   all the things that you see on Stack

00:18:31   Overflow suddenly don't work for you

00:18:34   anymore thank you that you have to not

00:18:37   only not only have you built your own

00:18:39   approach like you were even if it's not

00:18:40   like you're just going down the road

00:18:41   it's like doing something custom like if

00:18:42   you just have old code then suddenly you

00:18:45   have this new thing that Apple has put

00:18:47   out there pushing and that's where all

00:18:48   their focus is going suddenly that's

00:18:50   where all the documentation is written

00:18:51   for and the you know the example code

00:18:52   they publish will use that new thing and

00:18:54   so there's not a lot of great examples

00:18:57   and it becomes harder and harder and

00:18:58   like the biggest example is probably

00:19:00   Swift like I remember sort of you had

00:19:02   there was this transition period where

00:19:03   all of a sudden all the answers on Stack

00:19:06   Overflow for you know questions I had

00:19:09   about the new technologies we're all all

00:19:11   the example code was just written in

00:19:12   Swift or you know people like snippets

00:19:15   and that can become really awkward and

00:19:18   it's probably a good reason to try and

00:19:20   adopt some of these things with some

00:19:23   urgency just to not be sort of fall

00:19:25   behind to a degree that you just can't

00:19:27   work out what to do or perhaps moreover

00:19:30   you're wasting time like I remember

00:19:32   sitting there wasting time like trying

00:19:33   to translate the swift code into

00:19:36   objective-c and then trying to work out

00:19:39   how to then take that concept and apply

00:19:41   it into my own app but I have to do this

00:19:43   like level of indirection whereas if it

00:19:45   my app wasn't Swift like you like oh I

00:19:47   see what they're doing there I can build

00:19:49   it you know for myself now and that's

00:19:51   something that I think it takes a lot of

00:19:52   experience to realize that you're not

00:19:54   just running into technical issues

00:19:57   you're running into like educational and

00:19:59   learning issues as

00:20:00   well oh yeah but you know that's just

00:20:02   kind of par for the course and it has

00:20:03   thing to move on and new things come in

00:20:05   you know it's kind of like part of the

00:20:07   cost of sticking with old stuff is that

00:20:10   everyone else moves on it seems you know

00:20:13   and that that isn't actually no it isn't

00:20:14   everyone that's how it seems like when

00:20:15   you're searching for help or

00:20:16   documentation or or looking for where

00:20:18   Apple's attention is going like once the

00:20:20   new thing comes out all those people

00:20:22   move on to it and if you are lagging

00:20:24   behind or you string the old thing

00:20:25   that's just again it's just part of the

00:20:26   cost of doing business you know oh sure

00:20:28   but it's it's a weird feeling when

00:20:30   you're like it's some ways I love that I

00:20:34   have some you know I've apps on the App

00:20:36   Store that have been have existed for

00:20:38   years and never see this is a it's I

00:20:41   took a very classic issue in software

00:20:42   engineering of what are you dealing with

00:20:44   legacy code that you have things that

00:20:46   work they should go back to and I mean

00:20:49   it's a crazy feeling when you go back

00:20:51   and look at code and run blame and get

00:20:53   and you see you know this was code was

00:20:55   written back in 2009 or 2010 what was I

00:20:59   doing like why did I have this strange

00:21:02   exception and so often you run into this

00:21:05   situation where like you were coding

00:21:07   around an iOS bug in iOS 5 that you no

00:21:12   longer need to code around and at some

00:21:14   point like you have this weird cycle

00:21:16   where you're coding around to prop a bug

00:21:18   that then gets resolved and then your

00:21:21   code your fix starts to actually be the

00:21:23   bug and caused the problem because

00:21:25   you're doing stuff that isn't is sort of

00:21:27   counter to what the modern approaches

00:21:29   and that's probably why it's so hard to

00:21:31   be a UI could engineer yeah no I

00:21:34   definitely don't envy the you know and

00:21:36   envy that team where they do this really

00:21:39   cool amazing work but like the number of

00:21:42   day having at work across all the

00:21:43   different devices and all the different

00:21:45   things and having an iOS because that

00:21:48   another thing that's kind of crazy is

00:21:49   the way they approach with binary

00:21:50   compatibility and like you can still run

00:21:53   an iOS 4 app on iOS 10 like it'll

00:21:57   probably be a little bit broken and

00:21:59   janky but like they do a lot of work to

00:22:01   keep things forward which is perhaps

00:22:03   another year like I was saying earlier

00:22:05   but another reason why being like I keep

00:22:09   telling myself to be less of a

00:22:10   curmudgeon about the new stuff because

00:22:12   I'm probably wasting a lot of

00:22:14   that you know Apple is paying engineers

00:22:17   to do this work and then I'm just like

00:22:19   walking past them and saying nope nope

00:22:21   I'll do it myself I'll take care of this

00:22:23   myself where that's probably an

00:22:25   inefficient use of my time yeah all

00:22:28   right so let me give a few examples of

00:22:30   some of the more recent things that I

00:22:31   have that I've been working with in the

00:22:33   last few weeks doing overcast 3.0 in the

00:22:35   last few versions I've made extensive

00:22:36   use of kvo key-value observing and this

00:22:40   has been helped tremendously by the

00:22:41   Facebook the FB kvo controller it is a

00:22:44   fantastic open source component I highly

00:22:46   recommend that anybody using kvo or

00:22:48   curious about kbo do it with the FB kvo

00:22:51   controller don't do worth of raw calls

00:22:53   because they're full of bug potential

00:22:55   and the Facebook one boys a lot of that

00:22:56   is very nice to use generally this is

00:22:59   you know this is in very short terms a

00:23:01   way to have some code notified whenever

00:23:04   a certain value of a different object

00:23:07   changes so this is kind of and I think

00:23:11   this is what reactive cocoa is all about

00:23:12   mostly it's like basically and please

00:23:15   forgive me if that's wrong but basically

00:23:16   like kind of having having views and

00:23:19   controls basically update themselves

00:23:21   based on values that changed and also

00:23:24   similar to what OS tended with bindings

00:23:25   which have never never made its iOS but

00:23:28   honestly having used them very briefly

00:23:29   and they're kind of cool I know people I

00:23:30   know there's potential issues but they

00:23:32   can't be pretty cool where I've been

00:23:35   moving basically is moving rather than

00:23:38   having like a view controller that has a

00:23:40   stock UI switch and having the view

00:23:43   controller manage the state of that UI

00:23:44   switch and be notified when the switch

00:23:46   is toggled to go change the value to

00:23:48   assign it the value when it's loaded or

00:23:50   when the value changes moving all of

00:23:52   that into a custom subclass of UI switch

00:23:55   or whatever the control is and having

00:23:57   the control manage itself and that takes

00:23:59   tons of code out of the view controllers

00:24:03   and makes way more reusable components

00:24:05   way easier if you're in testing it's way

00:24:07   easier to test these things also and it

00:24:09   really eliminates tons of potential

00:24:11   weirdness and bugs and edge cases like

00:24:14   one of the screens that I just made

00:24:16   uses a table view that has a couple of

00:24:18   switches and buttons in it in the old

00:24:20   way of me doing these things I'd either

00:24:22   not monitor for underlying changes like

00:24:24   if a change gets synced over that that

00:24:25   would change one of those switches or

00:24:26   buttons or

00:24:27   I'd monitor from the viewcontroller and

00:24:29   if any of those values change I just

00:24:31   call table view reload ruler data and

00:24:33   just reload the entire table and that

00:24:35   sucks like if you can avoid doing that

00:24:37   you should and I don't need to reload a

00:24:40   whole table to change the value of one

00:24:41   switch that there were like the

00:24:43   underlying data to happen to change it

00:24:44   during during that views presence on

00:24:46   screen I can just subclass that switch

00:24:48   and just have like rather than having

00:24:50   like you know a whole bunch of playing

00:24:52   UI switches in the table view the one

00:24:53   that has the rotation setting that's now

00:24:56   an OC rotation switch and now I can in

00:24:58   my table view when I'm making the cell I

00:25:00   can just say accessory view equals OC

00:25:03   rotation switch and the switch itself in

00:25:05   its code man it watches the value it

00:25:09   adds itself as a target and has its own

00:25:11   target implementation of like here's how

00:25:14   I'm going to change this value now and

00:25:15   you know and this is basically making

00:25:17   these components self-contained and

00:25:19   where this really shines not only

00:25:21   cleaning up your view controllers and

00:25:23   code reuse and testability and

00:25:24   everything else where this really is

00:25:26   awesome is another bad word that I I

00:25:29   didn't use for a long time interface

00:25:32   builder I recently started using

00:25:34   interface builder to design some of my

00:25:36   main screens as well as I started using

00:25:39   IB designing and this is this is a thing

00:25:43   where you can in a couple of methods and

00:25:44   put a couple annotations on your file

00:25:46   just look up IB design a ball you can

00:25:48   basically make custom controls appear

00:25:50   correctly interface builder so if you if

00:25:53   you need to draw draw things custom on

00:25:55   on a button or style in a certain way or

00:25:57   whatever else you can do all that and

00:25:59   have that show up interface builder

00:26:00   rather than just having a big empty

00:26:01   white view or like a none store

00:26:04   something like that using that basically

00:26:07   I'm trying to get as much as much code

00:26:09   as possible out of view controllers

00:26:10   because again it's that's kind of like a

00:26:11   bad technical debt bug potential kind of

00:26:14   written area so just try to make smaller

00:26:16   view controllers and a big thing a big

00:26:18   thing with that is using interface

00:26:19   builder as much as possible and

00:26:21   interface builder is not like a panacea

00:26:23   but if you if you do my my approach of

00:26:26   like having self-contained components

00:26:27   that manage themselves and if you take

00:26:30   advantage of things like I'd be

00:26:31   desirable a lot of things become easier

00:26:33   for instance portrait and landscape

00:26:35   differences with Auto layout oh again

00:26:37   I'm also using auto layout now interface

00:26:38   builder

00:26:39   that had really I know yeah that's like

00:26:42   I thought I'd never do that but I one

00:26:45   day I just kind of plaid to them like

00:26:46   you know I mean I'm gonna learn how to

00:26:47   do it and then I can decide whether I

00:26:48   really need to use it or not and it

00:26:50   turns out yeah it's not it's not easier

00:26:52   intuitive but neither is anything else

00:26:55   about interface builder and and once you

00:26:57   figure out oh you have to like right

00:26:59   drag from itself to itself like weird

00:27:01   well these all the little weird things

00:27:03   you have to do to make interface builder

00:27:04   work correctly there most of us are

00:27:07   totally undiscoverable once you figure

00:27:09   those out Auto layout Internet face

00:27:11   builder really isn't that bad it's not

00:27:13   easy but it actually can be more

00:27:17   productive in some case depending what

00:27:18   you're doing it's what you know basic

00:27:20   things like if you're gonna have a

00:27:21   difference between a portrait and

00:27:22   landscape layout it makes us so much

00:27:24   easier to it in fact my one wish for it

00:27:26   is that I wish that the size classes

00:27:30   were more granular more like CSS like I

00:27:33   would love to be able to say if the you

00:27:35   know if the width of this view is less

00:27:37   than 300 points then change this

00:27:40   condition rather than just being like if

00:27:42   this is horizontal or vertical compact

00:27:44   you know the the size classes that we

00:27:45   have now are very coarse and I would

00:27:48   like things to be more powerful more

00:27:50   like what CSS does with like media

00:27:52   queries and stuff but other than that I

00:27:54   I have had fantastic luck in in my

00:27:57   recent redesign and and cleanup of this

00:28:00   code basically using stuff that's new to

00:28:02   me that is not new to anybody else in

00:28:05   iOS development I'm still not using

00:28:07   storyboards but not going crazy no no I

00:28:10   I mean that's that would be crazy but I

00:28:13   have found it really like these things

00:28:15   make so many things easier like like the

00:28:17   like as I mentioned where they're

00:28:19   self-contained buttons and things that

00:28:20   makes it easier implement custom themes

00:28:22   because I have all the controls that

00:28:23   have a theme Abul property I have them

00:28:26   monitor for appearance changes in my

00:28:29   appearance manager class and then they

00:28:30   can just redraw themselves makes it

00:28:32   easier to support dynamic text that way

00:28:34   also because I had a little trick in my

00:28:36   app where my my appearance did change

00:28:39   notification I just mapped it to the

00:28:41   system's

00:28:42   text category size did change

00:28:44   notification so basically all my

00:28:46   handling like if you if if you switch

00:28:49   into into or out of dark mode and

00:28:50   overcast or if you go and change system

00:28:52   font size and

00:28:53   so all my labels can redraw themselves

00:28:56   everything can resize itself I can do

00:28:58   this without this kind of technique and

00:29:00   without any ologies I for many years I

00:29:02   have but it just makes it so much easier

00:29:04   and more reliable to do it this way and

00:29:05   it makes the code a lot more manageable

00:29:07   and and it does make it easier to take

00:29:09   advantage of new technologies that Apple

00:29:11   introduced it's going forward and so

00:29:12   that's that's I think where most of the

00:29:13   value is here so you know I guess maybe

00:29:15   I'll uh probably try Swift pretty soon

00:29:17   but I don't maybe I don't go crazy there

00:29:20   either we'll see not yet just you know

00:29:22   one step at a time slowly slowly walk

00:29:25   down this road yeah exactly

00:29:27   all right well we're out of time this

00:29:28   week thank you very much everybody for

00:29:29   listening and we will talk to you next

00:29:31   week bye