Repository navigation
What's New
-
AVFoundation playback - The new
SwiftSMBAVFoundationproduct streams audio and video from an SMB share intoAVPlayer, reading only the byte ranges the player asks for. See Playing media with AVFoundation.import AVFoundation import SwiftSMBAVFoundation let player = AVPlayer(playerItem: connection.makePlayerItem(at: "Videos/holiday.mp4")) player.play()
-
Image metadata - The new
SwiftSMBEXIFKitproduct reads, edits, and removes the EXIF of remote images with EXIFKit, fetching only the byte ranges that hold metadata. Edits by path go through a temporary file that replaces the original only once the new image is complete. See Reading and editing image metadata.import SwiftSMBEXIFKit // Re-exports EXIFKit. import UIKit let metadata = try await connection.imageMetadata(at: "Photos/IMG_0001.JPG") if let data = try await metadata.readThumbnail(), let thumbnail = UIImage(data: data) { imageView.image = thumbnail }
-
Forking connections -
SMB.Connection.fork()opens another connection to the same share with the same credentials and configuration, so you can run operations in parallel without passing the credentials around again. -
Positional reads and writes -
SMB.File.read(upTo:atOffset:)andSMB.File.write(_:atOffset:)neither use nor move the handle's current offset, so concurrent tasks can read and write different ranges of one handle without coordinating seeks. -
POSIX error codes -
SMB.Error.posixCodereports the POSIX error that matches an SMB error, such asENOENTfor a missing file orEACCESfor access denied. -
Updated requirements - SwiftSMB now requires Swift 6.4 and macOS 11, iOS 14, Mac Catalyst 14, tvOS 14, visionOS 1, or watchOS 7, and declares Android (API 28+) support explicitly, next to Linux.
-
A sample app -
SampleApp/SMB+AVis a minimal SwiftUI app that plays media from an SMB share.
Bug Fixes
- Fixed builds and arithmetic traps on 32-bit watchOS (arm64_32).