3 ms·
It's really time to dump those code views son. Interface Builder gives you all the tools you need to do it and works reliable, gives a LOT of feedback on your c
by dep_b 12y ago
It's really time to dump those code views son. Interface Builder gives you all the tools you need to do it and works reliable, gives a LOT of feedback on your constraints when you build them.
You should learn auto layouts using Interface Builders, otherwise it's a nightmare because you're not getting the feedback you need to learn it right in the first place.
You need to start using priorities right, specially when you are doing >=, <= constraints you also need to add a low prio == constraint. It's not that hard, but you will be really frustrated if you keep clinging on to your coded views.
Try to chop up your Storyboards if you work in teams. They shouldn't be so big that you have trouble following the flow on one monitor.
- duaneb 12y agoYou can't code review storyboards.
- dep_b 12y agoLess code is a good thing! I hope you fire up Xcode to see with your own eyes if the code-only view looks okay as well? Also it's much more documenting to they guy that's going to maintain your screens later on.
- cerberusss 12y agoWhy not? You can simply open a storyboard and review it, no?
- duaneb 12y agoThat requires downloading, checking it out (at the exclusion of your other branches), reviewing it, figuring out how to make comments on it even though there's no review interface for storyboards, rinse repeat. Code review in objective-c is commenting on code in github while code compiles and evaluating screenshots of the current state. If apple came out with a way to review storyboards on something as convenient of github, I might consider it.
- bsaul 12y agoi did, son. but now tell me how you do complex animations on subviews in an autolayout view without adding constraint by code.
- dep_b 12y agoI have no idea what complex would be in your case but adding game-like animations to a view with auto layouts would probably not be a good idea. But the whole point is that auto layouts from IB can be controlled from code as well so you don't have to write the code for the auto layouts completely in code. Writing auto layouts in code is laborious and it's easier to make mistakes. So if you "park" a low priority constraint for the end point or even the points in between you can let them take over by changing priorities only. Also you can animate most other properties as well if you need it.