NEW: Get your ticket for Hacking with Swift Live 2019! >>

Spot the error

This Swift code contains one error – can you select the line that is incorrect?

Tip: You should mentally run the code from top to bottom, meaning that if line 3 says an integer should be returned and line 10 tries to return a string, line 10 is the wrong one.

func sectionForPage(pageNumber: Int) > String {
    var output: String = "Turning to page \(pageNumber)..."
    if pageNumber < 10 {
        output += "The title is Introduction"
    } else if pageNumber < 20 {
        output += "The title is Reviews"
    } else if pageNumber < 30 {
        output += "The title is Features"
    } else {
        output += "The title is Tutorials"
    return output
print(sectionForPage(pageNumber: 11))
Buy Testing Swift Buy Practical iOS 12 Buy Pro Swift Buy Swift Design Patterns Buy Swift Coding Challenges Buy Server-Side Swift (Vapor Edition) Buy Server-Side Swift (Kitura Edition) Buy Hacking with macOS Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with Swift Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code