Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Big Little Wins

Zamzam Pooya
March 24, 2024
1.3k

Big Little Wins

This talk will take you through a handful of topics that either make a big or a small win for you or your application, mostly with the new iOS, SwiftUI and Xcode features. Want to give your app some extra sparkle? Let's chat about cool shortcuts, playful animations, and the new tricks from SwiftUI 5 like observation framework, enhanced phased animations, updates to scrollview and new gestures. Come join this session and take home some big and small wins with you.

Zamzam Pooya

March 24, 2024
Tweet

Transcript

  1. In iOS development, as in the Matrix, there's no spoon

    - it’s not the code that bends, it's only yourself, as you learn and adapt to new challenges and possibilities. -Matrix, sort of
  2. How Many Are… Using UIKit on a daily basis? Using

    SwiftUI on a daily basis? Supporting iOS 13,14 or below? Supporting iOS 15, 16 and above? Supporting only iOS 17?✨
  3. Enhanced Code Editing Auto Completion based on name of the

    f ile Method options preview with a right-arrow click Smart modi f ier prediction based on usage history Code completion for images and color assets
  4. App Icon In Xcode 15, you only need a 1024

    * 1024 png image for your App Icon!
  5. Macros #Preview @Observable It is part of the Swift packages

    and the SDK #Predicate @Model You can also create you own Macros 💙
  6. With @Observable Macro No more Combine instead Observation No more

    @Published class SomeViewModel: ObservableObject To @Observable class SomeViewModel No more @StateObject, @ObservedObject, and @EnvironmentObject now just use => @State, @Bindable or @Environment or nothing at all! Increases the performance of SwiftUI views https://www.avanderlee.com/swiftui/observable-macro-performance-increase-observableobject/
  7. SwiftData “SwiftData makes it easy to persist data using declarative

    code. You can query and f ilter data using regular Swift code. And it’s designed to integrate seamlessly with SwiftUI.” -Apple
  8. Enhanced Animations .phaseAnimator De f ine multiple stages of animation

    by using an array. The animation loops between these stages. Trigger the animation Customize the timing for each animation stage
  9. .onChange(of:initial:_:) Old & New Value “Access both the old and

    new values of a value that changes when processing the completion closure of the onChange(of:initial:_:) view modi f ier”
  10. .visualEffect() “Visual E ff ects change the visual appearance of

    a view without changing its ancestors or descendents”
  11. ScrollView “Positions this view within an invisible frame with a

    size relative to the nearest container.” .containerRelativeFrame(_:alignment:)
  12. ScrollView .scrollTransition() “Applies the given transition, animating between the phases

    of the transition as this view appears and disappears within the visible region of the containing scroll view, or other container speci f ied using the coordinateSpace parameter.”
  13. ScrollView .safeAreaPadding(): “Adds the provided insets into the safe area

    of this view.” .contentMargins(_:): “Con f igures the content margin for a provided placement.”
  14. SF Symbols Animation .symbolE ff ect() Effect: Appear, Disappear, Bounce,

    Scale, Pulse, Variable Color, and Replace Options: Repeating, NonRepeating, Repeat(Int?) Value: The value to monitor for changes, the animation is triggered each time the value changes
  15. Deprecated Modi f iers foregroundColor(_:) -> Use foregroundStyle(_:) instead colorScheme(_:)

    -> Use preferredColorScheme(_:) instead listRowPlatterColor(_:)-> Use listItemTint(_:) instead navigationBarTitle(_:) -> Use navigationTitle(_:) instead https://developer.apple.com/documentation/swiftui/view-deprecated accessibility(label:)-> Use accessibilityLabel(_:) instead
  16. Shortcuts ✨ ⌘+⇧+A => You can access ALL of Xcode

    menu option - New Shortcut 🤩 ⌘+0 => Toggle Navigator ⌘+⌥+0 =>Toggle Inspectors ⌘+⇧+F =>Global Search ⌘+⇧+O => Open Quickly