Comments (6)
Hi @Rich86man:
Could you please tell me exactly what you changed and how the whole code block turns out to be? I believe there's nothing wrong with the constraint-choosing logic in Popsicle, but let's make sure :)
from popsicle.
let xInterpolation = Interpolation(imageView, centerXConstraint)
to
let xInterpolation = Interpolation(imageView, widthConstraint)
Looking at the storyboard there is a width constraint on the image view being interpolated.
I ran into the same issue in my own project when I tried to interpolate the width of an image view so I decided to try to interpolate a width of an object in the sample project.
I ended up doing something like this to achieve the effect
@IBOutlet weak var imageViewWidthConstraint: NSLayoutConstraint!
let constraintKeyPath = KeyPath<NSLayoutConstraint, CGFloat>(keyPathable: "constant")
let imageViewSize = Interpolation(imageViewWidthConstraint, constraintKeyPath)
But it would be nice to not need the extra outlet. Am I using it wrong?
from popsicle.
But it would be nice to not need the extra outlet. Am I using it wrong?
Absolutely, that's the idea behind those constraint keypaths. Give me some time to discover what's the problem.
from popsicle.
Oh shoot! I just realised what the problem is. Popsicle only checks the view's superview constraints, but unlike positioning constraints, width and height constraints are applied to the view itself, so Popsicle finds no width or height constraint attached to the superview.
I'll work out a solution and push it as 2.0.1.
from popsicle.
Awesome. Thanks! Loving Popsicle btw
from popsicle.
@Rich86man fixed! Enjoy :)
from popsicle.
Related Issues (20)
- Change podspec to support iOS 6.0 HOT 1
- Cocoapods issue HOT 2
- Use as Intro. HOT 1
- Auto Layout support HOT 1
- The future of DRDynamicSlideShow HOT 1
- DRDynamicSlideShow gone? HOT 10
- working with a button across multiple views HOT 5
- Remove old pod from cocoapods HOT 3
- Documentation
- Interpolable CATransform3D
- TouchView HOT 2
- Swifty version
- Unit Tests + CI HOT 2
- .
- Abstract `filteredObjectAndKeyPath` HOT 1
- .
- Use Swift 3's `#keyPath` HOT 1
- Swift 3.0 compatibility
- Leverage new smart keypaths feature in Swift 4
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 popsicle.