Intermediate concepts in Mobile Dev, page 4

SwiftUI Modifiers: Stacking Changes on Views
Think of SwiftUI modifiers as non-destructive filters you apply to a view, creating a new, wrapped version with the change applied. You use them to add padding, set fonts, or handle taps. The footgun: modifier order matters immensely.

SwiftUI List: More Than Just a Table View
A SwiftUI List is a declarative container for scrollable rows of data, like a modern UITableView. Use it for settings, feeds, or contact lists. The footgun: never nest a List inside a ScrollView, as it breaks scrolling behavior.

Android Services: Running Work Without a UI
An Android Service is a component for long-running background tasks, even when the user isn't in your app. Use it for tasks like playing audio or syncing data.

ContentProvider: Android's Shared Data API
A ContentProvider is a structured API gateway for your app's private data. It lets other apps query, insert, or delete data securely without direct access. The main footgun is improper permission handling, which can leak data or cause crashes.

UIHostingController: Bridge SwiftUI into UIKit Apps
UIHostingController is an adapter that lets you use modern SwiftUI views inside a UIKit app by wrapping them in a UIViewController. This is key for migrating apps to SwiftUI or embedding new components.
Flutter's build(): Why It Lives on State, Not the Widget
Flutter's build() method turns state into UI. It's on the State object, not the StatefulWidget, to ensure it always paints with the latest data. The framework calls it on init, after setState(), or when dependencies change.

Android ViewModel: Survive Screen Rotations
A ViewModel is a lifecycle-aware data holder that separates your UI's state from its controller. It keeps data alive during configuration changes like screen rotations, preventing data loss and repeated network calls.
BuildContext: Your Widget's Address in the Tree
A BuildContext is a widget's address in the Flutter tree, letting it find ancestors like themes or navigators. It's used for Theme.of(context) or Scaffold.of(context). The key footgun: a widget's context can't find its own children, only its parents.

LiveData: Lifecycle-Aware Data Observation
LiveData is a data holder that only notifies active UI components. It connects your ViewModel's data to your UI, preventing crashes and memory leaks by respecting the Android lifecycle.
StatefulWidget and State: Two Parts of a Whole
A StatefulWidget is an immutable blueprint, while its separate State object holds the mutable data. The widget is disposable; the state persists across rebuilds. Use this for interactive UI like forms or counters.

Android's Task and Back Stack Explained
Think of the back stack as a stack of plates (screens). A "Task" is the entire stack for a user's workflow. The system manages this stack, but you can control it for custom navigation. The biggest footgun is misusing launch modes, which breaks back button.
Flutter's setState(): Triggering UI Updates
setState() tells Flutter "my data changed, so rebuild the UI." It's not the change itself, but the notification that a change happened. Use it in a StatefulWidget's State class when events modify data your build() method uses.

ViewModel: Surviving Android Configuration Changes
A ViewModel acts like a durable backpack for your UI's data, surviving the destruction and recreation of an Activity during a screen rotation. It holds UI state, like user input or fetched data, preventing data loss.
React Native: Infinite Scroll with onEndReached
The onEndReached prop is a callback that fires when you scroll near a list's end, letting you fetch more data. Use it in FlatList for feeds or catalogs. The main footgun: it can fire multiple times, so use a loading flag to prevent redundant API.
Memoizing List Items with `React.memo`
Wrap list items in React.memo to prevent them from re-rendering when their props are unchanged. In a FlatList, this stops items from re-rendering just because the list scrolled, keeping the UI smooth. The footgun is assuming it's a free optimization.

UISceneDelegate: Managing Your App's UI Instances
Think of SceneDelegate as the lifecycle manager for a single window of your app's UI. It's essential for multi-window iPad apps, handling when a scene connects, disconnects, or changes state.

MVVM: Separate SwiftUI Logic from Layout
MVVM separates logic from layout by moving state and business logic out of your SwiftUI View into a dedicated ViewModel class. This makes your code cleaner, more organized, and easier to test.

Dependency Injection in Swift: Stop Creating, Start Receiving
Dependency Injection means objects receive their dependencies from the outside rather than creating them internally. It's used to give a view model a network client or data source, making it testable.

iOS Background Modes: A Hall Pass for Your App
iOS background modes are like hall passes, letting your app perform specific tasks like playing audio or tracking location after the user switches away. They're used for music players or navigation apps.

The Singleton Pattern: One Instance to Rule Them All
A singleton ensures a class has only one instance and provides a global access point to it. It's used for shared resources like a network manager or logger. The main footgun is that overuse creates tight coupling and makes testing difficult.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles