Tag: SwiftUI Tricks

Now that Intel CPUs are about to be a thing of the past, as the main engine of Apple desktop computers, Apple does not have to worry anymore, about vintage chip architectures and their associated limitations and can focus on delivering the best CPU designs they can.

One of the constraints of Intel chips are of thermal nature. Intel CPUs do very little work per Watt compared to Apple ARM Silicon, meaning that they heat a lot and require huge fans to dissipate. Apple Silicon chips are designed to generate more work per Watt, therefore, generating less heat. Hence, Apple can design very lightweight and thin computers, that don’t require fan, run faster, do more work per watt, and cost less. Have you noticed that iPhones and iPads have no fans?

This is exactly what this week’s rumors are all about: Apple will launch a super-lightweight 12-inch MacBook with Apple Silicon, this year.

Apple Silicon

Read all about it on the following link:

A new US Patent, granted to Apple, was discovered this week. The document contains the following introduction:

“With the advent of an increased number a portable computing devices, the need for integration between various devices has become increasingly important. For example, a user may have access to multiple types of devices at a given time (e.g. smartphone, laptop, etc.), and accordingly, these devices may communicate amongst each other to provide an enhanced user experience. This enhanced user experience may include sharing resources amongst devices in order to increase capabilities such as processing capacity, battery usage, network bandwidth, storage, and the like. Accordingly, these devices may form part of a distributed computing environment”.

In short, what Apple proposes is to connect all devices a user may have around idle, to combine CPU power that can be used by the user when needed.

With the advent of an increased number a portable computing devices, the need for integration between various devices has become increasingly important. Apple distributed network patent

The patent can be found on the following link.

Code Highlight

According to Apple:

You typically store and process data in your app using a data model that’s separate from your app’s user interface and other logic. The separation promotes modularity, improves testability, and makes it easier to reason about how your app works.

Traditionally, you use a view controller to move data back and forth between the model and the user interface, but SwiftUI handles most of this synchronization for you. To update views when data changes, you make your data model classes observable objects, publish their properties, and declare instances of them using special attributes. To ensure user-driven data changes flow back into the model, you bind user interface controls to model properties. Working together, these features help you to maintain a single source of truth for your data.

Code Highlight

Remember how hard it is to change a code style like bold, italic, etc., on a text using UIKit? This is how you make a term italic in SwiftUI;

Result: This is how you make a term bold in SwiftUI

Other styles are available like .foregroundColor() and .background(), to adjust text’s foreground and background colors, .linespacing(), .font(), and many more.

Check the following page for more examples:

Sponsorship

All you need to know if you want to sponsorship this newsletter, in the following link.

Tools, baby

If you care about the size of the images you include in your app, you need ImageOptim. This tiny and powerful app, removes EXIF information and compresses PNG and JPEG images to the smaller sizes possible, so they load fast, without losing quality. ImageOptim is completely free.

ImageOptim, This tiny and powerful app, removes EXIF information and compresses PNG and JPEG images to the smaller sizes possible, so they load fast, without losing quality. ImageOptim is completely free.

You are probably familiar with the following question: “should I buy an i5, i7, or even i9 processor for iOS/macOS development?”. XcodeBenchmark project benchmarks a large project to compare the performance of new iMacs 2020 and answer that question.