Contents

mukilarasan-ravi/mrfilebrowser

A comprehensive SwiftUI framework that provides powerful file browsing and management capabilities for iOS applications.

Overview

MRFileBrowser offers two main components:

  • FileBrowserRootView: A full-featured file browser with WiFi sharing capabilities, customizable themes, and advanced server configurations.
  • FolderPickerView: A reusable component that presents an expandable file system tree for selecting files or folders, with support for single/multiple selection modes and file type filtering.

Installation

CocoaPods

Add the following line to your Podfile:

pod 'MRFileBrowser', '~> 1.0.0'

Then run:

pod install

Swift Package Manager

Xcode Integration
  1. In Xcode, go to FileAdd Package Dependencies...
  2. Enter the repository URL:

`` https://github.com/mukilarasan-ravi/MRFileBrowser.git ``

  1. Select the version rule (e.g., "Up to Next Major Version" with "1.0.0")
  2. Click Add Package
Package.swift

Add the following dependency to your Package.swift:

dependencies: [
    .package(url: "https://github.com/mukilarasan-ravi/MRFileBrowser.git", from: "1.0.0")
],
targets: [
    .target(
        name: "YourTarget",
        dependencies: ["MRFileBrowser"]
    )
]

Usage

FileBrowserRootView Basic config

import SwiftUI
import MRFileBrowser

struct ContentView: View {
    @State private var folderURL: URL? = nil
    @State private var titleName: String = "My File Browser"
    
    var body: some View {
        // Your UI to trigger file browser
        Button("Open File Browser") {
            folderURL = getDocumentsDirectory()
        }
        .fullScreenCover(item: $folderURL) { url in
            FileBrowserRootView(
                folderURL: url,
                titleName: $titleName,
                serverConfiguration: .default,
                themeConfiguration: .blue
            )
        }
    }
}

Screenshots

Theme Customization

| Blue Theme | Green Theme | |------------|-------------| | [Blue Theme] | [Green Theme] |

View Modes

| List View | Grid View | |-----------|-----------| | [List View] | [Grid View] |

Search Functionality

| List Search | Grid Search | |-------------|-------------| | [Search List View] | [Search Grid View] |

Sorting Options

| Name Ascending | Name Descending | |----------------|-----------------| | [Sort Name Ascending] | [Sort Name Descending] |

For more details, see FileBrowserRootView Documentation.

FileBrowserRootView Demonstrations

🎥 Watch FileBrowser Demo Video

Click the link above to download and view the demonstration video

FolderPickerView Basic config

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

    var body: some View {
        Button("Pick Folder") { showPicker = true }
            .sheet(isPresented: $showPicker) {
                FolderPickerView(
                    configuration: FolderPickerConfiguration(
                        title: "Choose Destination",
                        allowedRootPath: FileManager.default
                            .urls(for: .documentDirectory, in: .userDomainMask)[0]
                    ),
                    delegate: myDelegate
                )
            }
    }
}

UIKit

let config = FolderPickerConfiguration(
    title: "Select Folder",
    allowedRootPath: rootURL
)
let picker = FolderPickerViewController(configuration: config)
picker.delegate = self
picker.modalPresentationStyle = .overFullScreen
picker.modalTransitionStyle = .crossDissolve
present(picker, animated: true)

FolderPickerView Screenshots

Selection Modes

| Single Selection | Multi Selection | |------------------|-----------------| | [Folder Single Selection] | [File Multi Selection] |

Content Types

| Files Only | Files & Folders | |------------|-----------------| | [File Single Selection] | [Files and Folders Multi Selection] |

Additional Examples

[File Selection Example]

FolderPickerView Demonstrations

| Demo Video 1 | Demo Video 2 | |--------------|---------------| | 🎥 Folder & File Picker Demo 1 | 🎥 Folder & File Picker Demo 2 | | Single selection demo | Multi selection demo |

For more details, see FolderPickerView Documentation.

Package Metadata

Repository: mukilarasan-ravi/mrfilebrowser

Default branch: main

README: README.md