Skip to content

Instantly share code, notes, and snippets.

@TuenTuenna
Last active September 3, 2021 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TuenTuenna/01435e6eca22abf7d5ca13bab50ec063 to your computer and use it in GitHub Desktop.
Save TuenTuenna/01435e6eca22abf7d5ca13bab50ec063 to your computer and use it in GitHub Desktop.
qrcode_가이드라인뷰 버그 수정

SwiftUi 정대리 QR_code 강좌 가이드 라인뷰 버그 수정

//
//  QRCodeGuideLineView.swift
//  QRCode_reader_swiftui_tutorial
//
//  Created by Jeff Jeong on 2020/08/07.
//  Copyright © 2020 Tuentuenna. All rights reserved.
//

import SwiftUI

struct QRCodeGuideLineView : View {
    var body: some View {
        GeometryReader{ geometryProxy in
            RoundedRectangle(cornerRadius: 20).stroke(style: StrokeStyle(lineWidth: 10, dash: [11]))
                .frame(width: geometryProxy.size.width / 2, height: geometryProxy.size.height / 3)
                // geometry 프록시로 포지션을 주시면 되요!
                // 이부분 추가해주십쇼!
                .position(x: geometryProxy.size.width / 2, y: geometryProxy.size.height / 2)
                .foregroundColor(Color.yellow)
        }
    }
}

struct QRCodeGuideLineView_Previews: PreviewProvider {
    static var previews: some View {
        QRCodeGuideLineView()
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment