0:00:00welcome to under the radar a show about
0:00:02independent iOS app development I'm
0:00:04Marco Arment and I'm David Smith under
0:00:06the radar is never longer than 30
0:00:07minutes so let's get started today we
0:00:10want to talk about a topic that is near
0:00:12and dear to me it is coming late to
0:00:14things being late bloomers to new
0:00:16technologies and new techniques or new
0:00:17abilities things like interface builder
0:00:20use things like you know if you
0:00:22controller containment you know they
0:00:23basically things that that I either
0:00:26didn't do early on or that I minimally
0:00:28used early on or just never even gave a
0:00:31shot and and that I later and more
0:00:33recently have come to come to realize oh
0:00:35this is actually useful or even maybe
0:00:39now it's useful you know maybe it wasn't
0:00:41that useful in 1.0 but maybe now it has
0:00:43become more useful over time as Apple
0:00:45has made these things better this
0:00:47happens to me all the time my default
0:00:50reaction to new technologies coming
0:00:52coming by is I probably don't need that
0:00:55because much of the time that's true but
0:00:58but that that attitude makes it hard to
0:01:00find those times when it's not true and
0:01:02it often makes me come late to things
0:01:04now the benefit of coming late to things
0:01:05any of the issues that 1.0 brought those
0:01:08have probably been worked out or you
0:01:10will have heard from a bunch of people
0:01:11like this this technology or this thing
0:01:13is not worth using but the ones that are
0:01:15worth using by the time you come late to
0:01:17them yeah you've missed some time of
0:01:19potential improvements and efficiencies
0:01:21and everything but when you get there
0:01:23it's really awesome and easy to use and
0:01:25the tools are better and everything's
0:01:27more stable
0:01:27so it isn't all bad being being a
0:01:30conservative curmudgeon like I am about
0:01:32new technologies are you that way at all
0:01:34yes so I I'm a very strange person in
0:01:37terms of I have like these two different
0:01:40mindsets when it comes to like new
0:01:41technology so you know wEDC
0:01:43Apple announces here's the whole new set
0:01:46of stuff that are nowadays now available
0:01:48for Apple developers and I get really
0:01:51excited and look into and very often
0:01:55start using like totally new
0:01:57technologies you know things that
0:01:59weren't possible before that are now
0:02:01possible and I'll be one of the first
0:02:03people in the world to run down that and
0:02:04try and use it and see we're all it's
0:02:06often it's you know kind of whore half
0:02:08broken and the beta period is really
0:02:09tricky but I like that part of the
0:02:11development cycle and enjoy it
0:02:14whenever Apple introduces something that
0:02:15is a a replacement or extension to
0:02:19something existing you know and so this
0:02:21is a pattern that I think Apple I've
0:02:23seen Apple do many times you know I
0:02:25started developing on iPhone OS 2.2 I
0:02:29think was the first OS version that I
0:02:31was building against Wow it was just way
0:02:32back in the day and you see what it took
0:02:35to build something then and now so much
0:02:39of the stuff that we would write custom
0:02:41you know custom frameworks for or have
0:02:44to do ourselves is now just like built
0:02:45into the system they're all these things
0:02:48that you know a problem that we had to
0:02:51solve manually or directly before and
0:02:53then Apple comes along and says you know
0:02:54enough people are doing this that we
0:02:57should probably create a system method
0:02:58for doing this that'll be more stable
0:03:00and almost certainly more better
0:03:04resilient against iOS changes you know
0:03:06cuz I you know like when iOS 9 goes to
0:03:09iOS 10 Apple's gonna make sure that you
0:03:12know collectionview still works
0:03:13correctly
0:03:14whereas if I've had my own custom
0:03:16collection view class suddenly I'm the
0:03:18one who has to go in and make all the
0:03:20changes to make sure that it works
0:03:21nicely on the new OS and so Apple is
0:03:23rightfully so extending and expanding
0:03:26the universe of things that we can do
0:03:28but I always struggle with the feeling
0:03:30of if I have an existing solution for
0:03:33something that kind of works and that
0:03:36I'm familiar with is a really a hard
0:03:38sell to kind of tear down everything
0:03:41that I built and then replace it with
0:03:42apples thing and especially like you
0:03:45said early on because in that early
0:03:48phase is when there's the most bugs and
0:03:51then you can have the really bad feeling
0:03:52of like regret where it's like oh I
0:03:54should just go back to doing it the way
0:03:55that I used to do it because I knew that
0:03:57I knew at least I knew where all the
0:03:58problems were if there was a bug I could
0:04:00fix it and that was the you know a
0:04:02mindset that's a very easy trap to get
0:04:04into but on the flip side I definitely
0:04:06look at some of these things and I
0:04:08wonder if I'm missing out and history
0:04:13maybe has shown them some ways I'm
0:04:14missing out in some ways I'm not you
0:04:15know obviously the best thing is when
0:04:16you see a technology fly by you don't
0:04:19embrace it and then it ends up dying
0:04:21you know like iCloud core data sync for
0:04:24example like as a technology that when
0:04:26it came out I was like
0:04:27that is interesting like I use core data
0:04:29and I sync data to a server I wonder if
0:04:33this would be cool and I kind of poked
0:04:35my veena poked around a little bit but
0:04:36never really went down their road
0:04:38because I had an existing infrastructure
0:04:39because it turns out that was a great
0:04:41situation right I think that was you
0:04:44know officially killed this last summer
0:04:46and if I had gone all gone all you know
0:04:48all in on that I would have been in a
0:04:50world of hurt but on the flip side here
0:04:52if I had seen cloud kit when it came out
0:04:54and went in on that that's the vastness
0:04:58a technology that seems to be ascendant
0:05:00that seems to be on its way up and so at
0:05:03this point this part it's like huh maybe
0:05:05I should be using that maybe that would
0:05:07be a wise thing for me to be using and
0:05:10having the benefit of time makes that
0:05:12choice a lot easier I think and so you
0:05:14there is certainly a benefit to if a
0:05:16technology is being replaced and/or
0:05:20improved upon that I think you can be
0:05:22more conservative than if it's something
0:05:24totally new
0:05:25you know then just go for it and try it
0:05:27and you know if it doesn't work well
0:05:29yeah what have you lost but that having
0:05:33being a bit more conservative when it's
0:05:35something that is just an extension for
0:05:37me in any way feels like the right
0:05:38approach it also it helps to you know as
0:05:41you mentioned like catching things when
0:05:42they're when they're ascendant that
0:05:44really helps with keeping up with Apple
0:05:48basically keeping up with the new
0:05:49devices that launch new OS capabilities
0:05:52Apple makes it easy on you if you kind
0:05:55of follow their guidelines if you if you
0:05:58kind of like take like the tracks they
0:05:59lay out for you like they pave out a way
0:06:02that they want you to do things whether
0:06:04it's the language choice in this case
0:06:05they do now its Swift whether it's
0:06:07things like using interface builder
0:06:09using storyboards you know using
0:06:11adaptive layouts like all these things
0:06:13like Apple makes things easy to do
0:06:16things their way and then generally
0:06:19speaking if you do things their way you
0:06:22will have less friction or things will
0:06:24be easier for you in the near future as
0:06:26they introduce new technologies new
0:06:28devices things like that and and you
0:06:30don't have to do things their way but if
0:06:32you don't you're generally setting
0:06:34yourself up for more work like for me
0:06:36one of the biggest things about that was
0:06:38was when they brought an adaptive
0:06:40for the iPad like that that changed a
0:06:43lot of things for a lot of people
0:06:44because like if you if you had first of
0:06:47all feel like a separate iPad app and an
0:06:48iPhone app that broke everything because
0:06:51all of a sudden Lee well now your iPad
0:06:53app kind of has a reason to have the
0:06:55entire iPhone app with it so that it can
0:06:56run in skinny mode on the sidebar and if
0:06:59you if you were doing things in a basic
0:07:01way with like a typical you know UI
0:07:03split view controller things like that
0:07:05like then things were easier for you but
0:07:08if you if you were you know away from
0:07:10the Apple way you had more work to do I
0:07:13think - it's an interesting point about
0:07:15how Apple tends to strongly sort of
0:07:18Telegraph where they're going yeah with
0:07:20their announcements that this has been a
0:07:22pattern that we've seen many times where
0:07:24Apple introduces a you know a they solve
0:07:29a problem or they make something easier
0:07:30that you know either you know end of
0:07:33that fall sometimes when it's yeah I
0:07:35remember when you know they first
0:07:37changed the size of the iPhone like that
0:07:39was the year that we got Auto layout if
0:07:41I remember right yep
0:07:42and like they do those kinds of moves
0:07:44where they can because obviously they
0:07:46know what their road map is for the next
0:07:48six months for the next year for the
0:07:50next two years and they can look forward
0:07:52to what that look what that's going to
0:07:54be and start preparing you know pairing
0:07:57the ground for what that's what's going
0:07:59to make development on that platform the
0:08:01best now and so there's definitely a
0:08:04wisdom in looking at what what in order
0:08:07these new technologies and extensions
0:08:08that they're adding to the to the
0:08:10frameworks that what is like asking
0:08:13yourself well what could this mean like
0:08:14they started adding the size classes and
0:08:17there's I always remember there was in
0:08:19the first size class WC session where
0:08:22there's like they have the quadrant of
0:08:23like the compact and wide and so they
0:08:27have like this one is this you know
0:08:29these devices fall in this category this
0:08:30these devices fall in this category
0:08:32these devices fall in this category and
0:08:33this to this category we don't actually
0:08:35have any devices that category yet and
0:08:38obviously like super visual you could
0:08:40say like huh you know that's just the
0:08:41way it fell out it's like no Apple is
0:08:43actually telling us that I think in that
0:08:45case it was the I believe it was the the
0:08:476 plus and landscape which which has I
0:08:50believe it has the the normal which is
0:08:52like iPad size or
0:08:54chantal class and the compact vertical
0:08:56class yeah exactly like those types of
0:08:59things like Apple is telling you
0:09:00something there and so being aware of it
0:09:02even if you're not going to adopt the
0:09:04new technology it's probably a good
0:09:05thing to be kind of suspicious when they
0:09:07start changing things to see like what
0:09:09could this mean down the road cuz
0:09:12they're not gonna waste their time just
0:09:13adding you know adding stuff for no
0:09:15reason
0:09:16yeah I mean one of the things for me
0:09:17that so to get into some specific
0:09:19examples here one of the things for me
0:09:21in this area was viewcontroller
0:09:23containment or have having child view
0:09:25controllers basically and implementing
0:09:27your own parent view controllers and you
0:09:29know for I think for most iOS developers
0:09:31you've seen you know kind of view
0:09:33controller bloat disease it is so easy
0:09:36to have tons of code in view controllers
0:09:39because that's kind of just where
0:09:40everything falls and I know there's
0:09:42different models there's like mvvm and
0:09:43stuff I haven't like gotten some any of
0:09:45those yet so I can't really speak to
0:09:46them but every iOS developer has seen
0:09:49the the massive view controller syndrome
0:09:50and one of the things that helps that a
0:09:52lot is by making child view controller
0:09:55so like you know like an overcast you
0:09:57know I'll have like different panels and
0:09:59everything and rather than having like
0:10:00on the nap playing screen they're like
0:10:01the effects panel rather than having
0:10:03that be part of the now playing view
0:10:05controller that is its own view
0:10:07controller that can be presented or
0:10:08stuck in various places you know just
0:10:10using the stock stuff using things like
0:10:12popovers and split views and navigation
0:10:14of course you know all these things page
0:10:15view controllers using all those things
0:10:17can get you very very far but one of the
0:10:19biggest things I've done recently I
0:10:20started making my own parent view
0:10:22controllers also now one of the things I
0:10:24did was I I have replaced UI split view
0:10:27controller with my own custom version of
0:10:29something that does fairly similar
0:10:31things but does them kind of more my way
0:10:33because when I when I was looking at
0:10:35overcast code I have spent so much time
0:10:37and there were so much like hacky weird
0:10:40like configuration and exception code
0:10:42things like in you know intercepting
0:10:44traitcollection changes and weird things
0:10:46like that all to get UI split view
0:10:49controller to do what I wanted the
0:10:51amount of code I have to just bend this
0:10:53existing component to my will is so much
0:10:56and so fragile and and so hacky I can
0:10:59actually make my own split view
0:11:01equivalent controller that just does
0:11:02things the way I want them to want the
0:11:03way I want it to with actually far less
0:11:06code like buy it by a mile
0:11:08because the built-in components they
0:11:10have all these limitations in place that
0:11:12you know Apple thinks they should be
0:11:13designed this way but the reason one of
0:11:15the reasons necessary is because like
0:11:16they have all these different options
0:11:18and how you can configure them if they
0:11:19have to work in all the different ways
0:11:20they have they can't make as many
0:11:21assumptions as you can
0:11:23they can't rule out certain options that
0:11:25you won't use so in their
0:11:26implementations they're never going to
0:11:28accommodate everything but at the same
0:11:29time they have to be like so complex to
0:11:31accommodate all the things they do
0:11:32manage to to encompass when you make one
0:11:35for yourself you can do anything you
0:11:38want and only what you want and that's
0:11:41incredibly powerful and you know writing
0:11:43everything yourself is not always the
0:11:44best solution that's not always a good
0:11:46use of time but in cases like this like
0:11:48I've been fighting with UI splitview
0:11:49controller and and various like adaptive
0:11:52layout things for over a year now and
0:11:54it's just like this I I don't need to do
0:11:56this like why am I doing this when I
0:11:57could just write and so I took one day
0:11:59like let me see if I can write my own in
0:12:00one day and sure enough of course it was
0:12:03it was easier than I ever imagined
0:12:04because the the you know if you control
0:12:06containment stuff is very much here and
0:12:07how it's it's been a wrap for a while I
0:12:09think was ins Iowa it's like five or six
0:12:11it's it's kind of old right six I think
0:12:13yeah yeah so it's been out for a while
0:12:16so all the stuff was very very easy to
0:12:18do I also made a custom UI page view
0:12:21controller it basically didn't I want to
0:12:23do some some custom gesture and view
0:12:26handling that it just was not capable of
0:12:27doing without tons of hacks so I just
0:12:29made my own and my the one I made is not
0:12:32as good as theirs for general purpose
0:12:34use but for my use it's way better and
0:12:36it really is not that much code and it
0:12:38it's more it's more of like basically
0:12:41removing times where you have to really
0:12:44hack with UI kit because you like it's
0:12:46so complex there's so much there that it
0:12:47has to do and so much of my of my time
0:12:50designing interfaces in the past has
0:12:51been fighting UI kit to just try to
0:12:54customize something the way I want it
0:12:56and over time it's become easier but
0:12:58there's still places where you have to
0:12:59do it especially like around new
0:13:01technologies like adaptive UI and stuff
0:13:03like that when those things kind of come
0:13:04out and so to to hit yourself out of the
0:13:07business of hacking UI kit is so freeing
0:13:10and so so good for your overall code
0:13:12health and technical debt I highly
0:13:14recommend it and one of the biggest ways
0:13:16is view controller that you basically
0:13:18use and view controllers properly and
0:13:19not trying to hack the existing ones if
0:13:21they don't fit your needs
0:13:22yeah but I think what you're speaking
0:13:24there is such the strange tension that
0:13:27when you are looking at these new
0:13:28technologies because the base building
0:13:30blocks in iOS are overall I would say
0:13:34really really good like the number of
0:13:37things that you can build was just a
0:13:38scrollview
0:13:39his immense like I mean I was one of my
0:13:41favorite talks wotc I don't know if they
0:13:44did one this last year because I
0:13:45previously had always been like what's
0:13:47new in UI scrollview mmm and they would
0:13:49build these really sophisticated
0:13:52interactions that were just a scrollview
0:13:54at the end of the day and but it's that
0:13:57strange tension where if you use a page
0:14:00controller like it's like you can get
0:14:02that first thing working really quickly
0:14:05but you very cool you'll start to run
0:14:09out of runway and it's a question I
0:14:11suppose of how much control you want to
0:14:14have and how much you want to be
0:14:15responsible for all the weird edge cases
0:14:17all the strange issues that are gonna
0:14:20happen I suppose either way if you use
0:14:22UI page controller like there's just
0:14:24gonna be there's gonna be some issues
0:14:26that you just can't work around and
0:14:27you're just like oh well like it just
0:14:29doesn't work the way I like it to in
0:14:30this particular situation so then you're
0:14:33like okay let me just build my own and
0:14:34now of course you're like the important
0:14:37thing I think maybe is to say is when
0:14:39you do that you are it's good to be sort
0:14:41of cognizant and keep your eyes open for
0:14:44what you're taking on when you do that
0:14:47because you know apples engineering
0:14:50teams are know like they're not they're
0:14:52no slouches like they are really good at
0:14:55what they're doing and it takes a lot of
0:14:56engineering work to build the UI
0:14:58pagecontroller for example like that's
0:15:00not just a simple thing they threw
0:15:02together in a day and so if you're gonna
0:15:05replace it you probably need to be aware
0:15:07that you're it's gonna be a lot more
0:15:08work than you think and there's gonna be
0:15:09weird edges and problems that you're
0:15:13gonna have to run into you like I
0:15:14remember this with activity plus plus
0:15:17where it has this kind of custom
0:15:20animation where you starts off with the
0:15:22Rings and if you tap it like the Rings
0:15:24unfurl and turn into the bar graph which
0:15:27is this kind of cool animation that I
0:15:29thought of and I was like oh I really
0:15:30want to build this and I started to see
0:15:33if I could build this with UI view
0:15:34animation
0:15:35because I would far prefer to do it with
0:15:37some kind of built-in mechanism and in
0:15:40the end I couldn't because just it was
0:15:43just too complicated of a thing to get
0:15:45performant and to get to look right and
0:15:47so I ended up just building it myself
0:15:48using like raw core graphics that I you
0:15:52know I do the animation of each frame of
0:15:54that animation and draw its you know
0:15:57just like I'm just essentially just
0:15:58drawing that to a bit a bitmap and
0:16:02displaying it each frame which is great
0:16:04it looks just how I want it but it means
0:16:06there's all kinds of weird issues and
0:16:09performance problems and compatibility
0:16:11things between different platforms that
0:16:13if I was just using UI view animation
0:16:16just wouldn't happen and so really the
0:16:19trade-off was worth it like I couldn't
0:16:20do it at the other way but I kind of
0:16:23wish that I was able to use do so do it
0:16:25the other way and I think that's
0:16:26something when I don't think of these
0:16:27new technologies that Apple puts out
0:16:28like there's this I definitely always
0:16:30have that tugging sense of aw man I wish
0:16:32I could just use whatever it is I wish I
0:16:34could just use auto layout I wish I
0:16:36could just use size classes but then as
0:16:39soon as I hit that edge I have such this
0:16:41tension it's just saying like oh I'll
0:16:42just throw my hands up and walk away
0:16:43which is perhaps a bit childish well but
0:16:46you know it's you have to always be
0:16:48defensive of your time like when you're
0:16:49when you're trying out something new or
0:16:51when you're thinking about rewriting a
0:16:52system component for your own use like
0:16:54it's very easy to fall into a time hole
0:16:56here and just burn tons of time doing
0:16:59something that actually isn't productive
0:17:00part of the the judgement of when to do
0:17:02that and when not to just comes with
0:17:04doing it wrong for a number of years and
0:17:06eventually gaining that wisdom and part
0:17:07of it is kind of just luck you know a
0:17:09lot of times you can't really tell
0:17:10what's gonna be a good use of your time
0:17:11upfront but you know that's the risk you
0:17:13take with new stuff all right a sponsor
0:17:15this week is Braintree go to Braintree
0:17:17payments comm slash radar by next year
0:17:21maybe even next week there could be a
0:17:22whole new way to pay for things maybe
0:17:25it'll be the next Bitcoin or the next
0:17:26Apple pay or maybe even both fortunately
0:17:29Braintree its full stack payment
0:17:31platform is easily adaptable to whatever
0:17:34the future holds so you can adapt easily
0:17:36to if you use Braintree in your apps you
0:17:38can accept everything from pounds to
0:17:40PayPal to whatever the next big
0:17:41innovation is from any device with just
0:17:44one integration and when that new
0:17:46payment method comes out all you have to
0:17:47do is update a few lines of
0:17:49no late nights no complicated recoding
0:17:52no stress about staying ahead of the
0:17:53curve
0:17:54Braintree is here to help you find out
0:17:56more at Braintree payments comm slash
0:17:59radar
0:17:59that's Braintree payments comm / radar
0:18:02thank you very much to Braintree for
0:18:04sponsoring our show one other thing that
0:18:06I was thinking about with this topic
0:18:07though is it's something that I wrote
0:18:10that I you run into if you are behind
0:18:12the times like I'm very often behind the
0:18:15way you know like Apple has this new
0:18:16technology this new approach that
0:18:18they're recommending and I'm late in
0:18:20adopting it the thing that I always
0:18:22noticed too is that you'll run into that
0:18:24can be really annoying is suddenly all
0:18:26the documentation all the example code
0:18:28all the things that you see on Stack
0:18:31Overflow suddenly don't work for you
0:18:34anymore thank you that you have to not
0:18:37only not only have you built your own
0:18:39approach like you were even if it's not
0:18:40like you're just going down the road
0:18:41it's like doing something custom like if
0:18:42you just have old code then suddenly you
0:18:45have this new thing that Apple has put
0:18:47out there pushing and that's where all
0:18:48their focus is going suddenly that's
0:18:50where all the documentation is written
0:18:51for and the you know the example code
0:18:52they publish will use that new thing and
0:18:54so there's not a lot of great examples
0:18:57and it becomes harder and harder and
0:18:58like the biggest example is probably
0:19:00Swift like I remember sort of you had
0:19:02there was this transition period where
0:19:03all of a sudden all the answers on Stack
0:19:06Overflow for you know questions I had
0:19:09about the new technologies we're all all
0:19:11the example code was just written in
0:19:12Swift or you know people like snippets
0:19:15and that can become really awkward and
0:19:18it's probably a good reason to try and
0:19:20adopt some of these things with some
0:19:23urgency just to not be sort of fall
0:19:25behind to a degree that you just can't
0:19:27work out what to do or perhaps moreover
0:19:30you're wasting time like I remember
0:19:32sitting there wasting time like trying
0:19:33to translate the swift code into
0:19:36objective-c and then trying to work out
0:19:39how to then take that concept and apply
0:19:41it into my own app but I have to do this
0:19:43like level of indirection whereas if it
0:19:45my app wasn't Swift like you like oh I
0:19:47see what they're doing there I can build
0:19:49it you know for myself now and that's
0:19:51something that I think it takes a lot of
0:19:52experience to realize that you're not
0:19:54just running into technical issues
0:19:57you're running into like educational and
0:19:59learning issues as
0:20:00well oh yeah but you know that's just
0:20:02kind of par for the course and it has
0:20:03thing to move on and new things come in
0:20:05you know it's kind of like part of the
0:20:07cost of sticking with old stuff is that
0:20:10everyone else moves on it seems you know
0:20:13and that that isn't actually no it isn't
0:20:14everyone that's how it seems like when
0:20:15you're searching for help or
0:20:16documentation or or looking for where
0:20:18Apple's attention is going like once the
0:20:20new thing comes out all those people
0:20:22move on to it and if you are lagging
0:20:24behind or you string the old thing
0:20:25that's just again it's just part of the
0:20:26cost of doing business you know oh sure
0:20:28but it's it's a weird feeling when
0:20:30you're like it's some ways I love that I
0:20:34have some you know I've apps on the App
0:20:36Store that have been have existed for
0:20:38years and never see this is a it's I
0:20:41took a very classic issue in software
0:20:42engineering of what are you dealing with
0:20:44legacy code that you have things that
0:20:46work they should go back to and I mean
0:20:49it's a crazy feeling when you go back
0:20:51and look at code and run blame and get
0:20:53and you see you know this was code was
0:20:55written back in 2009 or 2010 what was I
0:20:59doing like why did I have this strange
0:21:02exception and so often you run into this
0:21:05situation where like you were coding
0:21:07around an iOS bug in iOS 5 that you no
0:21:12longer need to code around and at some
0:21:14point like you have this weird cycle
0:21:16where you're coding around to prop a bug
0:21:18that then gets resolved and then your
0:21:21code your fix starts to actually be the
0:21:23bug and caused the problem because
0:21:25you're doing stuff that isn't is sort of
0:21:27counter to what the modern approaches
0:21:29and that's probably why it's so hard to
0:21:31be a UI could engineer yeah no I
0:21:34definitely don't envy the you know and
0:21:36envy that team where they do this really
0:21:39cool amazing work but like the number of
0:21:42day having at work across all the
0:21:43different devices and all the different
0:21:45things and having an iOS because that
0:21:48another thing that's kind of crazy is
0:21:49the way they approach with binary
0:21:50compatibility and like you can still run
0:21:53an iOS 4 app on iOS 10 like it'll
0:21:57probably be a little bit broken and
0:21:59janky but like they do a lot of work to
0:22:01keep things forward which is perhaps
0:22:03another year like I was saying earlier
0:22:05but another reason why being like I keep
0:22:09telling myself to be less of a
0:22:10curmudgeon about the new stuff because
0:22:12I'm probably wasting a lot of
0:22:14that you know Apple is paying engineers
0:22:17to do this work and then I'm just like
0:22:19walking past them and saying nope nope
0:22:21I'll do it myself I'll take care of this
0:22:23myself where that's probably an
0:22:25inefficient use of my time yeah all
0:22:28right so let me give a few examples of
0:22:30some of the more recent things that I
0:22:31have that I've been working with in the
0:22:33last few weeks doing overcast 3.0 in the
0:22:35last few versions I've made extensive
0:22:36use of kvo key-value observing and this
0:22:40has been helped tremendously by the
0:22:41Facebook the FB kvo controller it is a
0:22:44fantastic open source component I highly
0:22:46recommend that anybody using kvo or
0:22:48curious about kbo do it with the FB kvo
0:22:51controller don't do worth of raw calls
0:22:53because they're full of bug potential
0:22:55and the Facebook one boys a lot of that
0:22:56is very nice to use generally this is
0:22:59you know this is in very short terms a
0:23:01way to have some code notified whenever
0:23:04a certain value of a different object
0:23:07changes so this is kind of and I think
0:23:11this is what reactive cocoa is all about
0:23:12mostly it's like basically and please
0:23:15forgive me if that's wrong but basically
0:23:16like kind of having having views and
0:23:19controls basically update themselves
0:23:21based on values that changed and also
0:23:24similar to what OS tended with bindings
0:23:25which have never never made its iOS but
0:23:28honestly having used them very briefly
0:23:29and they're kind of cool I know people I
0:23:30know there's potential issues but they
0:23:32can't be pretty cool where I've been
0:23:35moving basically is moving rather than
0:23:38having like a view controller that has a
0:23:40stock UI switch and having the view
0:23:43controller manage the state of that UI
0:23:44switch and be notified when the switch
0:23:46is toggled to go change the value to
0:23:48assign it the value when it's loaded or
0:23:50when the value changes moving all of
0:23:52that into a custom subclass of UI switch
0:23:55or whatever the control is and having
0:23:57the control manage itself and that takes
0:23:59tons of code out of the view controllers
0:24:03and makes way more reusable components
0:24:05way easier if you're in testing it's way
0:24:07easier to test these things also and it
0:24:09really eliminates tons of potential
0:24:11weirdness and bugs and edge cases like
0:24:14one of the screens that I just made
0:24:16uses a table view that has a couple of
0:24:18switches and buttons in it in the old
0:24:20way of me doing these things I'd either
0:24:22not monitor for underlying changes like
0:24:24if a change gets synced over that that
0:24:25would change one of those switches or
0:24:26buttons or
0:24:27I'd monitor from the viewcontroller and
0:24:29if any of those values change I just
0:24:31call table view reload ruler data and
0:24:33just reload the entire table and that
0:24:35sucks like if you can avoid doing that
0:24:37you should and I don't need to reload a
0:24:40whole table to change the value of one
0:24:41switch that there were like the
0:24:43underlying data to happen to change it
0:24:44during during that views presence on
0:24:46screen I can just subclass that switch
0:24:48and just have like rather than having
0:24:50like you know a whole bunch of playing
0:24:52UI switches in the table view the one
0:24:53that has the rotation setting that's now
0:24:56an OC rotation switch and now I can in
0:24:58my table view when I'm making the cell I
0:25:00can just say accessory view equals OC
0:25:03rotation switch and the switch itself in
0:25:05its code man it watches the value it
0:25:09adds itself as a target and has its own
0:25:11target implementation of like here's how
0:25:14I'm going to change this value now and
0:25:15you know and this is basically making
0:25:17these components self-contained and
0:25:19where this really shines not only
0:25:21cleaning up your view controllers and
0:25:23code reuse and testability and
0:25:24everything else where this really is
0:25:26awesome is another bad word that I I
0:25:29didn't use for a long time interface
0:25:32builder I recently started using
0:25:34interface builder to design some of my
0:25:36main screens as well as I started using
0:25:39IB designing and this is this is a thing
0:25:43where you can in a couple of methods and
0:25:44put a couple annotations on your file
0:25:46just look up IB design a ball you can
0:25:48basically make custom controls appear
0:25:50correctly interface builder so if you if
0:25:53you need to draw draw things custom on
0:25:55on a button or style in a certain way or
0:25:57whatever else you can do all that and
0:25:59have that show up interface builder
0:26:00rather than just having a big empty
0:26:01white view or like a none store
0:26:04something like that using that basically
0:26:07I'm trying to get as much as much code
0:26:09as possible out of view controllers
0:26:10because again it's that's kind of like a
0:26:11bad technical debt bug potential kind of
0:26:14written area so just try to make smaller
0:26:16view controllers and a big thing a big
0:26:18thing with that is using interface
0:26:19builder as much as possible and
0:26:21interface builder is not like a panacea
0:26:23but if you if you do my my approach of
0:26:26like having self-contained components
0:26:27that manage themselves and if you take
0:26:30advantage of things like I'd be
0:26:31desirable a lot of things become easier
0:26:33for instance portrait and landscape
0:26:35differences with Auto layout oh again
0:26:37I'm also using auto layout now interface
0:26:38builder
0:26:39that had really I know yeah that's like
0:26:42I thought I'd never do that but I one
0:26:45day I just kind of plaid to them like
0:26:46you know I mean I'm gonna learn how to
0:26:47do it and then I can decide whether I
0:26:48really need to use it or not and it
0:26:50turns out yeah it's not it's not easier
0:26:52intuitive but neither is anything else
0:26:55about interface builder and and once you
0:26:57figure out oh you have to like right
0:26:59drag from itself to itself like weird
0:27:01well these all the little weird things
0:27:03you have to do to make interface builder
0:27:04work correctly there most of us are
0:27:07totally undiscoverable once you figure
0:27:09those out Auto layout Internet face
0:27:11builder really isn't that bad it's not
0:27:13easy but it actually can be more
0:27:17productive in some case depending what
0:27:18you're doing it's what you know basic
0:27:20things like if you're gonna have a
0:27:21difference between a portrait and
0:27:22landscape layout it makes us so much
0:27:24easier to it in fact my one wish for it
0:27:26is that I wish that the size classes
0:27:30were more granular more like CSS like I
0:27:33would love to be able to say if the you
0:27:35know if the width of this view is less
0:27:37than 300 points then change this
0:27:40condition rather than just being like if
0:27:42this is horizontal or vertical compact
0:27:44you know the the size classes that we
0:27:45have now are very coarse and I would
0:27:48like things to be more powerful more
0:27:50like what CSS does with like media
0:27:52queries and stuff but other than that I
0:27:54I have had fantastic luck in in my
0:27:57recent redesign and and cleanup of this
0:28:00code basically using stuff that's new to
0:28:02me that is not new to anybody else in
0:28:05iOS development I'm still not using
0:28:07storyboards but not going crazy no no I
0:28:10I mean that's that would be crazy but I
0:28:13have found it really like these things
0:28:15make so many things easier like like the
0:28:17like as I mentioned where they're
0:28:19self-contained buttons and things that
0:28:20makes it easier implement custom themes
0:28:22because I have all the controls that
0:28:23have a theme Abul property I have them
0:28:26monitor for appearance changes in my
0:28:29appearance manager class and then they
0:28:30can just redraw themselves makes it
0:28:32easier to support dynamic text that way
0:28:34also because I had a little trick in my
0:28:36app where my my appearance did change
0:28:39notification I just mapped it to the
0:28:41system's
0:28:42text category size did change
0:28:44notification so basically all my
0:28:46handling like if you if if you switch
0:28:49into into or out of dark mode and
0:28:50overcast or if you go and change system
0:28:52font size and
0:28:53so all my labels can redraw themselves
0:28:56everything can resize itself I can do
0:28:58this without this kind of technique and
0:29:00without any ologies I for many years I
0:29:02have but it just makes it so much easier
0:29:04and more reliable to do it this way and
0:29:05it makes the code a lot more manageable
0:29:07and and it does make it easier to take
0:29:09advantage of new technologies that Apple
0:29:11introduced it's going forward and so
0:29:12that's that's I think where most of the
0:29:13value is here so you know I guess maybe
0:29:15I'll uh probably try Swift pretty soon
0:29:17but I don't maybe I don't go crazy there
0:29:20either we'll see not yet just you know
0:29:22one step at a time slowly slowly walk
0:29:25down this road yeah exactly
0:29:27all right well we're out of time this
0:29:28week thank you very much everybody for
0:29:29listening and we will talk to you next
0:29:31week bye