Search
March 2023 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Categories
Hours & Info
Bookmark
Tag Archives: iOS
SwiftUI: State, StateObject, ObservedObject, ObservableObject
State A property wrapper type that can read and write a value managed by SwiftUI. SwiftUI manages the storage of any property you declare as a state. When the state value changes, the view invalidates its appearance and recomputes the … Continue reading
How to delete an App from command line
1. List all simulators Find out all simulators xcrun simctl list Find out active simulator xcrun simctl list | grep Booted You will get the result like: $ xcrun simctl list |grep Booted iPhone 11 (AE8852AB-378E-47FB-BD23-4CF77BFBC6DC) (Booted) Now you can … Continue reading
Combine Asynchronous Programming
1 Combine basics Combine is a declarative, reactive framework for processing asynchronous events over time. It aims to solve existing problems, like unifying tools for asynchronous programming, dealing with mutable state and making error handling a starting team player. Combine … Continue reading
Configure Visual Studio Code for Swift development
1. Build sourcekit-lsp https://github.com/apple/sourcekit-lsp#building-sourcekit-lsp $ git clone https://github.com/apple/sourcekit-lsp.git $ swift package update $ swift build  The sourcekit-lsp will be here: /Users/zhihuitang/repo/common/sourcekit-lsp/.build/x86_64-apple-macosx/debug/sourcekit-lsp 2. Configure sourcekit-lsp In the sourcekit-lsp settings, set the Language Server Mode to sourcekit-lsp  Set Server Path: … Continue reading
LLDB you should know
LLDB is a next generation, high-performance debugger. It is built as a set of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler. LLDB is the default debugger … Continue reading
Xcode instruments
 The two columns worth noting in Instruments are # Persistent and # Transient. The Persistent column keeps a count of the number of objects of each type that currently exist in memory. The Transient column shows the number of … Continue reading
Views vs. layers
A layer is a simple model class that exposes a number of properties to represents some image-based content. Every UIView is backed by a layer, so you can think of layers as the lower-level behind the scenes class behind your … Continue reading
gitsubree usage
Basic commands about subtree git subtree add –prefix=<prefix> <commit> git subtree add –prefix=<prefix> <repository> <ref> git subtree pull –prefix=<prefix> <repository> <ref> git subtree push –prefix=<prefix> <repository> <ref> git subtree merge –prefix=<prefix> <commit> git subtree split –prefix=<prefix> [OPTIONS] [<commit>] 1. Add … Continue reading
CommentPlus for Swift Func
Usage reference: https://zhihuitang.github.io/2019/01/13/CommentPlus-for-Swift-Func.html Download the Xcode extension from here Unzip and double click the extension CommentPlus.app to install the extension In Xcode, put the cursor on the upper line of func, then select Xcode menu bar: Editor -> CommentGenerator -> … Continue reading
Intermediate iOS Debugging
1. Stop when exception 1.1 Open Breakpoint navigator (Cmd + 8) 1.2 Add Exception Breakpoint  1.3 Keep default values  1.4 Move breakpoint to User level  2. Edit breakpoint Edit Breakpoint  Add Debugger Command:  We will … Continue reading