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