Dominik Hofer
Dominik Hofer

Day 62 #100DaysOfSwiftUI

βœ… Overview of the Instafilter project

πŸ”‘ takeaways:
πŸ‘‰ .onChange() is the best way to react to state changes
πŸ‘‰ .confirmationDialog() is an alert with multiple buttons

Funny that I've only learned about .onChange() yesterday πŸ€“

Dominik Hofer
Dominik Hofer

Day 61 #100DaysOfSwiftUI

βœ… Added CoreData to the personal CRM app

Took me two days to implement the CoreData functionality, but it was so worth it – I learned a ton!

Here are the most noteworthy things πŸ‘‡

Show thread (5 posts)
Dominik Hofer
Dominik Hofer

Didn't finish today's challenge for #100DaysOfSwiftUI, was way harder than I thought so far.

Will continue tomorrow ✌️

Dominik Hofer
Dominik Hofer

Day 60 #100DaysOfSwiftUI

βœ… Created a personal CRM app

This app was not that hard UI-wise, but quite a challenge to get all the data stuff correctly.

Definitely not perfect, but solid I think :)

Read on for a few behind the scenes πŸ‘‡

Show thread (6 posts)
Dominik Hofer
Dominik Hofer

Day 59 #100DaysOfSwiftUI

βœ… Deep dive into CoreData (part III)

Extended the FilteredListView a bit and made it more versatile.

I especially liked the use of enums to ensure that only valid predicates are entered.

Below is my code, if anyone is interested πŸ€“

Dominik Hofer
Dominik Hofer

Day 58 #100DaysOfSwiftUI

βœ… Deep dive into CoreData (part II)

πŸ”‘ takeaways:
πŸ‘‰ Use NSPredicate to filter query
πŸ‘‰ Make FetchRequests in subview (with SQL-like syntax)
πŸ‘‰ CoreData relationships

These were some fun but also complex topics today, was great :)

Dominik Hofer
Dominik Hofer

Day 57 #100DaysOfSwiftUI

βœ… Deep dive into CoreData (part I)

πŸ”‘ takeaways:
πŸ‘‰ .self refers to the whole object β†’ computes hash value
πŸ‘‰ Create a NSManagedObject subclass to handle optionality in one central place
πŸ‘‰ Check if changes were made to the moc
πŸ‘‰ NSMergePolicy

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 56 #100DaysOfSwiftUI

βœ… Added some additional features on my own

This challenge wasn't that hard, but I got to reuse some concepts from previous lessons. Especially working with dates and unwrapping optionals with if let.

Dominik Hofer
Dominik Hofer

Day 55 #100DaysOfSwiftUI

βœ… Built the Bookworm project (part II)

πŸ”‘ takeaways:
πŸ‘‰ Sort data in FetchRequest with a SortDescriptor
πŸ‘‰ Place ToolbarItems in different locations
πŸ‘‰ You can also use dismiss to go back to the last screen

Dominik Hofer
Dominik Hofer

Uno #007

Are you a student or someone who struggles to focus for a long time? Then you should definitely try a pomodoro timer!

The best app I found for this is @stayinsession by @philipyoungg.

Great design, great UX – really love all the thoughtful details.

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 54 #100DaysOfSwiftUI

βœ… Built the Bookworm project (part I)

πŸ”‘ takeaways:
πŸ‘‰ Use constant bindings in previews
πŸ‘‰ Must use nil coalescing when displaying data from CoreData

Really like the rating view with the stars, my first proper reusable component!

Dominik Hofer
Dominik Hofer

Day 53 #100DaysOfSwiftUI

βœ… Overview of the Bookworm project

πŸ”‘ takeaways:
πŸ‘‰ @ Binding for changing values in other views
πŸ‘‰ TextEditor for multiline text fields
πŸ‘‰ Intro to CoreData

I feel like with some CoreData skills, I'll finally be able to create my own real apps πŸ₯³

Show thread (2 posts)
Dominik Hofer
Dominik Hofer

Day 52 #100DaysOfSwiftUI

βœ… Added some additional features on my own

Like in the Moonshot project, I mainly got to refactor some of the code.

And I learned how valuable it is to create a β€œwrapper class”, which is much easier to make conform to the Codable protocol:

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)

Follow

RSS Feeds