Comments (7)
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.
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.
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
-
Hit send accidentally so I'm following up with a second comment ↩
from pow.
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.
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).
from pow.
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.
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.
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)
- Using Pow with CocoaPods. HOT 2
- 0.2.1 Crashes in macOS TestFlight Builds HOT 2
- Glow blocks input on buttons HOT 3
- Expose Custom WiggleRate HOT 1
- Idea: Composed Pow Effects Syntax HOT 2
- Expose Custom Parameters For .pulse
- Default "Up to major version" dependency rule in Xcode incompatible with Pow's 0.X versioning HOT 1
- Confused about license purchase requirement HOT 1
- Crash in `SmokeEffect` HOT 5
- Support CocoaPods
- visionOS Support
- My app does not compile after adding the package to my Xcode project. HOT 3
- Glow effect prevent the touch after version 0.3.1 HOT 3
- Global option to disable POW effects when voiceover is activated
- Feature Request: Support for Repeated Effect. HOT 4
- Use in UIKit HOT 1
- When HStack appears, there is no spring animation, which feels a bit abrupt. HOT 4
- Cancel conditional effect after duration HOT 2
- AttributeGraph: cycle detected through attribute xx on macOS HOT 4
- ConditionalEffect doesn't stop immediately when condition becomes false
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pow.