Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/infomaniak/ios-bug-tracker
Bug tracker component in Swift to add in iOS apps (internal use)
https://github.com/infomaniak/ios-bug-tracker
Last synced: about 2 months ago
JSON representation
Bug tracker component in Swift to add in iOS apps (internal use)
- Host: GitHub
- URL: https://github.com/infomaniak/ios-bug-tracker
- Owner: Infomaniak
- License: gpl-3.0
- Created: 2022-07-08T13:49:51.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-11T06:26:09.000Z (2 months ago)
- Last Synced: 2024-11-07T09:51:59.103Z (about 2 months ago)
- Language: Swift
- Size: 92.8 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# InfomaniakBugTracker
Bug tracker component in Swift to add in iOS apps (internal use).
## Installation
1. In your Xcode project, go to: File > Swift Packages > Add Package Dependency…
2. Enter the package URL: `[email protected]:Infomaniak/ios-bug-tracker.git`## Usage
### Configuration
Before presenting the bug tracker, you need to configure it:
```swift
BugTrackerInfo(
route: "route", // route to find the project bucket (optional)
project: "app-mobile-mail", // project name
serviceId: 0 // service ID to find the project bucket (optional)
)
```### Checking that the user is staff
The bug tracker component can only be used by staff accounts. To check this, use the `isStaff` property of the `UserProfile` object (from [InfomaniakCore](https://github.com/Infomaniak/ios-core) package).
Note: the token needs the `user_info_staff` scope to be able to fetch this property.
### Present the view using SwiftUI
To present the bug tracker component using SwiftUI, simply return a `BugTrackerView` in a `sheet` or `NavigationLink`.
```swift
struct MyView: View {
@State private var showingBugTracker = falsevar body: some View {
VStack {
Text("My view")
Button("Present bug tracker") {
showingBugTracker = true
}
}
.sheet(isPresented: $showingBugTracker) {
BugTrackerView(isPresented: $showingBugTracker)
}
}
}
```### Present the view using UIKit
To present the bug tracker component using UIKit, simply present a `BugTrackerViewController` instance.
```swift
myViewController.present(BugTrackerViewController(), animated: true)
```