CodeCompletion.io

Episode 9: Just Enough Research

Welcome to Code Completion, Episode 9! We are a group of iOS developers and educators hoping to share what we love most about development, Apple technology, and completing your code on this brand new show!

Follow us @CodeCompletion on Twitter to hear about our upcoming livestreams, videos, and other content.

Be sure to also sign up to our monthly newsletter, where we will recap the topics we discussed, reveal the answers to #CompleteTheCode, and share even more things we learned in between episodes.

You are what makes this show possible, so please be sure to share this with your friends and family who are also interested in any part of the app development process.

⭐️ This Week's Topics

  • New A14 performance leaks.
  • Integrating Accessibility in your apps.
  • Testing your apps with real users.

🚧 #CompleteTheCode

This week's #CompleteTheCode:

What are the changes you could make to the code below so that we can have a ProcessingCoordinator.Error nested Error type?
1
2
3
4
5
6
7
8
9
10
struct ProcessingCoordinator {
    // ...
}

// We want this error type to be usable as ProcessingCoordinator.Error
// What changes would you make?
enum <# My ProcessingCoordinator Error Type #>: Error {
    case notFound
    // ...
}

Be sure to tweet us with hashtag #CompleteTheCode if you know the answer!

⚠️ Compiler Error

  1. By using extended delimiters for string literals, all special characters including the backslash will be represented as normal characters.
  1. Not limited to optionals, any type can conform to ExpressibleByNilLiteral to have a special initializer called if nil is used along with that type.
  1. Like integer literals, floating point literals can be expressed in binary, octal, decimal, or hexadecimal forms.
  1. Although Dictionaries prohibit it, ExpressibleByDictionaryLiteral allows for multiple entries with the same key.
Compilation Results

Eager to continue a winning streak, Ben went first, followed by Spencer. Let's see how they did!

1. By using extended delimiters for string literals, all special characters including the backslash will be represented as normal characters.

Both of our completionists thought this was true, and it is indeed a code completion! Learn More →

2. Not limited to optionals, any type can conform to ExpressibleByNilLiteral to have a special initializer called if nil is used along with that type.

They both thought this was also factual, and it is indeed a code completion! Learn More →

3. Like integer literals, floating point literals can be expressed in binary, octal, decimal, or hexadecimal forms.

Although Ben initially had some doubts, both of our completionists thought this was true, which is unfortunate because it was the compiler error! Although you can define a hexadecimal or decimal floating point number, you cannot do so for binary and octal numbers. Learn More →

Which leaves…

4. Although Dictionaries prohibit it, ExpressibleByDictionaryLiteral allows for multiple entries with the same key.

…which everyone incorrectly thought was the error, but it was a code completion after all! Learn More →

🎁 Sponsor

This week's episode of Code Completion is brought to you by Sticky Widgets! Search for Sticky Widgets on the iOS App Store today to give it a try!

📹 Watch the Stream