Skip to content

Instantly share code, notes, and snippets.

@minsOne
minsOne / AccessibilityPreview.swift
Created October 18, 2022 10:31 — forked from Sherlouk/AccessibilityPreview.swift
SwiftUI view for adding accessibility previews. Proof of concept.
import SwiftUI
import UIKit
// from https://github.com/cashapp/AccessibilitySnapshot
import AccessibilitySnapshotCore
struct AccessibilityPreview<Content: View>: View {
let content: Content
var body: some View {
@minsOne
minsOne / AppDelegate.swift
Last active December 30, 2022 00:14
Network Abstract Layer
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
internal func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
GitHubAPI.Users(userName: "minsone").request(completion: { result in
print(result)
})
}
}
@minsOne
minsOne / generate.rb
Last active September 26, 2022 04:44
#!/usr/bin/env ruby
def find_interface_type(key, path)
cmd = <<SHELL
cat #{path} | grep "property descriptor for #{key}.type :" | sed -E "s/.* : (.*)\\?/\\1/g"
SHELL
#puts cmd
value = `#{cmd}`
#puts value
return value.strip
@minsOne
minsOne / xctestplan_generate.rb
Last active August 23, 2022 09:38
XCTestPlan 생성 스크립트
require 'xcodeproj'
def makeTestTarget(target, path)
output = "\n {"
if !(path.include? "Application.xcodeproj")
output += "\n \"parallelizable\" : true,"
end
output += "\n \"target\" : {"
if path.include? "Application.xcodeproj"
@minsOne
minsOne / tuist_generate.sh
Created August 2, 2022 03:23
Tuist unwanted side effects Capture
$ ( tuist generate ) 2>&1 | tee tuist_generate.log
$ cat tuist_generate.log | grep "unwanted side effects" | wc -l | awk '{print $1}'
12
@minsOne
minsOne / iOS Symbol Parse Reference
Last active July 13, 2022 14:48
iOS Symbol Parse Reference
https://github.com/mattgallagher/CwlDemangle
https://stackoverflow.com/a/32171878
iOS List Modules tweak - https://hackcatml.tistory.com/115
SwiftLee 방식의 DI를 하는 것으로 TCA의 Environment 버킷 릴레이를 그만두고 싶은 이야기 - https://zenn.dev/yimajo/articles/e9f72549270873
Nest.js는 실제로 어떻게 의존성을 주입해줄까? - https://velog.io/@coalery/nest-injection-how
# 1. use xcodebuild
xcodebuild -scheme MyScheme -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13' -derivedDataPath '../dd' clean build
import RxSwift
import RxCocoa
@dynamicMemberLookup
protocol DynamicMemberLookupableObservableType: AssociateObservable {
subscript<T>(dynamicMember keyPath: KeyPath<Value, T>) -> Observable<T> { get }
}
extension DynamicMemberLookupableObservableType {
subscript<T>(dynamicMember keyPath: KeyPath<Value, T>) -> Observable<T> {
#!/bin/bash
BUILD_DIRECTORY="Build"
function archive_project() {
project_name=$1
framework_name=$2
# Archive iOS project.
xcodebuild archive\
//
// ViewController.swift
// SampleApp
//
// Created by minsOne on 2022/01/18.
//
import UIKit
import PinLayout
import FlexLayout