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

AI can only take you so far. 🌟 Start with core skills in JavaScript, HTML, CSS, or Python. 🚀

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

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

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

AI can only take you so far. 🌟 Start with core skills in JavaScript, HTML, CSS, or Python. 🚀

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • 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
    • Showing results for:
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Close
  • Joe Scotto
    Joe Scotto
    8,282 Points

    Why is the FactModel.swift file not included in some way withing ViewController.swift?

    Posted on Oct 24, 2016 by Joe Scotto
    Joe Scotto
    8,282 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    1 Answer

  • Shirin B
    Shirin B
    54 Points

    When I type in import GameKit, Xcode doesn't recognize it. What should i do? It's like Xcode doesn't know it?

    Posted on Sep 19, 2016 by Shirin B
    Shirin B
    54 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    0 Answers

  • Cory Norell
    Cory Norell
    10,613 Points

    Pressing the "Show another fun fact" button doesn't change text

    Posted on Sep 6, 2016 by Cory Norell
    Cory Norell
    10,613 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Creating a Data Collection

    3 Answers

  • Zachary Kinnear
    PLUS
    Zachary Kinnear
    Courses Plus Student 2,269 Points

    Not displaying Random Fact only displaying second Fact.

    Posted on Aug 7, 2016 by Zachary Kinnear
    Zachary Kinnear
    Courses Plus Student 2,269 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    1 Answer

  • jon kelson
    jon kelson
    5,149 Points

    GKRandomSource.sharedRandom() v's arc4random uniform

    Posted on Jul 5, 2016 by jon kelson
    jon kelson
    5,149 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    0 Answers

  • Sonia Feldman
    Sonia Feldman
    3,873 Points

    How to Prevent Fact Repetition

    Posted on Jun 28, 2016 by Sonia Feldman
    Sonia Feldman
    3,873 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    3 Answers

  • robert rutherford
    robert rutherford
    2,055 Points

    What is the scope of the FactModel struct?

    Posted on Jun 11, 2016 by robert rutherford
    robert rutherford
    2,055 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    2 Answers

  • Joe Nelson
    Joe Nelson
    1,331 Points

    Video Transcript Is Off

    Posted on May 23, 2016 by Joe Nelson
    Joe Nelson
    1,331 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    0 Answers

  • Christine otieno
    Christine otieno
    3,901 Points

    My xcode cant find IntWithUpperBound.... I am stuck -.-

    Posted on May 18, 2016 by Christine otieno
    Christine otieno
    3,901 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    1 Answer

  • jiranan supawong
    jiranan supawong
    5,716 Points

    Why do we not use an initializer method when creating the model in our app?

    Posted on May 14, 2016 by jiranan supawong
    jiranan supawong
    5,716 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Recap: Data Models

    0 Answers

  • Mike Hansen
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Mike Hansen
    Python Web Development Techdegree Student 3,419 Points

    Use of unresolved identifier 'GKRandomNumber'

    Posted on May 3, 2016 by Mike Hansen
    .a{fill-rule:evenodd;}techdegree
    Mike Hansen
    Python Web Development Techdegree Student 3,419 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    3 Answers

  • mahi
    mahi
    7,137 Points

    Just experimenting. Need some help.

    Posted on Apr 1, 2016 by mahi
    mahi
    7,137 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    1 Answer

  • Reagen Rahardjo
    Reagen Rahardjo
    3,770 Points

    after creating empty swift file there is a error message

    Posted on Mar 29, 2016 by Reagen Rahardjo
    Reagen Rahardjo
    3,770 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Refactoring into a Model

    0 Answers

  • Arman Arutyunov
    Arman Arutyunov
    21,900 Points

    Guys my iPhone simulator doesn't show anything on the screen + I have an error in the code but it's the same as Pasan's

    Posted on Mar 16, 2016 by Arman Arutyunov
    Arman Arutyunov
    21,900 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    1 Answer

  • MINJI KIM
    MINJI KIM
    1,905 Points

    how to show the text without ... in label

    Posted on Mar 13, 2016 by MINJI KIM
    MINJI KIM
    1,905 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Refactoring into a Model

    1 Answer

  • Brendan Corey
    PLUS
    Brendan Corey
    Courses Plus Student 5,745 Points

    Generate a random number?

    Posted on Mar 5, 2016 by Brendan Corey
    Brendan Corey
    Courses Plus Student 5,745 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    2 Answers

  • Corey Hellwege
    Corey Hellwege
    3,863 Points

    Can't add text to a stored property?

    Posted on Mar 2, 2016 by Corey Hellwege
    Corey Hellwege
    3,863 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Creating a Data Collection

    1 Answer

  • Garrett Milovich
    Garrett Milovich
    7,282 Points

    ERROR: GKRandomSource is only available on iOS 9.0 or newer

    Posted on Feb 8, 2016 by Garrett Milovich
    Garrett Milovich
    7,282 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    1 Answer

  • roohart
    roohart
    5,529 Points

    Help needed to understand the getRandomFact method

    Posted on Feb 2, 2016 by roohart
    roohart
    5,529 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    2 Answers

  • Leslie Borrell
    Leslie Borrell
    2,318 Points

    for some reason i'm getting an exception when i run the app. the exception is being thrown in appDelegate.swift.

    Posted on Jan 28, 2016 by Leslie Borrell
    Leslie Borrell
    2,318 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Creating a Data Collection

    2 Answers

  • Erman Sahin Tatar
    Erman Sahin Tatar
    3,223 Points

    Code is not working on my mac

    Posted on Jan 11, 2016 by Erman Sahin Tatar
    Erman Sahin Tatar
    3,223 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    0 Answers

  • Erman Sahin Tatar
    Erman Sahin Tatar
    3,223 Points

    " Class ViewController has no initializers " I am getting this error in my code (the same code with video)

    Posted on Jan 10, 2016 by Erman Sahin Tatar
    Erman Sahin Tatar
    3,223 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    8 Answers

  • swiftlover
    swiftlover
    1,597 Points

    Can we use arc4random_Uniform() here to get different fun facts each time the user presses the button?

    Posted on Jan 10, 2016 by swiftlover
    swiftlover
    1,597 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Finishing Up Our Model

    3 Answers

  • Abdijabar Mohamed
    Abdijabar Mohamed
    1,462 Points

    Why do we not use an initializer method when creating the model in our app?

    Posted on Jan 2, 2016 by Abdijabar Mohamed
    Abdijabar Mohamed
    1,462 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Recap: Data Models

    1 Answer

  • Rubens Neto
    Rubens Neto
    13,422 Points

    iOS online database

    Posted on Dec 15, 2015 by Rubens Neto
    Rubens Neto
    13,422 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Creating a Data Collection

    4 Answers

  • Omotayo Olawepo
    Omotayo Olawepo
    2,803 Points

    Hey, is it possible to store an image in the array as opposed to the text

    Posted on Dec 5, 2015 by Omotayo Olawepo
    Omotayo Olawepo
    2,803 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Creating a Data Collection

    1 Answer

  • Emmanuel Darmon
    Emmanuel Darmon
    6,115 Points

    facts on type "FactsModel"

    Posted on Nov 25, 2015 by Emmanuel Darmon
    Emmanuel Darmon
    6,115 Points
    • iOS
    • Build a Simple iPhone App with Swift 2.0
    • Structs as Data Models
    • Structs or Classes

    5 Answers

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

    Treehouse

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

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.