Closed edulpn closed 4 years ago
Hi @edulpn, Thanks for reporting this.
This looks like an issue on our side, SteviaLayoutYAxisAnchor
operators work with a Double
value. The others happen to have Int
and CGFloat
variants as well.
@available(iOS 9.0, *)
@discardableResult
public func + (left: SteviaLayoutYAxisAnchor, right: Double) -> SteviaLayoutYAxisAnchor {
return SteviaLayoutYAxisAnchor(anchor: left.anchor, constant: right)
}
For now you could cast them to Double
or just use a plain value, for example
viewA == safeAreaLayoutGuide.Top + 60
would work fine as the compiler would turn 60 as a Double
.
This is definitely something we want to fix in a future release though.
Hope it helps,
Hey @s4cha, thanks for the reply. Nice... Would you be open to receive a PR that implements Int
and CGFloat
operators? I can definitely do that if it helps to unburden you guys.
I have forked the repo and implemented the extra operators, but I'm not sure about the tests. Guess I could open the PR and we communicate there?
@edulpn of course, feel free to open the PR this is a great idea, nevermind if tests are not in there we'll work them out for you.
@s4cha cool! I created the PR, let me know what file the tests should be and I can also add them.
I have recently migrated from Carthage to SPM and jumped from Stevia
4.7.3
to5.1.0
. I understand that this might be something related to major/breaking changes from version4
to5
, but I used to have the following structure:Every time I try to operate either
SteviaLayoutYAxisAnchor
orSteviaLayoutXAxisAnchor
(fromsafeAreaLayoutGuide.Top
/Bottom
/Left
/Right
) with aCGFloat
I get the following error:This doesn't happen if I try to operate between
SteviaAttribute
(fromdescriptionLabel.Top
/Bottom
/Left
/Right
) andCGFloat
. This is probably by design, so what should be the way to handle Safe Area Layout Guides in this sense?