Coder Social home page Coder Social logo

100daysofswift's Introduction

Header Header Header

100 Days of Swift

100 Days Challenge to learn the Swift language.

Day 1: First Steps in Swift

  • Variables
  • Strings and Integers
  • Multiline Strings
  • Doubles and Booleans
  • String Interpolation
  • Constants
  • Type Annotations

Source Code : Day 1

Day 2: Complex Data Types

  • Arrays, sets, tuples, and dictionaries let you store a group of items under a single value. They each do this in different ways, so which you use depends on the behavior you want.
  • Arrays store items in the order you add them, and you access them using numerical positions.
  • Sets store items without any order, so you can’t access them using numerical positions.
  • Tuples are fixed in size, and you can attach names to each of their items. You can read items using numerical positions or using your names.
  • Dictionaries store items according to a key, and you can read items using those keys.
  • Enums are a way of grouping related values so you can use them without spelling mistakes.
  • You can attach raw values to enums so they can be created from integers or strings, or you can add associated values to store additional information about each case.

Source Code : Day 2

Day 3: Operators and Conditions

  • Swift has operators for doing arithmetic and for comparison; they mostly work like you already know.
  • There are compound variants of arithmetic operators that modify their variables in place: +=, -=, and so on.
  • You can use if, else, and else if to run code based on the result of a condition.
  • Swift has a ternary operator that combines a check with true and false code blocks. Although you might see it in other code, I wouldn’t recommend using it yourself.
  • If you have multiple conditions using the same value, it’s often clearer to use switch instead.
  • You can make ranges using ..< and ... depending on whether the last number should be excluded or included.

Source Code : Day 3

100daysofswift's People

Contributors

cybershaw avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.