Skip to content

Instantly share code, notes, and snippets.

View AppleCEO's full-sized avatar
💻

사이먼 AppleCEO

💻
View GitHub Profile
@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)")
}
class SmartPhone {
let inch: Double
let isFolded: Bool = false
init(inch: Double) {
self.inch = inch
}
func call(to: String) {
print("calling to \(to)")
class SmartPhone {
let inch: Double
func call(to: String) {
print("calling to \(to)")
}
func showYoutube() {
print("Watching Youtube")
}
}
protocol Coffee {
func drink()
}
struct Americano: Coffee {
func drink() {
print("아메리카노를 마십니다.")
}
}