Swift Error Messages
Apple's compiled language for all its platforms and Linux.All Swift pages
- Swift error: cannot find 'x' in scopeSwift cannot find 'x' in scope means no visible declaration has that name: a typo, a variable from an inner block, a missing import or a file not in the target.
- Swift error: Value of optional type 'String?' must be unwrapped to a value of type 'String'Swift will not use an Optional where a plain value is required. Unwrap it with if let or guard let, give a default with ??, or use optional chaining with ?.
- Swift Fatal error: Index out of rangeSwift crashes with Index out of range when an array subscript is outside 0..<count: off-by-one loops or empty arrays. Use indices, first, last or bounds checks.
- Swift Fatal error: Unexpectedly found nil while unwrapping an Optional valueSwift crashes with this fatal error when ! force-unwraps an Optional that is nil, or an outlet is not connected. Use if let, guard let or ?? to handle nil.