Skip to content

Instantly share code, notes, and snippets.

View phucledien's full-sized avatar
🇻🇳
Xin chào

Le Dien Phuc phucledien

🇻🇳
Xin chào
View GitHub Profile
struct ContentView: View {
var body: some View {
VStack{
Label("Hello Label", systemImage: "sun.min")
.font(.system(.title, design: .rounded))
Label("Title only label", systemImage: "sun.min")
.font(.system(.title, design: .rounded))
@phucledien
phucledien / TaskConcurrencyManifesto.md
Created July 30, 2020 15:44 — forked from lattner/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto
@phucledien
phucledien / value_types.md
Created July 31, 2020 06:20 — forked from rbobbins/value_types.md
Build Better Apps with Value Types in Swift

Build Better Apps with Value Types in Swift

Agenda

  • Reference semantics
  • Immutability
  • Value semantics
  • Value types in practice
  • Mixing value types and reference types

Reference semantics

// 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
}
}
@phucledien
phucledien / DisplayLink.swift
Created August 9, 2020 16:21 — forked from CanTheAlmighty/DisplayLink.swift
DisplayLink for OSX
@phucledien
phucledien / SwiftElmFrameworkList.md
Created August 9, 2020 16:50 — forked from inamiy/SwiftElmFrameworkList.md
React & Elm inspired frameworks in Swift
@phucledien
phucledien / ios-interview-resources.md
Created October 9, 2020 07:08 — forked from funmia/ios-interview-resources.md
General iOS, CS questions and interview prep resources.
@phucledien
phucledien / SidebarViewController.swift
Created November 6, 2020 03:53 — forked from wozuo/SidebarViewController.swift
Programmatically create NSTableView in Swift 4.1
import Cocoa
class SidebarViewController: NSViewController, NSTableViewDelegate, NSTableViewDataSource {
var initialized = false
let scrollView = NSScrollView()
let tableView = NSTableView()
override func loadView() {
self.view = NSView()
@phucledien
phucledien / react-rendering.md
Last active November 8, 2020 17:46 — forked from tuhuynh27/react-rendering.md
A (Mostly) Complete Guide to React Rendering Behavior

Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)

A (Mostly) Complete Guide to React Rendering Behavior

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.

"Render" là gì

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.