Skip to content

Instantly share code, notes, and snippets.

View eraser3031's full-sized avatar
🌐
Working from everywhere

Yaehoon Kim eraser3031

🌐
Working from everywhere
  • Hanam
View GitHub Profile
@juliensagot
juliensagot / VariableBlurView.swift
Last active April 15, 2025 21:17
SwiftUI variable blur view
import Foundation
import SwiftUI
import UIKit
extension UIBlurEffect {
public static func variableBlurEffect(radius: Double, imageMask: UIImage) -> UIBlurEffect? {
let methodType = (@convention(c) (AnyClass, Selector, Double, UIImage) -> UIBlurEffect).self
let selectorName = ["imageMask:", "effectWithVariableBlurRadius:"].reversed().joined()
let selector = NSSelectorFromString(selectorName)
@godrm
godrm / swift_api_guideline.md
Last active February 20, 2025 11:30
μŠ€μœ„ν”„νŠΈ API κ°€μ΄λ“œλΌμΈ

1. μŠ€νƒ€μΌ/문법 리뷰

1-1 μŠ€μœ„ν”„νŠΈ API λ””μžμΈ κ°€μ΄λ“œλΌμΈ

https://swift.org/documentation/api-design-guidelines/

  • μ‚¬μš©ν•  λ•Œ κΈ°μ€€μœΌλ‘œ λͺ…ν™•ν•˜κ²Œ μž‘μ„±ν•˜λŠ” 게 κ°€μž₯ μ€‘μš”ν•œ μ§€ν–₯점이닀. λ©”μ†Œλ“œλ‚˜ ν”„λ‘œνΌν‹° 같은 개발 μš”μ†ŒλŠ” ν•œ 번만 μ„ μ–Έν•˜κ³  반볡적으둜 μ‚¬μš©ν•œλ‹€. APIλ₯Ό λ§Œλ“€ λ•ŒλŠ” μ‚¬μš©ν•˜κΈ° λͺ…ν™•ν•˜κ³  νŽΈν•˜κ²Œ λ§Œλ“€μ–΄μ•Ό ν•œλ‹€. 섀계λ₯Ό 검증할 λ•Œ μ„ μ–Έ 뢀뢄을 μ½λŠ” κ²ƒλ§ŒμœΌλ‘œλŠ” λΆ€μ‘±ν•˜λ‹€. κ·Έ λŒ€μ‹  μ‚¬μš©ν•˜λŠ” μƒν™©μ—μ„œ λ§₯락에 맞고 λͺ…ν™•ν•œ μ§€ 늘 κ³ λ €ν•΄μ•Ό ν•œλ‹€.

  • λͺ…ν™•ν•œ ν‘œν˜„μ΄ μ••μΆ•ν•œ 간결성보닀 더 μ€‘μš”ν•˜λ‹€. μŠ€μœ„ν”„νŠΈ μ½”λ“œλŠ” μ••μΆ•ν•΄μ„œ κ°„κ²°ν•˜κ²Œ μž‘μ„±ν•  수 μžˆμ§€λ§Œ, 단지 κΈ€μžμˆ˜λ₯Ό μ€„μ—¬μ„œ κ°€μž₯ 짧은 μ½”λ“œλ₯Ό λ§Œλ“œλŠ” 게 λͺ©ν‘œλŠ” μ•„λ‹ˆλ‹€. μŠ€μœ„ν”„νŠΈ μ½”λ“œμ˜ 간결성은 μžμ—°μŠ€λŸ½κ²Œ 반볡적으둜 μž¬μ‚¬μš©ν•˜λŠ” μ½”λ“œ(boilerplate)λ₯Ό μ€„μ΄λŠ” κΈ°λŠ₯κ³Ό κ°•ν•œ νƒ€μž… μ‹œμŠ€ν…œμ˜ λΆ€μˆ˜νš¨κ³Όλ‘œ λ“œλŸ¬λ‚  뿐이닀.