Skip to main content

NOTICE: On Friday Nov 6, Workspaces will be temporarily unavailable for maintenance.

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

Join the Treehouse affiliate program and earn 25% recurring commission! 🤑

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • nydia subur
    nydia subur
    1,672 Points

    .self and init

    Posted June 3, 2016 6:28am by nydia subur
    nydia subur
    1,672 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    1 Answer

  • RAJ PATEL
    RAJ PATEL
    4,282 Points

    Can you help me explain "self" and init() method again?

    Posted March 1, 2016 8:08am by RAJ PATEL
    RAJ PATEL
    4,282 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    1 Answer

  • Josh Schlabach
    Josh Schlabach
    1,771 Points

    Why are initializers used?

    Posted June 10, 2015 7:34pm by Josh Schlabach
    Josh Schlabach
    1,771 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    2 Answers

  • Josh Schlabach
    Josh Schlabach
    1,771 Points

    What does "self " do in my code?

    Posted June 6, 2015 1:00am by Josh Schlabach
    Josh Schlabach
    1,771 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    3 Answers

  • Anthony Albertorio
    Anthony Albertorio
    22,624 Points

    What's the difference between a default value and an initial value in a Struct?

    Posted May 16, 2015 4:36pm by Anthony Albertorio
    Anthony Albertorio
    22,624 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    0 Answers

  • Samar Khanna
    Samar Khanna
    1,757 Points

    Why do i need to pass in two arguments in the init method when that was already being done earlier?

    Posted April 23, 2015 12:00pm by Samar Khanna
    Samar Khanna
    1,757 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    1 Answer

  • oyemayowa sanwo
    oyemayowa sanwo
    861 Points

    Concise study material or restart whole course

    Posted April 12, 2015 1:03pm by oyemayowa sanwo
    oyemayowa sanwo
    861 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    1 Answer

  • Sreenivasa Madenahally
    Sreenivasa Madenahally
    1,072 Points

    How can i change the value of type when I am declaring the struct contacts?

    Posted April 9, 2015 6:53pm by Sreenivasa Madenahally
    Sreenivasa Madenahally
    1,072 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    1 Answer

  • wajid abid
    PLUS
    wajid abid
    Courses Plus Student 1,803 Points

    in previous lesson why you make the first two attribute as a constant?

    Posted February 18, 2015 1:47pm by wajid abid
    wajid abid
    Courses Plus Student 1,803 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    1 Answer

  • Eran Artzi
    Eran Artzi
    4,280 Points

    Practice

    Posted January 23, 2015 12:47am by Eran Artzi
    Eran Artzi
    4,280 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    0 Answers

  • Zhen Zhi Yeo
    PLUS
    Zhen Zhi Yeo
    Courses Plus Student 2,685 Points

    Does init behaves like constructor overloading in java?

    Posted December 30, 2014 2:40pm by Zhen Zhi Yeo
    Zhen Zhi Yeo
    Courses Plus Student 2,685 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    0 Answers

  • Kantanand US
    Kantanand US
    2,037 Points

    Where the Structs are used in application in realtime example ?

    Posted November 12, 2014 12:17pm by Kantanand US
    Kantanand US
    2,037 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    2 Answers

  • Kevin Lozandier
    PLUS
    Kevin Lozandier
    Courses Plus Student 53,747 Points

    Why named parameters aren't used when overriding swift struct initializers?

    Posted November 12, 2014 6:32am by Kevin Lozandier
    Kevin Lozandier
    Courses Plus Student 53,747 Points
    • iOS
    • Swift Enums and Structs
    • Structs and their Methods
    • Initializers

    1 Answer

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

  • About
  • Blog
  • Community
  • Stories
  • Contact
  • Gift Card

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord