Tag Archives: DataBinding

How data is passed from one view to another in SwiftUI?

By | January 13, 2024

In SwiftUI, you can pass data from one view to another using the @State, @Binding, @ObservedObject, or @EnvironmentObject property wrappers. The appropriate choice depends on the nature of the data and the relationship between the views. Below are brief explanations and examples for each approach: 1. @State : Use @State to store simple values within… Read More »

Event Handling using DataBinding in Android.

By | February 3, 2017

Using data binding, you can also handle events right from the layout xml using either Method references, or Listener bindings. For this we can create a seperate Class named “MyHandler”. Event Handler Class MyHandler.java Like my previous examples you have to initialize the listener in the Activity. Layout Now the layout that has a button… Read More »

Data Binding in Android – Using Observables (BaseObservable) to Update UI automatically

By | January 20, 2017

In the last example, you may have got an idea of what DataBinding is. If not please check my tutorial here… Simple DataBinding in Android Example. Updating Objects using Observables. In the last tutorial you may have noticed, if you update the object which is data binded, the change is not reflected in the UI… Read More »