Closed Julioacarrettoni closed 6 years ago
Don't worry about NSEdgeLayoutConstraints
that was just created for when we need to create and modify all the edge constraints later. We can have a UIView
extension method edgesTo(_ view: UIView)
that creates constraints without the need to hold the reference (like in the blur view for example).
I'm having a layout issue after rotation, portrait single column cells take the entire screen width. Launch in portrait rotate to landscape and back to portrait but just on iPhone X 🤔.
Regarding NSEdgeLayoutConstraints
I added the convenience init that sets the recr to zero (turning all constants to zero) I originally intended to call do init(view:container:).setActive(true)
so I didn’t have to hold the object, just fire and forget, but unless I explicitly call setConstants(to:0)
it wouldn’t work :(
I was tempted to made all the methods to return self
that way I would be able to chain all the calls and wouldn’t have to hold a reference, but I’m not sure that’s a valid use for your utility object. BTW, I like it.
Regarding the iPhone X issue, let me investigate, it didn’t saw that, but I didn’t test it properly at the end, maybe on of my latest changes screwed it up :|
TodayCollectionViewController.swift
so it calculates the sizes of the elements dynamically trying to match the ideal width 335, on iPhones is 1 column portrait, 2 landscape on iPads is 3 and 4 or 4 and 5 depending the device. (Go ahead, try side by side apps on the iPad, IT WORKS BABY!)NSEdgeLayoutConstraints.swift
but is not working as I hoped :(