- Reference semantics
- Immutability
- Value semantics
- Value types in practice
- Mixing value types and reference types
| // Original article here: https://www.fivestars.blog/code/redacted-custom-effects.html | |
| import SwiftUI | |
| // MARK: Step 1: Create RedactionReason | |
| public enum RedactionReason { | |
| case placeholder | |
| case confidential |
| extension Sequence { | |
| func reduce<A>(_ initial: A, combine: (inout A, Iterator.Element) -> ()) -> A { | |
| var result = initial | |
| for element in self { | |
| combine(&result, element) | |
| } | |
| return result | |
| } | |
| } |
| // | |
| // DisplayLink.swift | |
| // MetalMac | |
| // | |
| // Created by Jose Canepa on 8/18/16. | |
| // Copyright © 2016 Jose Canepa. All rights reserved. | |
| // | |
| import AppKit |
This is a curated list of iOS (Swift & ObjC) frameworks which are inspired by React and Elm.
- ReactSwift by @ColinEberhardt
- https://github.com/ColinEberhardt/ReactSwift
General iOS, CS questions and interview prep resources.
-
iOS Interview Questions for Senior Developers (useful even if you're not senior yet)
Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)
Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.
Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
| // #!Swift-1.1 | |
| import Foundation | |
| // MARK: - (1) classes | |
| // Solution 1: | |
| // - Use classes instead of struct | |
| // Issue: Violate the concept of moving model to the value layer | |
| // http://realm.io/news/andy-matuschak-controlling-complexity/ |