Dominik Hofer
Dominik Hofer

Things I ❤️ about building apps for : The lil details that work automagically.

E.g. the stepper component allows you to long-press a button to change the variable faster. After five iterations, the counter increases in speed.

Awesome!

Dominik Hofer
Dominik Hofer

Day 51 #100DaysOfSwiftUI

✅ Built the Cupcake Corner project (part II)

🔑 takeaways:
👉 You can create multiple class initialisers
👉 Codable, URLRequest and URLSession are a powerful combo
👉 Place async function call in button inside Task
👉 ! for force unwrapping

Dominik Hofer
Dominik Hofer

Great quote from todays lesson in #100DaysOfSwiftUI from @twostraws.

This is exactly the kind of design I'll try to implement in my apps.

Dominik Hofer
Dominik Hofer

Day 50 #100DaysOfSwiftUI

✅ Built the Cupcake Corner project (part I)

🔑 takeaways:
👉 Save data like types as static arrays in class
👉 Use indices property to get the indices of array
👉 Toggle view
👉 Put validations in data not view (computed property)

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 49 #100DaysOfSwiftUI

✅ Overview of the CupcakeCorner project

🔑 takeaways:
👉 Codable doesn’t work with @ Published, create custom initializer & encoder
👉 async/await and .task for loading data
👉 AsyncImage for loading images
👉 Validate & disable forms with .disabled()

Dominik Hofer
Dominik Hofer

Day 48 #100DaysOfSwiftUI

✅ Break day

Nearly 50% done with the course and today was the first day I didn't actually write any code. But I've watched two great videos instead.

If you have any spare time today and are (becoming) a coder, watch this video by @stevewoz 👇

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 47 #100DaysOfSwiftUI

✅ Created the simplest habit tracker ever

This was the first app that I completely built by myself that is actually useful. Impressive, I know 😉

Will probably add a few features if I have time the coming days.

Read on for a few behind the scenes 👇

Show thread (7 posts)
Dominik Hofer
Dominik Hofer

Uno #006

Tracking expenses is the best way to gain an overview over your finances. But doing it regularly can be tedious.

The solution – an app like @FiveCentsApp by @degisner. It's simple, beautiful and works like a charm.

Entering expenses is as quick as it can get.

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 46 #100DaysOfSwiftUI

✅ Made my own custom shapes

Doesn't look that beautiful but was a great way to repeat some of the learnings from this section.

Now looking forward to the next bigger challenge tomorrow (already had a look 🤫).

Dominik Hofer
Dominik Hofer

Day 45 #100DaysOfSwiftUI

✅ Animating shapes

🔑 takeaways:
👉 .blendMode()
👉 Animate shape changes with animatableData
👉 For multiple props, use AnimatablePair
👉 Only Doubles can be interpolated (not Ints)

Made something even cooler today than yesterday!

Dominik Hofer
Dominik Hofer

Day 44 #100DaysOfSwiftUI

✅ Drawing more advanced shapes

🔑 takeaways:
👉 Use stride to create a custom range
👉 CGAffineTransform
👉 FillStyle(eoFill: true) for even-odd filling
👉 Image border with ImagePaint()
👉 Enable Metal with .drawingGroup()

Wanna see something cool?

Dominik Hofer
Dominik Hofer

Day 43 #100DaysOfSwiftUI

✅ Drawing simple shapes

🔑 takeaways:
👉 Use Path type to draw shapes
👉 Shapes are built using paths, but more flexible
👉 .strokeBorder() draws on the inside (use InsettableShape protocol)

Here's a struct that draws an arc (great for charts) 👇

Dominik Hofer
Dominik Hofer

Day 41 #100DaysOfSwiftUI

✅ Built the Moonshot project (part II)

🔑 takeaways:
👉 Use struct initializer to “merge” JSON files
👉 .navigationBarTitleDisplayMode(.inline) on subviews
👉 Force unwrap with !

Also added a little indicator about which crew member was the commander.

Dominik Hofer
Dominik Hofer

Day 40 #100DaysOfSwiftUI

✅ Built the Moonshot project (part I)

🔑 takeaways:
👉 Use a separate file to load data into app
👉 Generics are useful for reusability
👉 Use computed properties in your structs
👉 Define colors with an extension
👉 .preferredColorScheme(.dark)

Dominik Hofer
Dominik Hofer

Uno #005

Newsletters cluttering up your inbox?

No problem, just use a dedicated inbox for all the newsletters you don't want to miss. I personally like @stoopinbox. It gives you a special email address and reading app.

What's a newsletter everyone should subscribe to?

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 39 #100DaysOfSwiftUI

✅ Overview of the Moonshot project

🔑 takeaways:
👉 .resizeable() to resize images with .scaledToFit/Fill()
👉 GeometryReader is really powerful for resizing
👉 ScrollView
👉 Lazy stacks/grids for lazy loading
👉 NavigationLink to “connect” views

Dominik Hofer
Dominik Hofer

Day 38 #100DaysOfSwiftUI

✅ Added some additional features on my own

This was a fun project to work on, something I would actually use myself with a few more features 🙌

I especially like the idea with the picker up top to select the entries that should be shown.

Dominik Hofer
Dominik Hofer

Day 37 #100DaysOfSwiftUI

✅ Built the iExpense project

🔑 takeaways:
👉 Organize classes & structs in other files
👉 Use UUID() to create unique ids
👉 Pass data to child views as ObservableObject
👉 Use didSet and initializer to write/read data from class to UserDefaults

Dominik Hofer
Dominik Hofer

Day 36 #100DaysOfSwiftUI

✅ Overview of the iExpense project

🔑 takeaways:
👉 Learned about a few property wrappers: StateObject, ObservedObject, Environment, AppStorage
👉 .sheet() modifier to display overlaying view
👉 .onDelete() with ForEach to delete rows

Dominik Hofer
Dominik Hofer

Day 35 (Part II) #100DaysOfSwiftUI

Finished the game and even managed to add a few animations. I'm especially proud of the card flip 🙌

The code behind it is quite ugly though, will probably come back to it and do a little refactor.

Other suggestions on what I could improve?

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 35 (Part I) #100DaysOfSwiftUI

Here's what I got done so far:
✅ Basic variable setup
✅ Entering custom game settings
✅ Generating Q & A array based on settings
✅ Start game

Couldn't finish the challenge today, but will continue tomorrow!

Dominik Hofer
Dominik Hofer

Uno #004

An interesting approach when it comes to music: Personalized soundscapes.

@EndelSound provides exactly that: Custom generated sounds you can listen to for focus, exercise or relaxation.

It even considers factors like the current weather or your heart rate!

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 34 #100DaysOfSwiftUI

✅ Repeating the animation topic by creating some on my own

Todays challenge was to extend the GTF project with my own animations:

  1. The selected flag spins on tap
  2. The other two flags scale down, get desaturated and scaled down

Was a fun one!

Dominik Hofer
Dominik Hofer

Day 33 #100DaysOfSwiftUI (Back at it again)

✅ Animations pt. II

🔑 takeaways:
👉 The order in which animations are applied matters, you can also add multiple modifiers
👉 .offset() modifier is like translate in CSS
👉 .transition() modifier for entering/exiting animations

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 32 #100DaysOfSwiftUI (Back at it again)

✅ Learned about implicit & explicit animations

🔑 takeaways:
👉 Implicit animations are the easiest ones (.animation() modifier)
👉 Easing functions can use modifiers as well
👉 For explicit animations, wrap with withAnimation

Dominik Hofer
Dominik Hofer

Gonna take a 5-day break from #100DaysOfSwiftUI as I am going on vacation, starting today.

Will be back though ✌️

Dominik Hofer
Dominik Hofer

Uno #003

Let's talk about colors 🎨

ColorBox is a handy tool by @kvyn_ for creating color schemes for your UI designs (Tailwind style).

Takes a bit of getting used to but once you get it, you'll always wanna use it. It even supports export to @figma!

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 31 #100DaysOfSwiftUI

✅ Added some additional features on my own

The score is calculated by multiplying the number of words with the total number of letters in all answers. The score turns green when you reach 100 or more points (which isn't that easy let me tell you 😂)

Dominik Hofer
Dominik Hofer

Day 30 #100DaysOfSwiftUI

✅ Built the WordScramble project

🔑 takeaways:
👉 .onSubmit() modifier
👉 withAnimation closure for “smoothly” entering new data
👉 Use .onAppear() modifier to execute code on launch
👉 guard let is very useful with boolean returning functions

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 29 #100DaysOfSwiftUI

✅ Overview of the WordScramble project

🔑 takeaways:
👉 The list view is used extensively for displaying data
👉 Resources get put into an app bundle
👉 You can even spellcheck your words with UITextChecker() (although it has a pretty clunky API…)

Dominik Hofer
Dominik Hofer

Day 28 #100DaysOfSwiftUI

✅ Added some additional features on my own

I actually quite like the result, it's simple but still looks very “iOS-like” and nice. It's great to see how comparatively easy it is to create fully functional apps. And the ml part still blows my mind 🤯

Follow

RSS Feeds