Skip to content

Swift Package Manager support without RxSwift dependency - #1341

Merged
martinpucik merged 18 commits into
developmentfrom
spm
Jun 30, 2020
Merged

martinpucik merged 18 commits into
developmentfrom
spm

Conversation

@martinpucik

@martinpucik martinpucik commented Apr 29, 2020 •

Copy link
Copy Markdown
Contributor

What does this implement/fix? Explain your changes.

  • Added support for Swift Package Manager with updated package description
  • Using InpuBarAccessoryView dependency without linking RxSwift
  • 👻

Does this close any currently open issues?

Any relevant logs, error output, etc?

  • N/A

Any other comments?

  • N/A

Where has this been tested?

Devices/Simulators: N/A

iOS Version: iOS 11 - 13

Swift Version: 5.2

MessageKit Version: 3

Using InputAccessoryView dependency without Rx
Add missing imports
Comment thread Package.swift
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/classdojo/InputBarAccessoryView", .branch("dropRxSPM"))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linking to fork without RxSwift dependency while waiting on merging this to InputBarAccessoryView

@Kaspik Kaspik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • needs readme update to inform users about CocoaPods able to have RxSwift extensions where SPM doesn't have this option
  • needs changelog update
  • let's wait about two/three days and see if IBAV will be merged

@kinoroy kinoroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't merge this until SE-0271 is implemented in Swift 5.3 which will allow SPM to support bundling assets.
No solid timeline on 5.3 but it was branched from master last week so will probably have a bake-in period of a few months for them to iron it out.

I recreated the example app repo here using this branch as the MessageKit dependency (through SPM) and it crashes with

Fatal error: MessageKit: Could not create path to the assets bundle.

@Kaspik

Kaspik commented Apr 29, 2020 •

Copy link
Copy Markdown
Member

@kinoroy I don't see AppDelegate.swift in your project after downloading it.

Also, we use it through SPM on our project whole day today without any issue. I'll check your project for sure, but I believe it should work as long as the assets are included only in the framework - you just can't load them in your main project manually.

EDIT: Also sounds are missing.

@kinoroy

kinoroy commented Apr 29, 2020

Copy link
Copy Markdown
Member

@Kaspik My bad, they weren't added into the repo properly but they were there locally when I tested it. Should be fixed now

@kinoroy

kinoroy commented Apr 29, 2020

Copy link
Copy Markdown
Member

@Kaspik Do you use the typing indicator in your project?

@Kaspik

Kaspik commented Apr 29, 2020

Copy link
Copy Markdown
Member

Ohhh, yeah, tested your Example app it does work for Advanced example etc (because of custom cell layout), but it doesn't work for default / basic one.

Sad story. It's still helpful for users with non-default styling, but yeah we will need to wait for XCode 12.

@martinpucik

Copy link
Copy Markdown
Contributor Author

Yes, unfortunately there is still no support for assets in SPM package :(

But, as .custom MessageStyle is working fine and someone (like me 😹) may find it useful, I'd like to keep this PR and branch open.

We could then point any questions about SPM to this conversation

@kinoroy kinoroy added the blocked blocked on an external factor (other PR, external library, iOS/Swift version, etc) label May 14, 2020
@codecov

codecov Bot commented Jun 10, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #1341 into development will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #1341   +/-   ##
============================================
  Coverage        64.75%   64.75%           
============================================
  Files               68       68           
  Lines             3305     3305           
============================================
  Hits              2140     2140           
  Misses            1165     1165           
Impacted Files Coverage Δ
.../Controllers/MessagesViewController+Keyboard.swift 19.04% <ø> (ø)
...rces/Controllers/MessagesViewController+Menu.swift 10.52% <ø> (ø)
Sources/Extensions/CGRect+Extensions.swift 100.00% <ø> (ø)
...ces/Extensions/NSAttributedString+Extensions.swift 100.00% <ø> (ø)
Sources/Extensions/UIColor+Extensions.swift 58.18% <ø> (ø)
Sources/Extensions/UIEdgeInsets+Extensions.swift 100.00% <ø> (ø)
Sources/Layout/AudioMessageSizeCalculator.swift 63.63% <ø> (ø)
Sources/Layout/ContactMessageSizeCalculator.swift 0.00% <ø> (ø)
Sources/Layout/LocationMessageSizeCalculator.swift 63.63% <ø> (ø)
Sources/Layout/MediaMessageSizeCalculator.swift 73.33% <ø> (ø)
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2572e3c...4761b3d. Read the comment docs.

martinpucik and others added 14 commits June 24, 2020 08:24
Added Package description with Assets support for Swift 5.3
Remove .swiftpm temp files
Ignore .swiftpm temp files
Remove Package.resolved
Ignore Package.resolved
Assets in framework project
Try Bundle.module to get MessageKit bundle
SPM condition in bundle
Remove previous Swift 5.2 version Package.swift
Update Readme with SPM installation
@martinpucik

Copy link
Copy Markdown
Contributor Author

@kinoroy @Kaspik I added support Swift Package with assets in Swift 5.3/Xcode 12.
I'll keep a branch for Swift 5.2 SPM support without assets up spm-5_2

@martinpucik
martinpucik merged commit 81395b6 into development Jun 30, 2020
@martinpucik
martinpucik deleted the spm branch June 30, 2020 15:24
Patrick-Kladek pushed a commit to medbee/MessageKit that referenced this pull request Oct 25, 2023
…1341)

* feat: SPM support

Using InputAccessoryView dependency without Rx

* feat: SPM support

Add missing imports

* feat: Swift Package Manager support

Added Package description with Assets support for Swift 5.3

* feat: Swift Package Manager support

Remove .swiftpm temp files

* feat: Swift Package Manager support

Ignore .swiftpm temp files

* feat: Swift Package Manager support

Remove Package.resolved

* feat: Swift Package Manager support

Ignore Package.resolved

* feat: Swift Package Manager support

Assets in framework project

* feat: Swift Package Manager support

Fix tests

* feat: Swift Package Manager support

Fix tests

* feat: Swift Package Manager support

Fix tests

* feat: Swift Package Manager support

Try Bundle.module to get MessageKit bundle

* feat: Swift Package Manager support

SPM condition in bundle

* feat: Swift Package Manager support

Remove previous Swift 5.2 version Package.swift

* feat: Swift Package Manager support

Update Readme with SPM installation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked blocked on an external factor (other PR, external library, iOS/Swift version, etc) infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants