FlyreelPanorama is a Swift framework for capturing a 360 panorama, handling the entire flow from tutorial and 360 capture to provide the local file URL paths of the final captured bundle. This framework supports integration via Swift Package Manager, and can be used in both SwiftUI and UIKit codebases.
- SwiftUI/UIKit support
- Tutorial flow
- 360 panorama capture
- Local paths to stored bundle files
To add the package to your app:
- Open Xcode and navigate to File > Add Packages.
- Enter the repository URL: https://github.com/Flyreel/flyreel-panorama-ios.
- Select the appropriate dependency rule (e.g., "Up to Next Major Version") and add it to your project.
- Import the module where needed:
import FlyreelPanorama
For more information, refer to Appleās official guide.
To use the Panorama capture flow in SwiftUI, call Panorama.push(navigation:clientID:onCompletion:)
to return a view that can be pushed into a navigation context. When the flow completes, the onCompletion
handler is called with the final scan file URLs.
import SwiftUI
import FlyreelPanorama
struct ContentView: View {
@State private var navigateToCapture = false
var body: some View {
NavigationView {
VStack {
NavigationLink(
destination: Panorama.push(
navigation: $navigateToCapture,
clientID: "your-client-id",
onCompletion: { urls in
// Handle the scan URLs
print("Scan URLs: \(urls)")}
),
isActive: $navigateToCapture,
) {
Text("Start Panorama Capture")
}
}
}
}
}
To use the Panorama capture flow in UIKit, call Panorama.push(from:clientID:onCompletion:)
to push the view controller onto a UINavigationController
. When the flow completes,
the onCompletion
handler is called with the final [URL].
import UIKit
import FlyreelPanorama
class ViewController: UIViewController {
@IBAction func startPanoramaFlow(_ sender: Any) {
guard let navController = self.navigationController else { return }
Panorama.push(
from: navController,
clientID: "your-client-id",
onCompletion: { urls in
// Handle the scan URLs
print("Scan URLs: \(urls)")
}
)
}
}
View instance modifier that presents panorama capture view as a full-screen cover.
func panoramaCaptureView(
isPresented: Binding<Bool>,
clientID: String,
onCaptureCompletion: @escaping ([URL]) -> Void
) -> some View
isPresented
: A binding that controls whether the capture view is presented.clientID
: A string representing the client ID required for authentication.onCaptureCompletion
: A closure executed upon scan completion, providing an array of local URLs to the captured files.
View controller extension that presents panorama capture view as a full-screen cover.
func presentPanoramaCaptureView(
clientID: String,
onCaptureCompletion: @escaping ([URL]) -> Void
)
clientID
: A string representing the client ID required for authentication.onCaptureCompletion
: A closure executed upon scan completion, providing an array of local URLs to the captured files.
To use the camera in your app, you need to add the following to your app's Info.plist
file:
NSCameraUsageDescription
: A message that tells the user why your app needs access to the camera.
Here is an example of the key and value:
<key>NSCameraUsageDescription</key>
<string>We need access to the camera to capture images of your claim.</string>