“There are only two hard things in Computer Science: cache invalidation and naming things.”

— Phil Karlton

My opinion that this Chapter is the Core of this Book, everything starts by naming.

The book states that if a name requires a comment, then the name does not reveal it’s intent.

GeometryReader provides us with an input value telling us the width and height we have available, and we can then use that with whatever calculations we need.

With other words: GeometryReader is thing that recognize geometry of parents view means when you create a view in the geometry you get size of your parent view.

As you can see, GeometryReader’s closure has the parameter called geometry. This parameter is an instance of GeometryProxy struct. You can use an instance of GeometryProxy to access information about the coordinate space using the following properties.

size — The size of space available to GeometryReader.

This year we had a great addition in SwiftUI, the integration for frameworks that Apple provides us like MapKit.

the book discourages you to write comments, because if you wrote good, clean, and informative code, you shouldn’t need to have comments in the first place.

if we write good variable and function names, comments are not necessary.

Bad Comments

  • Any comment that makes you looking in another file for…

The observer pattern lets one object observe changes on another object. Apple added language-level support for this pattern in Swift 5.1 with the addition of Publisher in the Combine framework.

This is a behavior pattern, it focused to observe changes on other object.

The strategy pattern defines a family of interchangeable objects that can be set or switched at runtime. This pattern has three parts:

Aymen Afia

iOS developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store