Skip to content

Instantly share code, notes, and snippets.

View TuenTuenna's full-sized avatar
😍
Happy coding 👏

개발하는 정대리 TuenTuenna

😍
Happy coding 👏
View GitHub Profile
@TuenTuenna
TuenTuenna / VersionCheck.md
Last active December 29, 2023 05:53
앱스토어 버전 체크

앱 버전 체커

import Foundation
import Alamofire

extension String {
    func versionCompare(_ otherVersion: String) -> ComparisonResult {
        let versionDelimiter = "."
@TuenTuenna
TuenTuenna / next.config.md
Last active October 28, 2023 12:16
next.config.js 파일 -> cors 세팅
/** @type {import('next').NextConfig} */
const nextConfig = {
    async headers() {
        return [
            {
                // matching all API routes
                source: "/api/:path*",
 headers: [
//
// UIBarButtonItem+Badge.swift
// PiGuardMobile
//
// Created by Stefano Vettor on 12/04/16.
// Copyright © 2016 Stefano Vettor. All rights reserved.
//
import UIKit
@TuenTuenna
TuenTuenna / changeRoot.md
Last active April 14, 2023 13:35
ChangeRoot

UIkit 에서 루트 바꾸기

// UIApplication 익스텐션
extension UIApplication {
    
    func changeRoot(_ vc: UIViewController){
       // 애플리케이션 에서 키윈도우로 첫번째 윈도우 씬을 가져오고
        let scenes = UIApplication.shared.connectedScenes
 let windowScenes = scenes.first as? UIWindowScene
@TuenTuenna
TuenTuenna / optional_tupple_unwrapping.md
Last active February 10, 2023 01:32
Optiona Tupple + Unwrapping
@TuenTuenna
TuenTuenna / reorder array.md
Created December 16, 2022 16:19
reorder array with ids array
struct Model {
    
    var id : Int
    var name : String
}

var modelArray = [
    Model(id: 0, name: "하하"),
@TuenTuenna
TuenTuenna / password check.md
Last active December 12, 2022 12:20
password check
import Foundation
import Combine

class TestVM : ObservableObject {
    
    
 @Published var password : String = ""
@TuenTuenna
TuenTuenna / URLSession tutorial .md
Last active November 22, 2022 11:44
iOS URLSession API 호출 개념 정리
@TuenTuenna
TuenTuenna / uikit-top-vc.md
Last active November 3, 2022 11:46
UIkit 에서 재귀함수를 활용한 최상단 뷰컨트롤러 가져오기 입니다!

UIkit 에서 재귀함수를 활용한 최상단 뷰컨트롤러 가져오기 입니다!

// UIApplication 익스텐션
extension UIApplication {
    
    func topViewController() -> UIViewController? {
       // 애플리케이션 에서 키윈도우로 제일 아래 뷰컨트롤러를 찾고
       // 해당 뷰컨트롤러를 기점으로 최상단의 뷰컨트롤러를 찾아서 반환
        
@TuenTuenna
TuenTuenna / gist:d1ed499c1e8b1f776ce8ddbaf94fd11d
Last active November 3, 2022 08:37
SwiftUi 노치 디자인 여부 체크 입니다

노치 디자인 여부 체크

import Foundation
import UIKit

// UIDevice 익스텐션으로 만들어줍니다.
extension UIDevice {
 var hasNotch: Bool {