SwiftUI Tutorial: Core Concepts: Custom Modifiers - Part 2: Implementing ViewModifier

preview_player
Показать описание
SwiftUI Tutorial: Core Concepts: Custom Modifiers - Part 2: Implementing ViewModifier for Inner Shadows

In this episode we're going to be implementing a ViewModifier to extract out a custom modifier to add an inner shadow to a Shape. We will also be discussing the alternative of just using an extension on Shape and contrast the two approaches.

You can find the readme for the inner-shadows section of PureSwiftUITools here:

================

PureSwiftUI is a free Swift Package that includes a multitude of useful extensions and properties to make your life easier with SwiftUI resulting in cleaner code that takes less time to write.

It's a huge time-saver so I do encourage you to check it out.

You can get PureSwiftUI here:

Check out PureSwiftUITools for additional SwiftUI utility type things:

If you want to ask me a question or follow me for updates, you can do so on Twitter:
Рекомендации по теме
Комментарии
Автор

Don't watch this video before going to bed. I did that last night, and spend my time discussing the question at the end with myself instead of sleeping.🙂

larschristiansen
Автор

The question where to put the code is probably a question of scale. If you have a lot of custom modifiers, project is growing and there is more then one person working on it. In that case it might make more to make own ViewModifier for it.

DonutMongo
Автор

Great videos mate. Keep up the amazing content, and include some source files for those of us with less time? Amazing stuff.

cliftonux
Автор

I bet that your next video in this series is going to “Brilliant!”

I could use an idea for handling device rotation in SwiftUI. I’m using “offset” and “position” but my views are jumping all over the screen once I rotate the device. Perhaps in a future brilliant video?

robertshatto