SwiftUI
Previews
Section titled “Previews”Previews are development-only code. A view that is only referenced from a preview isn’t used by your application, so by default Periphery does not treat that preview as a reference. A view referenced only from a #Preview macro is reported as unused. For types conforming to PreviewProvider, both the provider type and the view it exercises are reported as unused.
struct MyView: View { // 'MyView' is unused var body: some View { Text("Hello") }}
#Preview { MyView()}If you’d rather keep previews and the views they reference, retain them with --retain-swiftui-previews.
Application Delegate Adaptors
Section titled “Application Delegate Adaptors”Properties declared with @UIApplicationDelegateAdaptor or @NSApplicationDelegateAdaptor in your @main type are automatically retained, along with the delegate types they reference. No configuration is required.
Library Content Providers
Section titled “Library Content Providers”Types conforming to LibraryContentProvider are automatically retained, as they’re referenced by Xcode’s library rather than by your code.