Skip to content

Instantly share code, notes, and snippets.

View natmark's full-sized avatar

Atsuya Sato natmark

View GitHub Profile
@natmark
natmark / ViewDebugData.swift
Last active September 14, 2023 07:20
https://techlife.cookpad.com/entry/2023/09/14/160000 で紹介している _viewDebugData() の出力結果です
[
SampleSwiftUIView.ViewDebugData(
data: [
SwiftUI._ViewDebug.Property.type: SwiftUI._SafeAreaInsetsModifier,
SwiftUI._ViewDebug.Property.size: (393.0, 852.0),
SwiftUI._ViewDebug.Property.position: (0.0, 0.0),
SwiftUI._ViewDebug.Property.transform: space(HostingViewCoordinateSpace()), space(UIKitHostContainerCoordinateSpace()),
SwiftUI._ViewDebug.Property.value: SwiftUI._SafeAreaInsetsModifier(elements: [SwiftUI.SafeAreaInsets.Element(regions: SwiftUI.SafeAreaRegions(rawValue: 1), insets: SwiftUI.EdgeInsets(top: 59.0, leading: 0.0, bottom: 34.0, trailing: 0.0))], nextInsets: nil),
SwiftUI._ViewDebug.Property.displayList: (display-list\n (item #:identity 1 #:version 3\n (frame (21.666666666666664 416.66666666666663; 16.666666666666664 15.333333333333332))\n (content-seed 7)\n (image #:size (16.666666666666664 15.333333333333332)))\n (item #:identity 2 #:version 4\n (frame (44.0 414.3333333333333; 63.666666666666664 20.333333333333332))\n (content-
@natmark
natmark / DebugFrameInspector.swift
Last active October 24, 2023 01:35
https://techlife.cookpad.com/entry/2023/09/14/160000 で紹介しているUI要素のフレーム描画を行うデバッグ用のView実装です
// This project is licensed under the MIT No Attribution license.
//
// Copyright (c) 2023 Cookpad Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so.