Skip to content

Commit 5c7609e

Browse files
committed
Move SwiftPM package to repository root
1 parent f057958 commit 5c7609e

File tree

19 files changed

+63
-72
lines changed

19 files changed

+63
-72
lines changed

DebugLayout/.gitignore

-9
This file was deleted.

DebugLayout/README.md

-23
This file was deleted.

LayoutInspector.xcodeproj/project.pbxproj DemoApp/LayoutInspector.xcodeproj/project.pbxproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
5D2245F228D8FDB400E84C7D /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D2245F128D8FDB400E84C7D /* ContentView.swift */; };
1212
5D2245F428D8FDB500E84C7D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5D2245F328D8FDB500E84C7D /* Assets.xcassets */; };
1313
5D2245F828D8FDB500E84C7D /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5D2245F728D8FDB500E84C7D /* Preview Assets.xcassets */; };
14-
5D8B5F7228E600FA00CF3721 /* DebugLayout in Frameworks */ = {isa = PBXBuildFile; productRef = 5D8B5F7128E600FA00CF3721 /* DebugLayout */; };
14+
5D5B048C2921268800758B21 /* DebugLayout in Frameworks */ = {isa = PBXBuildFile; productRef = 5D5B048B2921268800758B21 /* DebugLayout */; };
1515
/* End PBXBuildFile section */
1616

1717
/* Begin PBXFileReference section */
@@ -21,7 +21,7 @@
2121
5D2245F328D8FDB500E84C7D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2222
5D2245F528D8FDB500E84C7D /* LayoutInspector.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LayoutInspector.entitlements; sourceTree = "<group>"; };
2323
5D2245F728D8FDB500E84C7D /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
24-
5D8B5F6F28E6003000CF3721 /* DebugLayout */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = DebugLayout; sourceTree = "<group>"; };
24+
5D5B048A2921266100758B21 /* SwiftUI-LayoutInspector */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "SwiftUI-LayoutInspector"; path = ..; sourceTree = "<group>"; };
2525
5DB6BE4F28DE4D4E00280F5E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
2626
/* End PBXFileReference section */
2727

@@ -30,7 +30,7 @@
3030
isa = PBXFrameworksBuildPhase;
3131
buildActionMask = 2147483647;
3232
files = (
33-
5D8B5F7228E600FA00CF3721 /* DebugLayout in Frameworks */,
33+
5D5B048C2921268800758B21 /* DebugLayout in Frameworks */,
3434
);
3535
runOnlyForDeploymentPostprocessing = 0;
3636
};
@@ -42,7 +42,7 @@
4242
children = (
4343
5DB6BE4F28DE4D4E00280F5E /* README.md */,
4444
5D2245EE28D8FDB400E84C7D /* LayoutInspector */,
45-
5D8B5F6F28E6003000CF3721 /* DebugLayout */,
45+
5D5B048A2921266100758B21 /* SwiftUI-LayoutInspector */,
4646
5D2245ED28D8FDB400E84C7D /* Products */,
4747
5D8B5F7028E600FA00CF3721 /* Frameworks */,
4848
);
@@ -102,7 +102,7 @@
102102
);
103103
name = LayoutInspector;
104104
packageProductDependencies = (
105-
5D8B5F7128E600FA00CF3721 /* DebugLayout */,
105+
5D5B048B2921268800758B21 /* DebugLayout */,
106106
);
107107
productName = LayoutInspector;
108108
productReference = 5D2245EC28D8FDB400E84C7D /* LayoutInspector.app */;
@@ -375,7 +375,7 @@
375375
/* End XCConfigurationList section */
376376

377377
/* Begin XCSwiftPackageProductDependency section */
378-
5D8B5F7128E600FA00CF3721 /* DebugLayout */ = {
378+
5D5B048B2921268800758B21 /* DebugLayout */ = {
379379
isa = XCSwiftPackageProductDependency;
380380
productName = DebugLayout;
381381
};
File renamed without changes.
File renamed without changes.

DemoApp/README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# SwiftUI Layout Inspector
2+
3+
Ole Begemann, 2022-09
4+
5+
Based on: [objc.io, Swift Talk episode 318, Inspecting SwiftUI's Layout Process (2022-08)](https://talk.objc.io/episodes/S01E318-inspecting-swiftui-s-layout-process)
6+
7+
Inspect the layout algorithm of SwiftUI views, i.e. what sizes views propose to
8+
their children and what sizes they return to their parents.
9+
10+
![Layout Inspector screenshot on iPhone simulator](assets/LayoutInspector-screenshot.png)
11+
12+
## Requirements
13+
14+
iOS 16.0 or macOS 13.0 (requires the `Layout` protocol).
15+
16+
## Instructions
17+
18+
1. Edit the `subject: some View` property in `ContentView`. It should contain
19+
the view tree you want to inspect.
20+
21+
2. Add `.debugLayout()` at each point in the view tree where you want to inspect
22+
the layout algorithm (what sizes are being proposed and returned).
23+
24+
Example of a `subject` property with a few inspection points:
25+
26+
```swift
27+
var subject: some View {
28+
Text("Hello world")
29+
.debugLayout("Text")
30+
.padding(10)
31+
.debugLayout("padding")
32+
.background {
33+
Color.yellow
34+
.debugLayout("yellow")
35+
}
36+
.debugLayout("background")
37+
}
38+
```
39+
40+
4. Build and run the app.
41+
42+
- The subject view is displayed on top.
43+
- The table on the bottom displays the sizes that are being proposed at each
44+
inspection point in the subject view ("Proposal", and the resulting view
45+
sizes ("Response").
46+
- You can tap/click items in the grid to highlight the respective view.
47+
- You can use the sliders to modify the size proposed to the subject view.
48+
- Some views cache certain layout information. Press "Reset layout cache"
49+
after modifying the sliders to reset the caches.
File renamed without changes.

README.md

+8-34
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SwiftUI Layout Inspector
1+
# DebugLayout
22

33
Ole Begemann, 2022-09
44

@@ -7,43 +7,17 @@ Based on: [objc.io, Swift Talk episode 318, Inspecting SwiftUI's Layout Process
77
Inspect the layout algorithm of SwiftUI views, i.e. what sizes views propose to
88
their children and what sizes they return to their parents.
99

10-
![Layout Inspector screenshot on iPhone simulator](assets/LayoutInspector-screenshot.png)
11-
1210
## Requirements
1311

1412
iOS 16.0 or macOS 13.0 (requires the `Layout` protocol).
1513

1614
## Instructions
1715

18-
1. Edit the `subject: some View` property in `ContentView`. It should contain
19-
the view tree you want to inspect.
16+
1. `import DebugLayout`
17+
18+
2. Add `.debugLayout()` at each point in a view tree where you want to inspect
19+
the layout algorithm (what sizes are being proposed and returned).
2020

21-
2. Add `.debugLayout()` at each point in the view tree where you want to inspect
22-
the layout algorithm (what sizes are being proposed and returned).
23-
24-
Example of a `subject` property with a few inspection points:
25-
26-
```swift
27-
var subject: some View {
28-
Text("Hello world")
29-
.debugLayout("Text")
30-
.padding(10)
31-
.debugLayout("padding")
32-
.background {
33-
Color.yellow
34-
.debugLayout("yellow")
35-
}
36-
.debugLayout("background")
37-
}
38-
```
39-
40-
4. Build and run the app.
41-
42-
- The subject view is displayed on top.
43-
- The table on the bottom displays the sizes that are being proposed at each
44-
inspection point in the subject view ("Proposal", and the resulting view
45-
sizes ("Response").
46-
- You can tap/click items in the grid to highlight the respective view.
47-
- You can use the sliders to modify the size proposed to the subject view.
48-
- Some views cache certain layout information. Press "Reset layout cache"
49-
after modifying the sliders to reset the caches.
21+
3. At the top of the view tree you want to inspect, add `.startDebugLayout()`.
22+
23+
See the README of the sample app for a complete example.

0 commit comments

Comments
 (0)