LOSTMOA Blog

  • Scroll to Newly Added Item using ScrollViewReader and onChange Modifier in SwiftUI

    How to programmatically scroll SwiftUI ScrollView with a dynamic set of items to a new item that has just been added by combining the new APIs in iOS14: ScrollViewReader and onChange view modifier.

    Read more
  • View Modifier for a Custom Hover Effect in SwiftUI

    In this article we will look into how to create a custom hover effect in SwiftUI and how to abstract this logic into a reusable view modifier.

    Read more
  • Scroll List to Row in SwiftUI

    Programmatically scroll SwiftUI List to a particular item, using the fact that its internal implementation is based on UITableView in iOS 13.

    Read more
  • SwiftUI Navigation in List View: Default Selection

    How to navigate to a list item by default on app launch to avoid showing an empty detail view on iPad or for state restoration.

    Read more
  • SwiftUI Navigation in List View: Programmatically Dismiss Detail

    Looking into the differences of programmatically dismissing the detail view on iPhone and in a split view on iPad.

    Read more
  • SwiftUI Navigation in List View: Programmatic Navigation

    How to implement navigation in a SwiftUI List that works for both iPhone and iPad, so that we can programmatically select a list item.

    Read more
  • SwiftUI Navigation in List View: Exploring Available Options

    Looking into different ways to use NavigationLink to navigate from List to a detail view and what problems we can encounter while implementing programmatic navigation.

    Read more
  • Mapping SwiftUI State to View Binding Types

    How to modify the value of the binding before assigning it to the state and modify the state to match the binding type of the view, if we have a model that doesn't exactly match the binding that a view accepts.

    Read more
  • SwiftUI Vertical ScrollView not Updating Width when Content Changes

    At the moment there seems to be an issue with ScrollView: it will keep the width of its initial content and not resize/grow in width when the content changes. But there are some workarounds that we can use.

    Read more
  • iOS Keyboard Shortcuts in SwiftUI

    Add keyboard shortcuts to a SwiftUI iOS/iPadOS app to improve user experience when using your app with an attached hardware keyboard.

    Read more
  • Scroll TextField into visible range in SwiftUI by wrapping UITextField

    How to tell a scrollable view in SwiftUI to scroll the active text field into visible range when the keyboard appears.

    Read more
  • Multiple Buttons in SwiftUI List Rows

    If you need to have multiple buttons in a list row, using a Button view for all of them might not be a good idea. In this article we will explore what alternatives we have in SwiftUI.

    Read more
  • Double-Column Navigation Split View in SwiftUI

    One of the challenges we faced when writing a complex app in SwiftUI was implementing the Navigation Split View. Our goal was to have a two-column split view when in full-screen in both landscape and portrait orientations.

    Read more