Skip to main content

Notice: Workspaces are undergoing maintenance and are temporarily unavailable.

🚀 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
  • Elena Iliasova
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Elena Iliasova
    iOS Development with Swift Techdegree Student 1,739 Points

    Random Colors of button

    Posted May 19, 2020 11:03am by Elena Iliasova
    .a{fill-rule:evenodd;}techdegree
    Elena Iliasova
    iOS Development with Swift Techdegree Student 1,739 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    0 Answers

  • India Poetzscher
    PLUS
    India Poetzscher
    Courses Plus Student 3,821 Points

    I don't know how to fix this error! It is preventing me from being able to run my app.

    Posted May 31, 2019 2:28am by India Poetzscher
    India Poetzscher
    Courses Plus Student 3,821 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    1 Answer

  • Otto linden
    Otto linden
    5,857 Points

    Why does the app look like it's on a phone when viewing it as an ipad pro?

    Posted December 22, 2018 6:14pm by Otto linden
    Otto linden
    5,857 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    1 Answer

  • Javid Abbasov
    Javid Abbasov
    2,319 Points

    Random number generator

    Posted February 22, 2018 8:26pm by Javid Abbasov
    Javid Abbasov
    2,319 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    0 Answers

  • Nathalie Dory
    Nathalie Dory
    2,912 Points

    Why do you add () after declaring a property and method in a class?

    Posted January 10, 2018 9:15am by Nathalie Dory
    Nathalie Dory
    2,912 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    1 Answer

  • Nick Johnson
    Nick Johnson
    2,345 Points

    Why, when setting the upper bound for the random number generator, do we not have to do colors.count - 1?

    Posted November 15, 2017 7:25pm by Nick Johnson
    Nick Johnson
    2,345 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    2 Answers

  • valter Levander
    valter Levander
    345 Points

    The text color/tint color of my button do not change, only the view's background color does so. Any ideas?

    Posted October 20, 2017 4:47am by valter Levander
    valter Levander
    345 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    0 Answers

  • Prem Agrawal
    Prem Agrawal
    944 Points

    Color of the button does not changes??

    Posted August 25, 2017 4:11pm by Prem Agrawal
    Prem Agrawal
    944 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    3 Answers

  • Jordan Ward
    Jordan Ward
    2,395 Points

    Hey guys in my version of Xcode tint.Color is passing compiler but not doing the command in the app.

    Posted August 24, 2017 2:58am by Jordan Ward
    Jordan Ward
    2,395 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    1 Answer

  • Clayton Novotney
    Clayton Novotney
    1,341 Points

    "Installation Failed Invalid Argument"

    Posted July 7, 2017 1:43am by Clayton Novotney
    Clayton Novotney
    1,341 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    1 Answer

  • Dmitry Pavlovsky
    Dmitry Pavlovsky
    2,502 Points

    Differente ways?

    Posted May 4, 2017 9:27am by Dmitry Pavlovsky
    Dmitry Pavlovsky
    2,502 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    1 Answer

  • Bastian Petersson
    Bastian Petersson
    9,164 Points

    App crashes when I run it

    Posted April 1, 2017 12:50pm by Bastian Petersson
    Bastian Petersson
    9,164 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    1 Answer

  • Jose Wences
    Jose Wences
    4,596 Points

    Build a Simple iphone app with swift 3. Video Random Colors. Run time error.

    Posted December 29, 2016 12:09am by Jose Wences
    Jose Wences
    4,596 Points
    • iOS
    • Build a Simple iPhone App with Swift
    • Improving Our User Interface
    • Random Colors

    0 Answers

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