Created
June 30, 2019 01:40
-
-
Save steveriggins/5bf7222684fb74bcefac66d9a7dc7a18 to your computer and use it in GitHub Desktop.
SwiftUI X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// X | |
// | |
// Created by Steve Riggins on 6/29/19. | |
// Copyright © 2019 Steve Riggins. All rights reserved. | |
// | |
import SwiftUI | |
struct ContentView : View { | |
var body: some View { | |
GeometryReader { proxy in | |
Path { path in | |
let f = proxy.frame(in: .local) | |
path.move(to: .init(x: f.minX, y: f.minY)) | |
path.addLine(to: .init(x: f.maxX, y: f.maxY)) | |
path.move(to: .init(x: f.maxX, y: f.minY)) | |
path.addLine(to: .init(x: f.minX, y: f.maxY)) | |
} | |
.strokedPath(StrokeStyle()) | |
} | |
} | |
} | |
#if DEBUG | |
struct ContentView_Previews : PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
.frame(width: 50, height: 50) | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment