Skip to content

Instantly share code, notes, and snippets.

View AppleCEO's full-sized avatar
💻

도미닉 AppleCEO

💻
View GitHub Profile
@AppleCEO
AppleCEO / enumAnalyticsEvent.swift
Created August 20, 2025 06:23
enumAnalyticsEvent
enum AnalyticsEvent {
case sendFeedback(userId: String, content: String)
case sendAdditionalData(userId: String, data: [String: String]
case connectAppleHealth(userId: String)
// rest of the cases
}
@AppleCEO
AppleCEO / structAnalyticsEvent.swift
Last active August 19, 2025 08:09
structAnalyticsEvent
struct AnalyticsEvent {
let userId: String
let hasAdditionalData: Bool
let additionalData: [String: String]
let hasFeedback: Bool
let feedbackContent: String
// rest of the properties
}
@AppleCEO
AppleCEO / GetOnly.swift
Last active January 3, 2025 02:15
GetOnly
struct Greeting {
var name: String {
return "도미닉님 안녕하세요"
}
}
var greeting = Greeting()
print(greeting.name)
@AppleCEO
AppleCEO / ViewController.swift
Created September 19, 2022 04:00
생체 인증 예제
//
// ViewController.swift
// ExFaceTouchId
//
//
import UIKit
import LocalAuthentication
class ViewController: UIViewController {
import UIKit
import LocalAuthentication
class ViewController: UIViewController {
@IBOutlet weak var loginButton: UIButton!
enum AuthenticationState {
case loggedin, loggedout
}
// ✅ 현재 로그인 상태에 따른 UI 변화
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
guard let restaurantGrade = RestaurantGrade(rawValue: section) else {
return nil
}
restaurantGradeName = restaurantGrade.getName()
return restaurantGradeName
}
enum RestaurantGrade: Int {
case premium
case superBaemin
case general
func getName() -> String {
switch self {
case .premium: return "프리미엄"
case .superBaemin: return "슈퍼배민"
case .general: return "일반"
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
switch section {
case 0:
return "프리미엄"
case 1:
return "슈퍼배민"
case 2:
return "일반"
default:
return nil
class SmartPhone {
let inch: Double
init(inch: Double) {
self.inch = inch
}
func call(to: String) {
print("calling to \(to)")
}
class SmartPhone {
let inch: Double
init(inch: Double) {
self.inch = inch
}
func call(to: String) {
print("calling to \(to)")
}