Skip to content

ahmetbostanciklioglu/DataFlowApp-SwiftUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🔄 DataFlow App — SwiftUI

A concise, runnable example of SwiftUI's @Observable data flow

Platform Swift SwiftUI Xcode Stars Last Commit

📖 Overview

This is a small, focused learning example that shows how SwiftUI reacts to changing state using the modern Observation framework. A reference type is annotated with the @Observable macro, and the view automatically re-renders whenever one of its tracked properties changes. It is intentionally minimal so the data-flow mechanics are easy to follow.

The app displays a simple user profile card and increments a follower count on a button tap, demonstrating how a mutation on an observable object drives a live UI update — no @Published, ObservableObject, or manual objectWillChange plumbing required.

✨ What it covers

  • Marking a reference type with the @Observable macro from the Observation framework.
  • Letting SwiftUI automatically track and re-render only the views that read a changed property.
  • Mutating observable state (followerCount += 1) directly from a Button action.
  • Building a basic profile layout with VStack, Text, and typography/foreground styling.
  • Using .buttonStyle(.borderedProminent) and #Preview for the SwiftUI canvas.

🚀 Getting Started

git clone https://github.com/ahmetbostanciklioglu/DataFlowApp-SwiftUI.git
cd DataFlowApp-SwiftUI
open DataFlowApp-SwiftUI.xcodeproj

Then select an iOS Simulator and press Command-R to build and run.

📋 Requirements

  • iOS 18.1+
  • Xcode 16 or later
  • Swift 5.0

🧑‍💻 Author

Ahmet Bostancıklıoğlu@ahmetbostanciklioglu · ahmetbostancikli@gmail.com

⭐ If this helped you, consider giving the repo a star!

About

Minimal SwiftUI example demonstrating the @observable macro and reactive data flow to a profile view.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages