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 / gist:3bbd0c491ea722fa8f04426775393fa2
Last active September 3, 2021 07:11
Android Compose Animation - Shake hands

안드 콤포즈 손흔드는 애니메이션

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            ShakeHandViewTheme {
                // A surface container using the 'background' color from the theme
                Surface(color = MaterialTheme.colors.background) {
                    ShakeHandView()
@TuenTuenna
TuenTuenna / gist:f49b7bc3fb18a31808e711f13f23ce1f
Last active September 3, 2021 07:10
SwiftUi Animation - 02 Bicycle Arrived anim

SwiftUi 자전거 애니메이션

//  Created by Jeff Jeong on 2021/06/16.
//

import Foundation
import SwiftUI

struct BicycleView: View {
    

안드 콤포즈 자전거 애니메이션

@Composable
fun BicycleView(){

    // 벡터 이미지 가져오기
    val bicycleImg: Painter = painterResource(id = R.drawable.ic_bicycle)
    val infiniteTransition = rememberInfiniteTransition() // 무한 애니메이션
@TuenTuenna
TuenTuenna / gist:b59b502e2c319770f2ec476ff55b1957
Last active September 3, 2021 07:10
ios_swiftui_webview_control_snippet

SwiftUi 웹뷰 기본적인 세팅입니다!

import SwiftUI
import WebKit

// swiftui 자체 웹뷰가 아직 없기 때문에 UIView representable 상속 받아 만들기 
struct MyWebView: UIViewRepresentable {
    
@TuenTuenna
TuenTuenna / gist:0a94ac776725789f4857743540a60bbf
Last active September 3, 2021 07:10
UIKit 테이블뷰 데이터 추가시 옵셋 유지 하고 리로드

UIKit 테이블뷰 데이터 추가시 옵셋 유지 하고 리로드

extension UITableView {
    public func reloadDataAndKeepOffset() {
        // stop scrolling
        setContentOffset(contentOffset, animated: false)
 
@TuenTuenna
TuenTuenna / gist:975ab1f07af2ea053f37f64a3e1a1006
Last active September 3, 2021 07:08
SwiftUi 풀스크린 모디파이어

SwiftUi 풀 스크린 모디파이어

import Foundation
import SwiftUI


/// 풀 스크린 모디파이어
@TuenTuenna
TuenTuenna / gist:d1ed499c1e8b1f776ce8ddbaf94fd11d
Last active November 3, 2022 08:37
SwiftUi 노치 디자인 여부 체크 입니다

노치 디자인 여부 체크

import Foundation
import UIKit

// UIDevice 익스텐션으로 만들어줍니다.
extension UIDevice {
 var hasNotch: Bool {
@TuenTuenna
TuenTuenna / SwiftUi-hexcode-color.md
Created September 3, 2021 07:07
SwiftUi HexCode 로 Color 가져오기

SwiftUi 에서 HexCode 로 색 가져오기 Extension 입니다

// hex 코드를 사용하기 위한 Color Extension
extension Color {
    init(hex: UInt, alpha: Double = 1) {
        self.init(
            .sRGB,
            red: Double((hex >> 16) & 0xff) / 255,
 green: Double((hex >> 08) & 0xff) / 255,
@TuenTuenna
TuenTuenna / uikit-top-vc.md
Last active November 3, 2022 11:46
UIkit 에서 재귀함수를 활용한 최상단 뷰컨트롤러 가져오기 입니다!

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

// UIApplication 익스텐션
extension UIApplication {
    
    func topViewController() -> UIViewController? {
       // 애플리케이션 에서 키윈도우로 제일 아래 뷰컨트롤러를 찾고
       // 해당 뷰컨트롤러를 기점으로 최상단의 뷰컨트롤러를 찾아서 반환
        
@TuenTuenna
TuenTuenna / gist:3382ce64d1d0833b5d5127b26d324594
Last active October 12, 2021 04:06
iOS 15 Uikit 네비게이션바 투명 이슈 발생시

iOS 15 Uikit 네비게이션바 투명 이슈 발생시

AppDelegate.swift 파일 에서

    // 앱을 실행할 때
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        
 // 이렇게 넣어주면 해결됩니다.