DBProfileViewController 2.0.2

DBProfileViewController 2.0.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Apr 2016

Maintained by Devon Boyer.




Overview

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:

  1. Provide good looking, high quality implementations of familiar profile experiences out of the box. By default a DBProfileViewController is styled to look much like a Twitter profile.
  2. Enable quick and easy customization of the user experience via layout attributes which change the appearance and behaviour of the accessory views.

Installation

Getting Started

  1. Subclass - Subclass DBProfileViewController
  2. Implement - The controller declares delegate and data source protocols. Your subclasses must implement these protocols.
  3. Customize - The controller uses layout attributes to allow for effortless customization of accessory views.

Content Controllers

View controllers that you wish too use as content controllers of a DBProfileViewController must conform to the DBProfileContentPresenting protocol.

Accessory Views

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];

Layout Attributes

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;

Author

License

DBProfileViewController is available under the MIT license. See the LICENSE file for more info.