TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Apr 2016 |
Maintained by Devon Boyer.
A customizable library for displaying a collection of content controllers and customizable accessory views associated with a profile interface. It was designed to address two use cases simultaneously:
DBProfileViewController
is styled to look much like a Twitter profile.View controllers that you wish too use as content controllers of a DBProfileViewController
must conform to the DBProfileContentPresenting
protocol.
There are 2 types of supported accessory views: DBProfileAccessoryKindAvatar
and DBProfileAccessoryKindHeader
. You must register the class you would like to use for a specfied accessory kind. For covenience, the library includes DBProfileAvatarView
and DBProfileCoverPhotoView
which provide sample implementations for an avatar view and header view, respectively.
[self registerClass:[DBProfileAvatarView class] forAccessoryViewOfKind:DBProfileAccessoryKindAvatar];
[self registerClass:[DBProfileCoverPhotoView class] forAccessoryViewOfKind:DBProfileAccessoryKindHeader];
To customize the appearance and behaviour of accessory views you can change the associated layout attributes for the accessory view. The DBProfileAccessoryViewLayoutAttributes
object manages the layout-related attributes for an accessory view in a profile view controller.
DBProfileHeaderViewLayoutAttributes *layoutAttributes = [self layoutAttributesForAccessoryViewOfKind:DBProfileAccessoryKindHeader];
layoutAttributes.headerStyle = DBProfileHeaderStyleNavigation;
layoutAttributes.headerOptions = DBProfileHeaderOptionStretch;
DBProfileViewController is available under the MIT license. See the LICENSE file for more info.