Skip to content

ahmetbostanciklioglu/Enums

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

🔀 Swift Basics: Enums

A concise, runnable example of Swift enumerations — plain cases and associated values.

Platform Swift Playground Stars Last Commit

📖 Overview

Enumerations in Swift define a common type for a group of related values, letting you work with those values in a type-safe way. This repository is a small, self-contained Xcode Playground that demonstrates the two building blocks of Swift enums: defining an enum with simple cases and declaring cases that carry associated values. It is meant as a concise learning reference you can open and run in seconds.

✨ What it covers

  • Declaring a basic enum with simple cases and reading one of them into a constant.
  • Defining an enum whose cases carry associated values (String and Int).
  • Creating an instance by passing a value into a case with a named associated value.
  • Runnable inside an iOS Xcode Playground with no additional setup.

🚀 Getting Started

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

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

📋 Requirements

  • Xcode 12 or later
  • Swift 5
  • iOS Playground target

🧑‍💻 Author

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

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

About

A concise, runnable Xcode Playground demonstrating Swift enums — simple cases and associated values.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors