Mastodon
Episode 37

Can you Verizon me now?

00:00:00
/
01:02:54

July 13th, 2021

1 hr 2 mins 54 secs

Season 1

Your Hosts
Tags

About this Episode

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

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

Today, we discuss:

Also, join us for #CompleteTheCode and Compiler Error, two segments that test both your knowledge and our knowledge on Swift, Apple, and all things development!

Your hosts for this week:

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.

Sponsor

This week's episode of Code Completion is brought to you by Pennant. Go to https://apps.apple.com/app/apple-store/id622463230?pt=1765080&ct=CodeCompletion&mt=8 today to check it out!

Complete the Code

What’s the best way to check if the file that is passed in exists or not?

func checkIfExists(_ fileURL: URL) -> Bool {
    // What's the best way to check if the file at fileURL
    // exists or not?
}

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

Compiler Error

This week's Compiler Error has a theme: Obscure Foundation File Classes!
1 - NSFileVolume is a class that allows you to perform fundamental file system operations on volumes, such as injecting its partitions.
2 - NSFileWrapper represents nodes in the file system, such as directories known as file packages, but can also represent regular files and symbolic links.
3 - NSFileHandle provides a wrapper for file system descriptors, allowing you to perform basic file IO such as reading, writing, and locking files.
4 - NSURLProtocol allows you to implement custom loading strategies for your own protocols, so they can be used anywhere a regular NSURL is used.