Repository navigation
Releases: nothingsh/CutawayServer
Release list
1.2.0
CutawayServer now speaks Cutaway protocol 1.2. Cutaway can switch the app's environment without touching the device's settings, shows more of what developers check most often, and your app can add its own attributes and parts to the hierarchy. Clients of protocol 1.0 and 1.1 keep working, and the server sends them only what their version defines.
What's new
Environment
- Switch the app's appearance (light or dark), text size, layout direction, and horizontal and vertical size classes from Cutaway. All five work on iOS 17 and later; on iOS 13 to 16, only the appearance can be switched.
- Overrides reach every window of the app, including windows that appear later, and take precedence over what the app sets on its windows and scenes. Overrides that the app's view controllers and views set still win.
- Cutaway gets its answer once the app has caught up with the change, including views that update a run loop turn later. The next capture shows the new look.
- When the connection closes for any reason, every window goes back to the app's own values.
Attributes
- An Accessibility section: label, hint, value, identifier, traits, and whether the view is an accessibility element. The text attributes and the element flag can be edited.
- Light and dark values of dynamic colors.
- References to other objects that link to them in the hierarchy: a stack view's arranged subviews, a scroll view's delegate, and a table or collection view's data source.
- Table and collection views: number of sections, number of items in total and per section, and visible index paths. Cells give their index path and reuse identifier. A stack view gives the custom spacing after each arranged subview.
- Images in image views and buttons: the image or symbol name, size, scale, rendering mode, and symbol configuration.
- Fonts in labels, text fields and text views: the full font description, its text style, and whether it adjusts to the text size. Whether it adjusts can be edited.
- Labels: the number of lines actually drawn, and whether the text is truncated.
- Reading attributes does not change the app's state. It does not trigger layout, call data sources, or load view controllers' views.
Customizing (guide)
A new extension interface lets your app add to what Cutaway shows. Call it on the main thread, before or after start():
CutawayServer.describe(_:_:)describes the views or layers of a class and its subclasses, with any of these parts:- Attribute groups of your own, shown after Cutaway's. They can be editable.
- Virtual children: parts of the interface a view draws itself, such as the bars of a chart, shown as nodes in the hierarchy.
- A flag that shows the instance collapsed at first.
- A flag that leaves the instance out of every image, for content that is sensitive or cannot be captured.
CutawayServer.registerColor(_:named:)gives a color a name. Color values equal to it, light and dark included, are shown with that name.
In builds without the server, the interface still compiles, and its calls do nothing.
Compatibility
- Works with Cutaway apps of protocol 1.0, 1.1 and 1.2.
- Requirements are unchanged: iOS 13 or later (iOS 15 or later when built with Xcode 27); Xcode 16.3 or later, Swift 6.1 or later, Swift Package Manager.
Installation
.package(url: "https://github.com/nothingsh/CutawayServer", from: "1.2.0")Full changes: 1.1.0...1.2.0
1.1.0
CutawayServer now speaks Cutaway protocol 1.1. Cutaway gets more to show about each object; clients of protocol 1.0 keep working, and the server sends them only what 1.0 defines.
What's new
Hierarchy
- Addresses of every layer, and of the views and view controllers in the tree.
- Where each class comes from (the system or the app), and its nearest known base class.
- Whether each view controller is currently visible.
Attributes
- Attributes come in sections, with units, value limits and clusters of related values.
- The reason an attribute currently has no effect, when it has none.
- System color names, such as
systemBackground, alongside color values. - An attribute that a view and its layer share is reported once, on the view's side. This includes the background color, which is read and edited through
view.backgroundColor: views such asUILabeldraw that one, and leave the layer's empty.
Constraints
- Where each constraint comes from, and the kind of layout guide it refers to.
Compatibility
- Works with Cutaway apps of protocol 1.0 and 1.1.
- Requirements are unchanged: iOS 13 or later (iOS 15 or later when built with Xcode 27); Xcode 16.3 or later, Swift 6.1 or later, Swift Package Manager.
Installation
.package(url: "https://github.com/nothingsh/CutawayServer", from: "1.1.0")Full changes: 1.0.0...1.1.0
1.0.0
The first release of CutawayServer, the iOS SDK that lets Cutaway inspect the view hierarchy of a running app. It speaks Cutaway protocol 1.0.
What Cutaway sees
- The layer tree of every window, with the root views of view controllers and the member variables that hold each layer or view marked.
- For each layer, an image of the layer alone and one with its sublayers, streamed and cancellable.
- The attributes of each layer and view, with the editable ones marked; edits made in Cutaway are applied to the running app.
- The Auto Layout constraints that refer to each view, and whether each one is satisfied.
Built for development
- One line to integrate:
CutawayServer.start(). - Compiled out of Release builds by default; the
ReleaseEnabledtrait opts other configurations in. - Listens on the loopback address only and serves one client at a time. Works in the Simulator and on devices connected over USB.
- Pure Swift, zero third-party dependencies.
Requirements
- iOS 13 or later (iOS 15 or later when built with Xcode 27).
- Xcode 16.3 or later, Swift 6.1 or later, Swift Package Manager.
Installation
.package(url: "https://github.com/nothingsh/CutawayServer", from: "1.0.0")See the README for setup, Debug and Release builds, and performance notes.