Skip to content

kejinlu/SwiftyUploader

Repository files navigation

SwiftyUploader logo

English | 中文

Overview

SwiftyUploader is a file upload server for iOS platform implemented based on SwiftNIO. If your iOS App needs to upload files from a computer or another phone to your App, you can use this library to quickly implement this feature. The Web page part of SwiftyUploader uses the code from GCDWebUploader.

SwiftyUploader logo

Usage

Requirements

  • iOS 14.0+
  • Xcode 14.3
  • Swift 5.8

Integration

You can use The Swift Package Manager for integration. Or you can enter https://github.com/kejinlu/SwiftyUploader.git in the dependency window in Xcode to add dependencies, or directly use local dependencies for testing.

// swift-tools-version:5.8
import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/kejinlu/SwiftyUploader.git", from: "0.0.1"),
    ]
)

Then run swift build whenever you get prepared.

Code

let uploader = SwiftyUploader()

// Starting the server:
uploader.run()

// Stopping the server:
uploader.stop()

If you need web page support for international languages, you need to add the following settings in the app's info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleAllowMixedLocalizations</key>
    <true/>
</dict>
</plist>