Skip to content

Instantly share code, notes, and snippets.

View hsleedevelop's full-sized avatar
🔥

HS Lee hsleedevelop

🔥
View GitHub Profile
@hsleedevelop
hsleedevelop / XcodeBuildSettingsReference.md
Created June 2, 2022 02:18 — forked from NSExceptional/XcodeBuildSettingsReference.md
The Xcode Build Settings Reference in a searchable document, as of Xcode 8.3.2

Build settings reference

Active Build Action (ACTION)

A string identifying the build system action being performed.

Additional SDKs (ADDITIONAL_SDKS)

The locations of any sparse SDKs that should be layered on top of the one specified by Base SDK (SDKROOT). If more than one SDK is listed, the first one has highest precedence. Every SDK specified in this setting should be a "sparse" SDK, for example, not an SDK for an entire macOS release.

Alternate Install Group (ALTERNATE_GROUP)

//
// WKWebView+Rx.swift
// RxGround
//
// Created by eyemac on 2017. 9. 2..
// Copyright © 2017년 rollmind. All rights reserved.
//
import WebKit
import RxSwift
@hsleedevelop
hsleedevelop / helpers.swift
Created June 2, 2022 02:02 — forked from kastiglione/helpers.swift
Swift helpers, and the lldb setup to use them. Presented @ SLUG https://speakerdeck.com/kastiglione/advanced-debugging-and-swift
extension UIView {
/// Example: call someView.nudge(0, 30)
func nudge(_ dx: CGFloat, _ dy: CGFloat) {
self.frame = self.frame.offsetBy(dx: dx, dy: dy)
CATransaction.flush()
}
}
extension UIView {
/// Example: po UIView.root

Debugging the Swift Toolchain

Use these steps to debug components of the Swift toolchain. This allows you to see Swift's source code from the debugger – instead of disassembly. The debugger can also provide some variable names and values. This has been initially tested with libswiftCore.dylib.

These instructions were updated as of Swift 5.2.1.

Prerequisites

@hsleedevelop
hsleedevelop / composableExample.kt
Last active April 11, 2022 02:10
composable example
@Composable
fun ProfileInput(
profile: UserProfileUi,
modifier: Modifier = Modifier
) {
Scaffold(modifier = modifier) {
// Require to go at the next input from the keyboard.
val focusManager = LocalFocusManager.current
LazyColumn {
if (profile.qrCode != null) {
@hsleedevelop
hsleedevelop / subclassing-uiviewcontrollers.swift
Last active April 11, 2022 01:03
Using Generics to simplify subclassing UIViewController’s view
//refs: https://codeinswift.io/using-generics-to-simplify-subclassing-uiviewcontrollers-view-860c90852e27
class ViewController<UI: UIView>: UIViewController {
let ui = UI(frame: UIScreen.main.bounds)
override func loadView() {
self.view = ui
}
}
do {
let output = try decoder.decode(FlanetNotification.self, from: data)
App.ui.alert(message:"parsed!!!", callback: nil)
} catch DecodingError.dataCorrupted(let context) {
App.ui.alert(message: context.debugDescription, callback: nil)
} catch DecodingError.keyNotFound(let key, let context) {
App.ui.alert(title: "Key '\(key)' not found:", message: context.debugDescription, callback: nil)
App.ui.alert(title: "codingPath: \(context.codingPath)", message: context.debugDescription, callback: nil)
} catch DecodingError.valueNotFound(let value, let context) {
print("Value '\(value)' not found:", context.debugDescription)
@hsleedevelop
hsleedevelop / gist:4c3181b9f596f8b32d621f6621fdd341
Last active October 8, 2020 08:57
UITableViewAlertForLayoutOutsideViewHierarchy
https://developer.apple.com/forums/thread/120790
Still an issue in newly released 13.4.
My main problem is when a table is in split overlay mode (e.g. by default on iPhone X/XR/11) but hidden the rotation causes UITableView layoutSubviews which throws UITableViewAlertForLayoutOutsideViewHierarchy despite the table not being in the window.
Apple please see FB7306484
class ShopFilterParams: NSObject, Codable, DictionaryMapping {
private var config: [String: Any]?
private var defaults: [String: Any]?
private var list: [String: Any]?
var showAreaFilter: Bool?
var showServiceFilter: Bool?
var defaultAreaId: String?
var defaultService: String?
//
// UPCarouselFlowLayout.swift
// UPCarouselFlowLayoutDemo
//
// Created by Paul Ulric on 23/06/2016.
// Copyright © 2016 Paul Ulric. All rights reserved.
//
// https://github.com/ink-spot/UPCarouselFlowLayout/blob/master/UPCarouselFlowLayout/UPCarouselFlowLayout.swift
import UIKit