Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift Collections and Control Flow Introduction to Collections Working With Arrays

Swift code challenges

Sometimes I just type the answer into the browser and get it correct. On some of the trickier ones for me I break out x-code. I get the results I want in x-code but when pasting in the browser I don't get a passing grade. I'm happy that I got the information if it's working in X-code. Is there a way to skip that question and also not have that quiz come up as incomplete?

array.swift
// Enter your code below
var arrayOfInts: [Int] = [1,2,3,4,5,6] 
arrayOfInts.append(7)
arrayOfInts = arrayOfInts + [8]
let value = arrayOfInts[4]
let discardedValue = arrayOfInts.removeAtIndex(5)

This is what I have in X-Codevar arrayOfInts = [1,2,3,4,5,6] arrayOfInts.append(7) arrayOfInts = arrayOfInts + [8] arrayOfInts[4] let discardedValue = arrayOfInts.removeAtIndex(5)

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Charles,

Sorry, unless a challenge / quiz is passed, it will remain marked as incomplete. In most cases, while code may work in your own IDE or editor, it may not always work in the challenges if it is not exactly what the challenge asks for. Challenges are super picky and very specific. Even a missing period in a string will often cause a Bummer, as the code checker needs to check for very specific things.

However, in this case, it looks like you are using an older version of Xcode that is running with Swift 2.x. This course uses Swift 3 and will not accept Swift 2.x syntax. The method removeAtIndex() is deprecated in Swift 3 and has been replaced with remove(at:) This is the method that must be used for the 4th task as stated in the instructions.

The trick is to pay very close attention to the specific instructions.

Keep Coding! :) :dizzy:

Thanks. I'm a 20 year veteran of AS/400, I570 RPG,RPGILE,cl etc.., So I understand. Thanks for your reply