@krepandus shares doubts we've all had before:
I guess it's syntax that's often used across apps so it'll come second nature....
Biscuits ๐ฅฏ ๐ฅ
My grandmother made the fluffiest biscuits. She could grab some flour, a chunk of butter, milk, a dash of salt, a shake of vanilla, and a few other ingredients and make delicious biscuits for 3, 9, or 20 people. Golden crust on the outside, heavenly clouds in the middle. She did this from memory. I'd try the same, and gronk up the ratios. Instead of fluffy biscuits, I'd make runny pancake batter. Or thick hockey pucks as hard as cement.
The difference, of course, was experience. To gain grandma-level ๐ต๐ฝ experience, I had to make scores of biscuits, often ruining a batter and needing to start over. What helped me gain the experience was a hand written recipe!
I wrote down the measurements and made biscuits for breakfast each morning for weeks. To be honest, I ate scores of awful biscuits. After a while, basic biscuits were easy. And they started to taste great! Then I tried some variations, making numerous notes on the recipe for different textures or flavors. Before long, I didn't need the recipe card. But it was always available for reference.
Playgrounds ๐ ๐ก
I recommend you use playgrounds as your recipe book! It's easy to create multi-page playgrounds in Xcode. I recommend you put a different topic on a new page. Give the page a name, similar to naming a biscuit recipe.
One page could be recipes for sorting arrays.
Another page could be for useful array methods. Create examples and document them for future you.
One page could demonstrate the Picker user interface element.
Another page could demonstrate how to implement gradients and drop shadows with a button.
Make lots of notes! Comments are just as important as the sample code! Write lots of comments to yourself! Explain what you're doing and help your future-self understand your code. Future You will be grateful!
Hint: when writing comments, explain the code to yourself using the Rubber Duck Technique ๐ค
Practice ๐ฉ๐ผโ๐ณ ๐จ๐ฟโ๐ณ
Now you need to practice in the kitchen! Grab a screenshot from a favorite application. Try to duplicate the Notes
interface. Open the Contacts
application on your iPhone and start entering a new friend. Duplicate that interface in Xcode. If you get stuck on how to add an SF Symbol
to a button, before you get frustrated, check your ๐ recipe book. You should have a small, concise recipe for Making a Button with SF Symbols. The rest of the new contacts screen seems to use a Form
. Don't remember how to create a view using a Form
and Sections
? Check your recipes! Sometimes you'll have to create a NEW recipe, but that's how you build experience. Soon you'll have a page in your playgrounds titled Favorite Buttons
. You'll reuse that recipe over and over again.
I've shared a few recipes in these forums. Search for >playgrounds
< and start adding these to your own playground. To get you started, here are a few that I've written for the forums.
See-> Initializing Structs
See-> Getting a Variable's Type
See-> Fun with Dictionaries
See-> Picker Examples
Keep coding!