Giter VIP home page Giter VIP logo

Comments (7)

robb avatar robb commented on May 20, 2024 1

I’ll still have use-cases for this though, and happy to support this project!

Thanks, I appreciate it!

What I dont really understand is why I can include Pow in an Xcode App project targeting iOS 14, and then conditionally use the framework (but not do the same in a Swift Package https://github.com/apple 👀):

I think that's because SPM resolves the dependencies just once when you pull them whereas in an App project, you just call methods at runtime (which the #available makes sure actually exist).

I definitely agree on the workaround being a pain, (see also to #22), conditionally invoking view modifiers based on availability is a pain with SwiftUIs chaining syntax.

from pow.

robb avatar robb commented on May 20, 2024

It seems that the platform here

platforms: [ .iOS(.v14) ]

is a different type (SupportedPlatform) compared to the the platform used here (PackageDescription.Platform):

.product(name: "Pow", package: "Pow", condition: .when(platforms: [.iOS(.v15), .macCatalyst]))

The latter doesn't seem to take a version parameter. However, TargetDependencyCondition also doesn't seem to offer anything else, like a condition based on a build parameter for example.

from pow.

robb avatar robb commented on May 20, 2024

Whoops1.

From skimming through the forum, it seems like this is a problem in SPM that has been flagged before (although with slightly different usecases), so I'm not sure there's a solution here 😔.

Let me know if you'd like a refund.

Footnotes

  1. Hit send accidentally so I'm following up with a second comment

from pow.

frogg avatar frogg commented on May 20, 2024

Thanks for looking into this, Robb!

I thought this might be a limitation of SPM because I couldn't really find a solution, so definitely not an issue with Pow!
Decided to file an issue here in case you knew a workaround.

I’ll still have use-cases for this though, and happy to support this project!

What I dont really understand is why I can include Pow in an Xcode App project targeting iOS 14, and then conditionally use the framework (but not do the same in a Swift Package @apple 👀):

import Pow
extension View {
    func conditionalShineRepetitionEffectiOS16() -> some View {
        if #available(iOS 16.0, *) {
            return self.conditionalEffect(.repeat(.shine, every: .seconds(2)), condition: true)
        } else {
            return self
        }
    }
}

(also, I dont really like this workaround, it complicates the code (but it works!). Would be great to have an .available(…) modifier at some point…but that’s also feedback in the direction of Apple)

from pow.

frogg avatar frogg commented on May 20, 2024

Hey Robb, not sure if there’s a fix for that, but I noticed that my app is now crashing on iOS 14.4 and earlier because the AVFAudio framework is missing (and somehow Pow tries to import it even though I’m just making use of Pow conditionally).

Screenshot 2023-04-12 at 23 29 46

from pow.

robb avatar robb commented on May 20, 2024

Hmm, AVFAudio was introduced in 14.5 and since Pow's deployment target is 15, it's not weak-linked?

Are you using SoundEffect in your iOS 15 code?

from pow.

frogg avatar frogg commented on May 20, 2024

Hey Robb, coming back to this today.

Do you know how I can weak-link Pow to my project so that the app can still run on iOS 14?

I’ve tried to make the Link optional, but it’s still crashing with the same error message on iOS 14.

image
dyld: Library not loaded: /System/Library/Frameworks/AVFAudio.framework/AVFAudio
  Referenced from: /Users/frederik/Library/Developer/Xcode/DerivedData/one_sec/Build/Products/Debug-iphonesimulator/Pow.framework/Pow
  Reason: image not found

I dont use SoundEffect in my code btw to answer your previous question.

from pow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.