Jekyll2022-01-20T22:35:47+00:00https://stephenmcmillan.github.io/feed.xmlStephen McMillanTweetsA Year with SwiftUI & 2 Production Apps2020-06-15T12:00:00+00:002020-06-15T12:00:00+00:00https://stephenmcmillan.github.io/a-year-with-swiftui-my-thoughts<p>It’s been a little over a year since Apple unveiled SwiftUI at WWDC 2019. The announcement was certainly unexpected and surprised many developers, myself included. In the weeks that followed the initial beta, things were changing extremely quickly as Apple fixed issues and responded to developer feedback. At times, parts of SwiftUI felt unusable.</p>
<p>However, after a year of iteration and having gone all in with SwiftUI in two of my personal apps, I thought it would be good to share my experience working with the evolving framework and reflect on some additions I’d like to see next week.</p>
<p><img src="../assets/images/fivek.jpeg" alt="Markdowm Image" /></p>
<figcaption class="caption">FiveK is available on Apple Watch.</figcaption>
<p>In the last year, I have built two personal projects using SwiftUI. FiveK is an independent Apple Watch app that helps users go from Couch to 5K without needing to take their phone out on their run. Another SwiftUI app that I created, PPL Exam Preparation, is an app for aspiring private pilots that utilises Mac Catalyst - the technology that allows apps developed for iPad to run on the Mac. These two apps are quite different in that one is developed solely with the limited screen real estate of the Apple Watch in mind whereas my other app scales up to run on the Mac. Working with SwiftUI on this range of devices has really allowed me to get to grips with what the framework has to offer.</p>
<h2 id="this-is-magic">This is Magic</h2>
<p>I am really excited about independent apps on Apple Watch and that’s why I created FiveK. After following the tutorials and building a simple Todo app, I decided to create what would later become ‘FiveK’ using SwiftUI. In the beginning it felt like magic. For so many reasons:</p>
<ol>
<li>
<p>Having never really experimented with something like React Native, I was blown away by <em>Live Previews</em>. Suddenly I was in a world where I could design an app and see my views re-draw in real time. This is a massive producitvity boost and eliminates the risk of getting distracted while your code is building. This distraction is something I experience a lot when working on a large, professional codebase.</p>
</li>
<li>
<p>Faster feedback started resulting in greater attention to detail. I’ll hold my hands up and admit that in UIKit, the slow feedback loop from changing a value to rebuilding sometimes resulted in me adopting a ‘that’ll do’ attitude. However I truly believe that the fast feedback loop in SwiftUI has made me pay a lot more attention to the little details such as spacing and shadows.</p>
</li>
<li>
<p>Creating more delightful animations is more accessible than ever. Over time I think we’re going to see this come through in the quality of apps on the App Store. When building both these apps, I put a lot more attention into small but delightful animations because SwiftUI made it so painless.</p>
</li>
<li>
<p>SwiftUI is intuitive and the syntax is easy to follow. Composing a complex view from small and understandable components is a breeze.</p>
</li>
</ol>
<p><img src="../assets/images/pplexam1.gif" alt="Markdowm Image" class="center-image" /></p>
<figcaption class="caption">A chart from PPL Exam Preparation.</figcaption>
<h2 id="okay-maybe-it-isnt-magic">Okay. Maybe it isn’t magic.</h2>
<p>I really could go on about all the parts of SwiftUI that I love but with all the greatness comes a lot of pain points. Obviously this is natural given that the framework is still in its infancy but I think it’s beneficial to share some of them and with that how I’d like to see them disappear this year.</p>
<ol>
<li>
<p>Common UI elements are still missing from the framework. Yes - there are ways to pull them in via UIKit but that kind of defeats the purpose. I have no doubt we’ll see a lot of these added this year at Dub Dub.</p>
</li>
<li>
<p>A lot of the tutorial / reference material that exists online is very basic so architecting something with SwiftUI can be a little bit of a guessing game which could be confusing for those folks new to developing on Apple platforms.</p>
</li>
<li>
<p>Error messages are often completely unrelated to what is actually wrong with your code. More often than not, I’ve found myself commenting out lines I’ve added to find where the actual error is in my SwiftUI code.</p>
</li>
</ol>
<p>When you notice the issues with SwiftUI, they are very frustrating. Unlike when you stumble across an issue in UIKit, which has existed for a long time and is thus well-documented online, when you stumble across a complicated problem in SwiftUI there is a not of lot of guidance on sites like Stack Overflow. On that note however, the issues are to be expected and this is natural given its infancy.</p>
<p>When the framework first dropped, a lot of developers were hesitant and held firm that Apple shouldn’t have released it in its initial state. I’d disagree with this. I think SwiftUI has always had a huge amount to offer and ultimately it was smart of Apple to release it early. Releasing early reduces the steepness of the learning curve and the longer lead time makes it easier for developers, especially larger companies, to transition to what is ultimately the future of development on Apple platforms. Can you imagine how daunting it would have felt if Apple dropped a fully fledged replacement for UIKit with all the bells and whistles of UIKit? 🤯</p>
<p>Overall, I love working in SwiftUI. It’s fast and allows me to quickly compose beautiful, interactive interfaces with ease. It’s going to be a huge win for developers and businesses.</p>
<p>Thanks for reading. Feel free to keep up with my SwiftUI journey on <a href="https://twitter.com/stevowevo77">Twitter</a>.</p>stephenmcmillanIt’s been a little over a year since Apple unveiled SwiftUI at WWDC 2019. The announcement was certainly unexpected and surprised many developers, myself included. In the weeks that followed the initial beta, things were changing extremely quickly as Apple fixed issues and responded to developer feedback. At times, parts of SwiftUI felt unusable.WWDC 2016 Student Scholarship Experience2016-07-11T12:00:00+00:002016-07-11T12:00:00+00:00https://stephenmcmillan.github.io/wwdc-2016-scholarship-experience<p><img src="../assets/images/wwdc_wall.jpeg" alt="Markdowm Image" class="bigger-image" /></p>
<blockquote>
<p>Like with anything in life you always have expectations. Expectations that are sometimes wildly exceeded by reality. This is exactly how I would describe the amazing time I had at WWDC 16.</p>
</blockquote>
<h2 id="journey">Journey</h2>
<p>The long trek to San Francisco began for me on Saturday morning when my Dad and I left for the airport at around 6am. Our flight to London wasn’t until 8am so we had plenty of time to drop off our bags and most importantly, eat! I haven’t traveled through London Heathrow before so I was not sure what to expect in regard to connections and terminal transfer, but I’m pleased to say it was a smooth experience and in no time we were San Francisco bound!</p>
<p><img src="../assets/images/wwdcplane_1.jpg" alt="Markdowm Image" /></p>
<figcaption class="caption">Leaving the beautiful British Weather...</figcaption>
<p>We touched down in SF at around 2pm after a pleasant and thankfully non-turbulent flight. Once we arrived at our hotel we had plenty of time to visit the Golden Gate Bridge. Getting there was easy… However getting back proved a challenge as my Dad and I struggled to understand the bizarre bus timetables of San Francisco.</p>
<h2 id="scholarship-orientation">Scholarship Orientation</h2>
<p>On Sunday, before the Keynote, Apple invited all the scholarship recipients to attend an event at the Mission Bay Conference Center. We all queued for our badges before grabbing lunch and heading into watch a presentation. This consisted of inspiring and insightful talks from Apple engineers and executives like Esther Hare and John Geleynse. After this talk and as we left, in true Apple fashion employees high-fived us which was pretty funny! Whilst outside getting group photos, the man of the hour showed up as rumored for selfies with scholarship winners and I’m not kidding when I say Tim Cook was mobbed… Not convinced that throwing myself into the ocean of photo-hungry scholars was the best idea, I held back and still managed a ‘partial’ selfie.</p>
<p>Overall the orientation was a really exciting part of the week. The folks at Apple certainly didn’t disappoint with the amount of advice they gave us which spanned from points for building great apps to ‘drink water’.</p>
<h2 id="the-great-freeze-akakeynote">The Great Freeze A.K.A Keynote</h2>
<p><img src="../assets/images/wwdc_2.jpg" alt="Markdowm Image" />
It wasn’t long after heading to bed following the Orientation that my alarm was beeping at 1am to queue for the big day. When I got to the line at 2am I was blown away by how little people were queuing… It looked like everyone else took the better deal and stayed in bed. Nonetheless, I met up with some vaguely familiar faces who later became great friends and the wait began… Whilst it felt weird sitting on the road outside the Bill Graham Civic Auditorium at 2am in the freezing cold in a country I’d only been in for 2 days, I embraced it. Unsurprisingly I started to get cold quickly though but being from Northern Ireland, I came prepared with extra layers! Time seemed to be passing by relatively quickly until 7am when we all thought things would start happening and people would start entering the building. Oh, how wrong we were! As people began to sneak forward and squeeze together we faced a long stand for what felt like hours and hours…</p>
<p><img src="../assets/images/wwdc_3.jpg" alt="Markdowm Image" class="bigger-image" /></p>
<figcaption class="caption">Queuing at the Bill Graham Civic Auditorium.</figcaption>
<p>In the end queuing so early wasn’t necessary as Apple representatives provided scholarship winners with wristbands and they took us in to get seats at the front right.</p>
<p>The Keynote itself was great as usual and being there in real life compared to watching on the live stream felt so amazing! I’ll not talk about my favourite announcements because there was so much awesome stuff and as usual the product videos were 10/10. Shout out to the Woman at the end in the purple top -your comment was so relatable! :D</p>
<p><img src="../assets/images/wwdc_4.jpg" alt="Markdowm Image" /></p>
<figcaption class="caption">Apple Design Awards.</figcaption>
<p>After a long lunch, I got my seat for the Platform State of the Union. My seat this time was right in the middle, so i had a much less distorted view of the screen compared to sitting right at the edge. PSOTU was followed by the Apple Design Awards which was the most motivational part of the day for me. Even though the whole day, and any Apple event for that matter always inspires me to better myself, the Apple Design Awards were especially motivating. Hearing what apps Apple loves and what parts of those apps Apple loves informed me as to what is important for a great app - Most notably, Accessibility; which I’ve neglected in many of my apps. Not for much longer though!</p>
<h2 id="sessions-labs-and-odwalla-goodness">Sessions, Labs and Odwalla goodness.</h2>
<p>Tuesday marked the start of sessions and labs - where you could absorb all the new Apple technology goodness. Throughout the week I attended numerous sessions on topics which I cared about like Swift, SpriteKit and creating content for the new Swift Playgrounds app. Deciding which lab to attend however was a little tricky because I didn’t have any questions. This being the case I spent the Tuesday night prepping some code and questions for the labs.</p>
<p>With my ‘code and questions’ I spoke with engineers at the SpriteKit lab about making changes to Pixel Plane. One engineer in general gave me great advice for optimizing my code and also provided me with tips on implementing a change to the controls of my game. In addition to that, Swift Open Hours was a great lab where I spoke with a really nice guy about some more advanced Swift concepts that I didn’t quite understand. This guy was awesome, and in no time at all I had the ‘Ahhhh’ moment. The same engineer was really flexible at answering some of my other questions, which were way of topic, about making a Framework and testing.</p>
<p>The variety of get-togethers were another interesting part of my conference experience. These were like mini-meetups on a particular topic or issue. Here i spoke with such a variety of people - From a women who worked for a company which taught teachers to code, to a hardware engineer at Apple. Particularly it was interesting hearing his thoughts on how hardware and software compliment each other.</p>
<p>On the third floor we (scholarship winners) had access to the scholarship lounge - this was a great place to relax and meet other scholarship winners in between sessions and labs. Towards the end of the week I tried to stay out of here and instead hang around labs and talk to people! Whilst on the topic of networking, I wasn’t great at the start of the week but later in the week, like I said I just began talking with people who worked for Apple and asking them what they did. They were happy to chat and many congratulated me on my scholarship. Not everyone was an engineer either which was awesome! I spoke in detail with a woman who researches how people get into Swift and how they learn it - She was really interested in how I got into and learnt Swift. Those who were engineers worked on things including AppKit, CoreMotion, CoreLocation and SpriteKit.</p>
<p>Other highlights of my week conferencing include the free Odwalla smoothies and selection of snacks throughout the day. Developers are so spoiled with free food and drinks (❤ you Odwalla) - that’ll do me! Just don’t ask a WWDC attendee about the lunches, it’ll give them nightmares!</p>
<h2 id="reflection">Reflection</h2>
<p>From the scholarship orientation on Day 1, WWDC completely altered my view on making apps and why we as developers make apps. Sometimes your judgement can become clouded by financial concerns, statistics and deadlines. I know mine did. However at WWDC I realized that focusing on making something that enriches and delights is the key to success. I’ve been inspired more than ever before from seeing the incredible apps other scholarship winners are working on to seeing how talented engineers at Apple are! Just a few weeks on with, I’ve learnt more in the time I’ve been home from WWDC through watching talks on Swift to reading blog posts than I did in all the time prior to WWDC; all because I’m more motivated than ever. Not only that but I made some great friends who I hope to work with on projects in the future!</p>
<h2 id="advice">Advice</h2>
<p>To conclude, having been to WWDC the two most important pieces of advice I’d give to future attendees and hopefully my future self if I’m successful next year are as follows…
Stop for a moment and let it sink in that you’re in San Francisco with some of the most talented people on the planet. I tweeted a little while ago how it feels so surreal now that I was there and I think that’s just because it was such a busy week and I was running on coffee and smoothies.</p>
<p>If you don’t have lab questions just walk up and talk to someone from Apple that’s hanging around. As long as they’re not busy of course! All the Apple people were really interested in what I had to say and were happy to talk about their role. Without doing this i wouldn’t have some of the inside contacts I have now! It seemed daunting to me at first but they’re cool people!</p>
<p>I hope this post was interesting. Whilst i did write it to share my experience with others, i also wrote it so I can remember my first Dub Dub in the years to come! It’s honestly a life changing experience and if you’re considering applying, go for it and make sure you submit in good time! Don’t leave it to the last minute or you might be disappointed. Also, if you aren’t successful one year or something else is preventing you from going - keep trying! I was awarded a scholarship in 2015 but couldn’t make it because of exams.</p>
<blockquote>
<p>Being at WWDC as a scholarship recipient is an eye-opening, motivating and exciting experience. I loved every minute of it.</p>
</blockquote>
<p><img src="../assets/images/wwdc_5.jpg" alt="Markdowm Image" /></p>
<figcaption class="caption">Until next time San Francisco. ❤️</figcaption>stephenmcmillanLike with anything in life you always have expectations. Expectations that are sometimes wildly exceeded by reality. This is exactly how I would describe the amazing time I had at WWDC 16.