Coder Social home page Coder Social logo

cookiesandrosepetals-playground's Introduction

Cookies and Rose Petals

This example covers basic object oriented programming in Swift.

My Grandma has a cookie container... and nothing bad happens when I put two different types of cookies in it at the same time. And surely enough, I can even throw some rose petals in there too. Again, nothing bad happens... and the same can be true in Swift. We can create a container (an Array) which can contain any object. But when you grab an object out of the cookie container, you need to check what type of object it is before you eat it ;) In Swift this involves downcasting. You surely don't want to eat rose petals...

var cookieContainer: [AnyObject] = []

Notes

This project is part of Thinkful's course Intro to iOS Programming in Swift

cookiesandrosepetals-playground's People

Watchers

Chris Powers avatar Darrell Silver avatar Olex Ponomarenko avatar Niki Brown avatar Kat avatar Zachary Zimbler avatar Joe Turner avatar James Cloos avatar Dan Friedman avatar Jasjit Singh avatar Carlos Edo avatar David Coulter avatar Brian Schachter avatar Andrew Baylis avatar Robert Wilson avatar Eliz Par avatar Fuad Kamal avatar Grae Drake avatar  avatar  avatar Craig Grummitt avatar  avatar Mark McDonald avatar  avatar Rick Lopez avatar  avatar Chen Atlas avatar Austen Weinhart avatar Bill Cullen avatar  avatar  avatar Tauhida Parveen avatar Ben Aronowicz avatar  avatar  avatar

Forkers

alialsayed

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.