Swiftpack.co - Infomaniak/ios-bug-tracker as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Infomaniak.
Infomaniak/ios-bug-tracker 2.0.1
Bug tracker component in Swift to add in iOS apps (internal use)
⭐️ 0
🕓 3 weeks ago
iOS
.package(url: "https://github.com/Infomaniak/ios-bug-tracker.git", from: "2.0.1")

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:

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 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.

struct MyView: View {
    @State private var showingBugTracker = false

    var 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.

myViewController.present(BugTrackerViewController(), animated: true)

GitHub

link
Stars: 0
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics