Spaceman-Labs/SMPageControl — pull request #17 by idpaterson (2013-10-24 17:02:09+00:00)
Title: Added support for AutoLayout matching UIPageControl

In order to work properly in AutoLayout, `SMPageControl` needed an implementation of `intrinsicContentSize`, a straightforward adaptation of `sizeThatFits:`. Otherwise the height will be ambiguous, requiring the app to set a height constraint. However, doing so doesn't jive well with hiding the page control.

To match the behavior of `UIPageControl`, the intrinsic height is set to zero when the control should be hidden due to the number of pages (`UIPageControl` is always hidden in this way for zero pages, otherwise depends on `hidesForSinglePage`). This is convenient in the case where a constraint has been added, for example, between the top of the page control and the bottom of some other view. When the page control is hidden, the other view can adjust to fill the now vacant space.

As a minor convenience, the `MIN_HEIGHT` constant has been updated to a `minHeight` property. This allows easier customization of the control in situations where it is merely for display purposes and not receiving user interaction. In my case, the page control is being set to `userInteractionEnabled = NO` so that the minimum height can be reduced. Similarly if the page control is adjacent to another control like a tab bar, the height may be increased to enlarge the touch target.