Make NextcloudRemoteInterface initialisable#64
Conversation
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
There was a problem hiding this comment.
Pull Request Overview
This PR makes NextcloudRemoteInterface initialisable by adding an initializer that accepts an optional delegate, and updates the dependency for NextcloudKit in Package.swift to use the branch "work/f-openclass".
- Added an initializer in NextcloudRemoteInterface.swift that sets a delegate via dependency injection.
- Updated Package.swift to use a branch dependency for NextcloudKit instead of a version-based one.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Sources/NextcloudFileProviderKit/Interface/NextcloudRemoteInterface.swift | Added initializer for delegate injection |
| Package.swift | Changed NextcloudKit dependency from a version-based to a branch-based specification |
| public init(delegate: NextcloudKitDelegate? = nil) { | ||
| super.init() | ||
| self.delegate = delegate |
There was a problem hiding this comment.
Ensure that this initializer properly calls the designated initializer of the superclass. If the new initializer is not a designated initializer, consider marking it as a convenience initializer for clarity.
| public init(delegate: NextcloudKitDelegate? = nil) { | |
| super.init() | |
| self.delegate = delegate | |
| public convenience init(delegate: NextcloudKitDelegate? = nil) { | |
| self.init() |
| .upToNextMajor(from: "2.1.2") | ||
| ), | ||
| .package(url: "https://github.com/nextcloud/NextcloudKit", from: "5.0.4"), | ||
| .package(url: "https://github.com/nextcloud/NextcloudKit", branch: "work/f-openclass"), |
There was a problem hiding this comment.
Switching from a version-based dependency to a branch-based dependency may affect build stability. Consider documenting this decision or evaluating if a version-based dependency could be used instead.
| .package(url: "https://github.com/nextcloud/NextcloudKit", branch: "work/f-openclass"), | |
| .package(url: "https://github.com/nextcloud/NextcloudKit", .upToNextMajor(from: "1.0.0")), |
No description provided.