forem.dev Community

loading...
Cover image for Add cover image bug on Dev-ios / ForemWebView-iOS local build

Add cover image bug on Dev-ios / ForemWebView-iOS local build

lee profile image Lee ・1 min read

Hi there,

Is anyone using the Dev-ios / ForemWebView-iOS repo? Everything works for me except uploading a cover image, at which point it crashes.

This is the process I go through to get setup:

  • Clone DEV-iOS
  • Run ./carthage.sh update --no-use-binaries --platform iOS --cache-builds
  • Let it fail on the time out
  • Open ForemWebView from the Checkouts folder in XCode
  • Let it resolve the dependencies on its own successfully
  • Run CMD+b to build
  • Let it build successfully then quit Xcode
  • Run ./carthage.sh update --no-use-binaries --platform iOS --cache-builds again
  • Open up the project fully in XCode and run in a simulator to test

Here is the error I get when the app crashes (YPImagePicker at the end):

import class Foundation.Bundle
private class BundleFinder {}
extension Foundation.Bundle {
/// Returns the resource bundle associated with the current Swift module.
static var module: Bundle = {
let bundleName = “YPImagePicker_YPImagePicker”
let candidates = [
// Bundle should be present here when the package is linked into an App.
Bundle.main.resourceURL,
// Bundle should be present here when the package is linked into a framework.
Bundle(for: BundleFinder.self).resourceURL,
// For command-line tools.
Bundle.main.bundleURL,
]
for candidate in candidates {
let bundlePath = candidate?.appendingPathComponent(bundleName + “.bundle”)
if let bundle = bundlePath.flatMap(Bundle.init(url:)) {
return bundle
}
}
fatalError(“unable to find bundle named YPImagePicker_YPImagePicker”)
}()
}

I am using Xcode 12.0 - any help appreciated :D

I have also created a Github issue

Discussion (3)

pic
Editor guide
Collapse
fdoxyz profile image
Fernando

Hey @lee , we had a contributor submit a PR over the weekend to migrate the DEV iOS app to SPM. I wanted to check back here to give you a heads up so you can give it another try now that the project is no longer using Carthage

Migrate to SPM for dependencies #244

  • Remove Carthage references and files
  • Add Swift Package Dependencies for push-notifications-swift, NotificationBanner and ForemWebView-ios
  • Amend ViewController.swift so project builds
    • Change import statement for NotificationBanner to NotificationBannerSwift
    • Add missing protocol requirements of ForemWebViewDelegate

What type of PR is this? (check all applicable)

  • [ ] Refactor
  • [x] Feature
  • [ ] Bug Fix
  • [ ] Documentation Update

Description

Migrate to Swift Package Manager from Carthage for dependencies

Related Tickets & Documents

Issue#241

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

N/A

Added to documentation?

  • [ ] docs.dev.to
  • [x] readme
  • [ ] no documentation needed

What gif best describes this PR or how it makes you feel?

happy dancing! yay!

Collapse
lee profile image
Lee Author

Hi mate! This worked a treat 😎😎😎😎😎😎😎😎😎

Collapse
lee profile image
Lee Author

Wow! great!!!! Thanks @fdoxyz 😎😎😎 and Ceri-anne 🤩