A lightweight inapp HTTP requests logger for your iOS and tvOS apps.
- Simply log requests in your app with 2 lines of code.
- Magnified JSON view.
- cURL sharing.
- JSON file sharing.
- Copy a single row on long press.
Use SPM:
- In Xcode, go to File -> Add packages...
- In the prompt's search bar, copy and paste this URL:
https://github.com/RCaroff/RCProxy.git
- Select RCProxy an click on
Add Package
import RCProxy
- When you want to start logging, just write
RCProxy.start()
- When you want to show the interface, just use
RCProxy.show(in: UIViewController)
- If you want to present the viewController in a different way, you can simply get the instance with
RCProxy.viewController
. - From SwiftUI view, use
RCProxy.view
:
@State var showRequests: Bool = false
var body: some View {
Button {
showRequests = true
} label: {
Text("Show requests")
}
.sheet(isPresented: $showRequests) {
RCProxy.view
}
}
- Choose the type of storage you want between
.session
,.userDefaults
and.database
Be sure to setup this BEFORE callingRCProxy.start()
.
Example:
RCProxy.storageType = .database
RCProxy.start()
Default value is .session
.session
: Your requests will be stored in a singleton and will be cleared when app is terminated.userDefaults
: Your requests will be stored in UserDefaults.standard
instance, and will persist between sessions but it will allow only a limited amount of data..database
: Your requests will be stored in a sqlite file on the phone. It uses CoreData behind the hood.
Feel free to contribute and / or open issues!