Skip to content

ahmetbostanciklioglu/Properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🏷️ Swift Basics: Properties

A concise, runnable Swift Playground exploring computed and stored properties.

Platform Swift Playground Stars Last Commit

πŸ“– Overview

Properties associate values with a particular class, struct, or enum. Swift distinguishes between stored properties, which hold a constant or variable value as part of an instance, and computed properties, which calculate a value each time they are accessed rather than storing it.

This is a small, self-contained Xcode Playground that demonstrates both kinds side by side. It is meant as a quick, runnable learning example rather than a full application.

🧩 What it covers

  • Computed property β€” a var backed by a getter block that returns a value on access instead of storing one.
  • Stored property β€” a plain var declared inside a struct that holds its value as part of the instance.
  • Creating an instance of a struct and passing an initial value to its stored property via the memberwise initializer.

πŸš€ Getting Started

git clone https://github.com/ahmetbostanciklioglu/Properties.git
cd Properties

Unzip Properties.playground.zip, open Properties.playground in Xcode, and run the playground to see the results appear in the sidebar.

πŸ“‹ Requirements

  • Xcode 12 or later
  • Swift 5

πŸ§‘β€πŸ’» Author

Ahmet BostancΔ±klΔ±oğlu β€” @ahmetbostanciklioglu Β· ahmetbostancikli@gmail.com

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

About

A concise Swift Playground demonstrating computed and stored properties.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors