Categories
Community

From Interpreted Basic to Swift UI – Part 2

This is the second part of the exciting story of our community member, Deborah Graham. Deborah attended Apple’s WWDC and decided to put her learnings from that experience into immediate action.

Developer Nation Community Stories

Part 2

Check out Deborah’s story as it started out here

Week of WWDC 2022 

Monday – Mapping down the journey

Apple’s WorldWide Developers Conference (WWDC) for 2022 kicked off with the Keynote (1 hour and 48 minutes) where I sat and enjoyed the presentation and did not take any notes. The Platforms State of the Union sessions (1 hour 10 minutes) was next, after an hour for lunch on the West Coast. This also is a session I watch and do not take notes. They also had the Apple Design Awards (18 minutes) and a Day 1 recap (3 minutes).

During the week, I looked over the list of sessions available each day and jotted down the ones that I was most interested in, listed by the days the videos would be available. I figured I would start with those and potentially watch others based on what I learned from the first set and how much energy I had left from the day.

Tuesday – The Swift Cookbook of Navigation 

On June 7, I was ambitiously planning on watching the following sessions, once they because available that day:

  • Build Your First App in Swift Playgrounds
  • Dive into App Intents
  • Get to Know Developer Mode
  • Implement App Shortcuts with App Intents
  • The SwiftUI Cookbook for Navigation
  • What’s New in SwiftUI

I opened a Word document and copied the transcript of each session and any code that was attached and pasted it into the document. I figured it might come in handy to look for terms, ideas, or code snippets someday. 

The first session, Build Your First App in Swift Playgrounds, was interesting, and I do not have a lot of hand-written notes about it, as it did not directly apply to my goal, to learn how to use SwiftUI to update my way-out-of-date-app. 

The second one, Dive into App Intents sounded promising and yet…it was about how to make it easier for a user to RUN your app, not how to describe what I intended it to do for me. I took lots of notes from Implement App Shortcuts with App Intents because I was determined to make them work for me somehow. 

Now, the SwiftUI Cookbook for Navigation was exactly what I needed. It talked about three-column navigation split view, and showed Recipe Categories, Recipe List, and Recipe Detail. This would work fine for me. I need to implement this! Yippee! I found what I came for! 

Now, I just needed to dig deeper and find out how to implement what they were cooking up! It talked about new container types: NavigationStack and NavigationSplitView. 

I did not watch the last session I had planned for Monday. I saved that for Tuesday morning, as the new sessions were not available when I get up early (I live on the East Coast of the United States and Apple and their timeline is based on their West Coast location) and I wanted to have something to do so I wasn’t tempted to log into my full-time job and check on some things. This was my “vacation” week after all. 

Wednesday- Design App Shortcuts & Privacy Nutrition Label

On June 8, I added to the one left-over session with the following choices:

  • Create Your Privacy Nutrition Label
  • Design App Shortcuts

Swift UI & Swift Charts 

I started with What’s New in Swift UI from Monday’s list. It was a list of sessions that talk about the details of new items in SwiftUI, such as The SwiftUI Cookbook for Navigation, which was the last session I watched the previous day, so I congratulated myself on that choice. 

The session also mentioned Swift Charts, and this was not of interest to me because I had no immediate plans to add charts to my app. It then talked about sharing, and since this is broken in my app currently, it peaked my interest until they talked about Mail, Messages, Air Drop, Notes, Add to Photos etc and  not  Facebook or Twitter, that are not not considered sharing now. The session ended with a peek at layout and how a mixed layout can be achieved with Grid, GridRow and GridColumn. 

Create your Privacy Nutrition Label

Next up was Create Your Privacy Nutrition Label. I went into this thinking there was an actual label that would need to be filled out to submit an app to the store. The areas are Data Used to Track You, Data Linked to You, Data Not Linked to You, and Data Not Collected. If the developer selects the last one, the label reads, “This developer does not collect any data from this app” and that applies to my app. So, that was all I really needed from this session.

Thursday – What’s new in Xcode

On June 9, I added just two more to my original list:

  • What’s New in AppStore Connect
  • Writing for Interfaces

I still have not watched either of those sessions. I started the day with What’s New in Xcode which gave me a list of other sessions to take a look at when I have time. Some new code was introduced and hints and tricks were shared to make coding faster by using code completion and using simple icons in a single size instead of needing all the sizes for all the different versions of pixel count now available. 

The new sessions I added to the watch list are:

  • Use XCode to Build a Multiplatform App
  • Meet Swift Package Plans
  • Create Swift Package Plugins
  • Building Global Apps: Localization by Example

Localization do or don’t?

I decided to watch the last one on that list first, Building Global Apps: Localization by Example. This sounded promising, and I was interested in how well the translation would work for my app. I thought it was  too much AI and not enough about how you will need to hire translators who would take the text you send them and return it in different languages, which you reference in code to use the localized version of the text. 

My small little app is not going to be translated. Not for this next version. 

Custom Layouts and Swift Playground 

Next, I watched the session Compose Custom Layouts with SwiftUI and learned about grids and geometry reader and the layout engine. It was way over my head, and not really relevant to what I was hoping I needed to do. I thought  starting in Swift Playgrounds is where I should turn my attention. I watched Create Engaging Content for Swift Playground only to find out that this was not relevant either since it was about how to write an app for learners.It was interesting though!

Friday  – Having a Design Lab appointment 

I had signed up for a Design Lab appointment so someone from the Apple Design department would take a look at my app currently available and make suggestions on how to improve it and bring it up-to-date. I took lots of notes on what he found when he used the app, and I have a few things to think about when re-designing the app that I hope to incorporate into the final product. Then, as I was looking around for sessions to watch, I noticed that my all-time favorite SwiftUI online instructor, Paul Hudson (@twostraws) had recorded a session at Apple Headquarters in their new developer lab podcast space so I just had to watch it. It was What’s New in SwiftUI for iOS16 and this is the session I took the most notes from and, as usual, after watching his session, I wanted to jump right in and start coding. 

Well, WWDC is over for the year. There are still sessions I would like to watch…you know, that magical time we all have called “someday”. It is time to get the app updated and into the app store before the time runs out and Apple pulls it from the App Store. That story was in part 1 and documents now I spent most of my Saturday after WWDC, all psyched up to get going with this new-found knowledge and enthusiasm for a redesigned version of my personality test app (Which 1 Are You). 

Sunday

After spending way too much time on Saturday downloading the Beta version of Xcode, making sure the app works, and then finding out I can’t submit to the App Store from Beta, and all the other pitfalls I tripped over, I was not too enthusiastic about redesigning the app. So, I reread some of my notes, and remembered that I had had a dream over night about how exactly I could do this.

 I started a new project in XCode, called TestingCode. To use as a proof of concept It has three structs, some state variables, and the body consists of a NavigationSplitView from the Cookbook session and Paul’s podcast. I thought I had understood it, and yet I cannot get it to work. And it’s back to my full-time job, too!

Coming up next : Debugging, NagivationSplitView and more

And that is where this blog ends, for now. Tune in for part 3, where I debug the issue, and learn more about this intriguing NavigationSplitView and how it actually should work. This is where the transcripts and code samples from the sessions I copied should come in handy to see what the pieces of the NavigationSplitView actually should be and how they work together.

Any comments? Suggestions? Email me at FromInterpretedBasicToSwiftUI@gmail.com.

By Deborah Graham

Deborah Graham is a professional developer. She has over 20 years of experience with various programming languages. It all started while attending Community College to get an Associate degree in Electronics technology (hardware). One day, they delivered some Apple IIe computers to the computer room to keep the PDP-11s company. There was a pong-like game written in Interpreted Basic where the source code was available. She quickly figured out that by increasing her paddle to 99% of the goal area and the opponent’s to 1% and turning up the speed of the ball, it was a fun way to a win. One small change, one big difference. And a love of programming was born. When not in class, she could usually be found sitting at that Apple IIe and tweaking the program a little to see the changes. After graduating, she held several hardware-related jobs to match the degrees (two Associates: Electronics Technology and Computer Maintenance Technology, both hardware-based degrees), including Test Technician, Manager of the Test Department, Customer Support (where she created the Customer Support Newsletter that would collect errors in the hardware or documentation and send it out to the local sales and support reps to cut down on support calls to the home office) and then she went to the documentation department to correct all the errors and to create technical documentation with the hardware engineers. She was a Technical Writer for an automated testing machine manufacturer. The documentation software (this was WAY before Word) used LISP (now just Lisp) as the extension tool. The writing team found they needed/wanted to extend the documentation software to do things like index across all documents and spell-check all documents. Luckily, there was a class happening and she flew up to Montreal to attend the week-long class and the love of programming continued! When she got back, all sorts of extensions were created and shared with other users of the software.

One day, during the yearly performance review and plan for next year, her manager said to get a promotion, she would need to get a bachelor’s degree. Didn’t matter in what, it was one of the requirements to move up in the company. So, she called the local state school and asked what degrees they offered. And BSCS (Bachelor of Science, Computer Science) was one of the choices. It was either that, or Nursing or Teaching. Easy choice!

Right before graduating (and being eligible for a promotion), she was laid off! But now, with a degree to go with her love of programming, she was hired by the documentation software provider as a technical writer. After that, she worked for an early browser-based distance learning provider as a technical writer. One Friday, the boss asked her if the online help she was writing in HTML could pop up when links where clicked instead of completing replacing the main help. Granted, that’s a no-brainer now…but this just wasn’t available in HTML at the time. On the way home, she went to the local bookstore, went to the Computer Science section, and checked the index on all the books to find one that would be of help. She bought the book, read it on Saturday and Sunday (yes, she reads programming books for fun!) and on Monday, she got into the office before the boss, coded up come JavaScript and when he walked in, she said, “like this?” and he was amazed. The thrill of writing some code and seeing the result is very motivating. She went on to teach a class called “JavaScript for Technical Writers” at various places. As she was creating the class and with a vacation scheduled, she emailed the author of her JavaScript book asking his permission to use the book and the sample code in her class, promising to give him credit for the code. When she received his okay, that started her habit of bringing a programming book to take on vacation with her to learn a new language. Some people may take a romance novel to read at the beach…she falls in love with a new programming language!

That leads to the list of the programming languages that she was used to professionally write code:
M/MUMPS/Caché ObjectScript
HTML
XML
ASP
Lisp
Pascal
Certified AES
Visual Basic/VBA
JavaScript
Postscript
PCL
Python
SQL
And some that she uses for her hobby
Objective-C
Swift

Which brings us to the hobby. One team she was on had a meeting habit of taking personality tests before the meeting and then declaring which one of something each team member was. Which flower are you? Which Major city? Which cartoon character? Each week, someone on the team would find an online test, and they would all take the test and report the results for the icebreaker at the start of the meeting. One week, she was looking for a test on which character from Scorpion (a television show about geniuses that solved problems for the US government each week and learned a little more about how to function in society with a help of their “normal” assistant and her genius son). Anyway, she could find tests on which genius, but not specifically about that show. When she mentioned this difficulty to the team manager, she was told to write one herself. Apple had just opened the AppStore to developers, so here was another opportunity to learn a new language. It took a few years of reading books, finding online classes on Objective-C, and finally getting an app into the AppStore. The CIO of her company mentioned it at a few All-Hands meetings, and he shared his test results. There are 15 tests available for a variety of TV, movies, cartoons, and general interest. If you are at all inclined, it is called “Which 1 Are You” and it has her name as the developer.

As an Apple Developer, she is invited to attend Apple’s WWDC (World Wide Developers Conference). Before the pandemic, it was almost impossible to get tickets. Since the last few years have been online, it opened the gates and allowed anyone to participate. She has “attended” WWDC for two years in a row now and looks forward to attending them each year. She takes a week off from her full-time job as a SQL and VBA Programmer and soaks in the new information and the enthusiasm from the presenters and other attendees.

She was asked by Developer Nation to document her journey from WWDC 2022 to an updated version of the app, totally re-written in SwiftUI, into the AppStore. Follow along and see what works, what doesn’t work, and let’s see if she can get the app ready for version 2.0! You can email the author at FromInterpretedBasicToSwiftUI@gmail.com.

Leave a Reply