Apple unveiled recently their line of low end computers equipped with Apple Silicon M1 processors. The results are amazing.
Even being low end computers, these new machines decimate previous versions of the same devices powered with Intel processors. Tight integration of memory, CPU and GPU on the same chip plus high customization of these chips to the hardware Apple sell, makes them not just powerful but fast and power efficient.
We cannot wait to see what 2021 will bring us, as soon as the high end line of Macs come to light, powered by advanced versions of the M1 chip.
What happens to the PC Industry if Apple Computers become faster and faster?
Shut up and take my money! 😃
Apple M1 performance is insane! pic.twitter.com/3L5NpUlKtN
— Chris Maddern (@chrismaddern) November 27, 2020
A reminder from Apple:
The App Store will soon help users understand an app’s privacy practices before they download the app on Apple platform. On each app’s product page, users can learn about some of the data types the app may collect, and whether that data is linked to them or used to track them. If you haven’t already, enter your app’s privacy information in App Store Connect.
As a reminder, this information will be required to submit new apps and app updates to the App Store starting December 8, 2020. Existing apps will remain available for download.
Learn more about the details you’ll need to provide.
Learn how to provide app privacy information in App Store Connect.
Apple reminds developers that new apps and app updates will not be accepted December 23 through 27 (Pacific Time), due to holidays. Please ensure time for your releases to be scheduled, submitted, and approved in advance.
This is what you do when you want to create an interable enum with associated values:
1 2 3 4 5 | enum Package:String, CaseIterable { case package1 = "com.katkay.package1" case package2 = "com.katkay.package2" case package3 = "com.katkay.package3" } |
This is how you use it: let string = Package.package1.rawValue
Result: com.katkay.package1
If you need to iterate…
1 2 3 | for package in Package.allCases { print("\(package)") } |
Result:
1 2 3 | com.katkay.package1 com.katkay.package2 com.katkay.package3 |
Do you know you can associate closures to enum? Here we go:
1 2 3 4 5 6 7 8 9 10 11 12 13 | enum MyEnum { typealias Logic = () -> (String) case typeA(Logic) case typeB(Logic) func processRule(rule:MyEnum) -> String { switch rule { case .typeA(let logic): return "Type A – logic: \(logic())" case .typeB(let logic): return "Type B – logic: \(logic())" } } } |
Using it…
1 2 3 4 5 | let logic0 : MyEnum.Logic = { return "Logic 0" } let useLogic0 = MyEnum.typeA(logic0) let test = MyEnum.processRule(useLogic0) let final = test(MyEnum.typeA(logic0)) print(final) |
Result:
1 | Type A – logic: Logic 0 |
Do not miss the completely free, amazing Stanford SwiftUI Course. Paul Hegarty is your man! This is the first lesson:
All you need to know if you want to sponsorship this newsletter, in the following link.