Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save steveriggins/5bf7222684fb74bcefac66d9a7dc7a18 to your computer and use it in GitHub Desktop.
Save steveriggins/5bf7222684fb74bcefac66d9a7dc7a18 to your computer and use it in GitHub Desktop.
SwiftUI X
//
// 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