Skip to content

InesGraellsSanz/Landmakers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ SwiftUI Essentials โ€“ Landmarks App

A simple iOS app demonstrating SwiftUI basics, navigation, and state-driven interactivity using Appleโ€™s tutorials:


๐Ÿ—๏ธ Project Structure

  • Part 1: ๐Ÿงฉ SwiftUI Essentials โ€“ Creating and Combining Views

    • ๐Ÿ—บ๏ธ Built the LandmarkDetail view with:

      • ๐Ÿ—บ๏ธ MapView
      • ๐Ÿ–ผ๏ธ CircleImage
      • ๐Ÿ“ Stacks (VStack, HStack) for layout
      • โšก Live previews in Xcode

Landmark Detail View

Circle Image

Map View

  • Part 2: ๐Ÿ“‹ Building Lists and Navigation

    • โž• Created LandmarkRow to display a landmarkโ€™s image & name in a row
    • ๐Ÿ“œ Built LandmarkList using List to dynamically display all landmarks
    • ๐Ÿ†” Made Landmark conform to Identifiable for use in List
    • ๐Ÿ”— Used NavigationView + NavigationLink to enable navigation from the list to detail views
    • โœ… Now users can browse a list of landmarks and tap to see details

Landmark List View

Landmark List View

  • Part 3: ๐ŸŽ›๏ธ Handling User Input

    • ๐Ÿ“Œ Introduced state management with the @State property wrapper
    • โญ Added a Favorite Button (toggle with a star icon) to mark landmarks as favorites
    • ๐Ÿ–ฑ๏ธ Connected button state to the landmark model, so UI updates automatically when toggled
    • ๐Ÿ“ฒ Updated LandmarkList to visually show favorite landmarks with a filled star
    • ๐ŸŽฏ Reinforced SwiftUIโ€™s declarative pattern: views react to changes in state automatically

Landmark Detail View

  • Part 4: ๐Ÿงฉ Composing Complex Interfaces

    • ๐Ÿ—‚๏ธ Integrated multiple views (LandmarkList, LandmarkDetail, FavoriteButton) into a more cohesive structure
    • ๐ŸŒ Shared data across views by introducing ObservableObject and @EnvironmentObject for centralized state
    • ๐Ÿ“ฆ Modeled app data in ModelData to hold landmarks and allow consistent updates throughout the app
    • ๐Ÿ”„ Ensured any change in data (like marking favorites) automatically propagates across all screens
    • ๐Ÿ“ฑ Built a more scalable app foundation, preparing for larger SwiftUI architectures

Landmark Detail View


โœจ Features

  • ๐Ÿ“ Detail View: Shows map, circular image, and landmark info with declarative SwiftUI.
  • ๐Ÿ“‹ Dynamic List View: Automatically generates rows from data.
  • ๐Ÿงญ Navigation Flow: Seamless transitions from list โž detail using SwiftUI navigation components.
  • โญ Favorites: Mark and filter landmarks interactively with state-driven UI updates.
  • ๐ŸŒ Shared State: Centralized ModelData ensures consistency across all parts of the app.

๐Ÿš€ Getting Started

  1. โฌ‡๏ธ Clone the project.
  2. ๐Ÿ’ป Open in Xcode 15+.
  3. ๐Ÿ“ฑ Run on a simulator (e.g. iPhone 15).
  4. ๐Ÿ” Explore how the list integrates with the detail views.
  5. ๐ŸŽจ Try toggling favorites and see the state update instantly.

๐Ÿ”ฎ Further Enhancements

Consider exploring:

  • ๐Ÿงญ Advanced navigation patterns (NavigationSplitView, NavigationStack)
  • ๐Ÿ—‚๏ธ Tab-based or multi-column layouts
  • โญ Add a "Favorites only" toggle to filter the list
  • ๐Ÿ“Š Integrating Appleโ€™s SwiftData or additional tutorial paths

๐Ÿ“š SwiftUI Official Tutorials

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages