Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions DBProfileViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'DBProfileViewController'
s.version = '2.0.3'
s.summary = 'A customizable library for creating stunning user profiles.'
s.homepage = 'https://github.com/devonboyer/DBProfileViewController'
s.license = 'MIT'
s.author = { 'Devon Boyer' => 'hello@devonboyer.com' }
s.source = { :git => "https://github.com/devonboyer/DBProfileViewController.git", :tag => s.version.to_s }
s.name = 'DBProfileViewController'
s.version = '2.0.3'
s.summary = 'A customizable library for creating stunning user profiles.'
s.homepage = 'https://github.com/devonboyer/DBProfileViewController'
s.license = 'MIT'
s.author = { 'Devon Boyer' => 'hello@devonboyer.com' }
s.source = { :git => "https://github.com/devonboyer/DBProfileViewController.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/devboyer'
s.requires_arc = true
s.platform = :ios, '7.0'
s.platform = :ios, '7.0'

s.source_files = 'DBProfileViewController/**/*'
s.public_header_files = 'DBProfileViewController/**/*.h'
Expand Down
9 changes: 9 additions & 0 deletions DBProfileViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
6707F3F21CE7ED0400720418 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 6707F3EF1CE7ED0400720418 /* LICENSE */; };
6707F3F61CE7EDC100720418 /* DBProfileViewController.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 6707F3F51CE7EDC100720418 /* DBProfileViewController.podspec */; };
6707F3F81CE7F3DD00720418 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
6707F3FA1CE803C400720418 /* DBProfileViewControllerSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6707F3F91CE803C400720418 /* DBProfileViewControllerSnapshotTests.m */; };
6707F4221CE80D2800720418 /* ReferenceImages_64 in Resources */ = {isa = PBXBuildFile; fileRef = 6707F4211CE80D2800720418 /* ReferenceImages_64 */; };
672EF5CF1C49E9B60035567E /* DBUserProfileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 672EF5CE1C49E9B60035567E /* DBUserProfileViewController.m */; };
672EF5D61C4B09AA0035567E /* DBDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 672EF5D51C4B09AA0035567E /* DBDemoViewController.m */; };
675B0F921C42A1C4000AADC6 /* DBFollowersTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 675B0F911C42A1C4000AADC6 /* DBFollowersTableViewController.m */; };
Expand Down Expand Up @@ -85,6 +87,8 @@
6707F3EF1CE7ED0400720418 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
6707F3F11CE7ED0400720418 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
6707F3F51CE7EDC100720418 /* DBProfileViewController.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DBProfileViewController.podspec; sourceTree = "<group>"; };
6707F3F91CE803C400720418 /* DBProfileViewControllerSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBProfileViewControllerSnapshotTests.m; sourceTree = "<group>"; };
6707F4211CE80D2800720418 /* ReferenceImages_64 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ReferenceImages_64; sourceTree = "<group>"; };
672EF5CD1C49E9B60035567E /* DBUserProfileViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBUserProfileViewController.h; sourceTree = "<group>"; };
672EF5CE1C49E9B60035567E /* DBUserProfileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBUserProfileViewController.m; sourceTree = "<group>"; };
672EF5D41C4B09AA0035567E /* DBDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBDemoViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -204,6 +208,7 @@
6003F5B5195388D20070C39A /* DBProfileViewControllerTests */ = {
isa = PBXGroup;
children = (
6707F4211CE80D2800720418 /* ReferenceImages_64 */,
6707F3D51CE7B9AC00720418 /* ControllerTests */,
6707F3D71CE7B9AC00720418 /* ModelTests */,
6707F3DA1CE7B9AC00720418 /* ViewTests */,
Expand Down Expand Up @@ -246,6 +251,7 @@
isa = PBXGroup;
children = (
6707F3D61CE7B9AC00720418 /* DBProfileViewControllerTests.m */,
6707F3F91CE803C400720418 /* DBProfileViewControllerSnapshotTests.m */,
);
path = ControllerTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -378,6 +384,7 @@
files = (
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
6707F4221CE80D2800720418 /* ReferenceImages_64 in Resources */,
6707F3F21CE7ED0400720418 /* LICENSE in Resources */,
670278631C9C9D6F00C5ECA3 /* demo-header.png in Resources */,
6707F3CD1CE7B80D00720418 /* Main.storyboard in Resources */,
Expand Down Expand Up @@ -516,6 +523,7 @@
6707F3E21CE7BAEA00720418 /* DBProfileViewControllerTests.m in Sources */,
6707F3E81CE7BB0900720418 /* DBProfileAvatarViewLayoutAttributeTests.m in Sources */,
6707F3EB1CE7C63100720418 /* DBProfileAccessoryViewLayoutAttributesTests.m in Sources */,
6707F3FA1CE803C400720418 /* DBProfileViewControllerSnapshotTests.m in Sources */,
6707F3E31CE7BAEA00720418 /* DBProfileAccessoryViewTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -677,6 +685,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
"FB_REFERENCE_IMAGE_DIR=\"\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages\\\"\"",
);
INFOPLIST_FILE = "DBProfileViewControllerTests/Tests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
Expand Down
3 changes: 2 additions & 1 deletion DBProfileViewController/DBProfileAvatarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ - (instancetype)init

self.imageView.translatesAutoresizingMaskIntoConstraints = NO;
self.imageView.contentMode = UIViewContentModeScaleAspectFill;
self.imageView.backgroundColor = [UIColor lightGrayColor];
self.imageView.clipsToBounds = YES;

[self.contentView addSubview:self.imageView];

[self setUpConstraints];

self.avatarStyle = DBProfileAvatarStyleRound;
self.avatarStyle = DBProfileAvatarStyleRoundedRect;
}
return self;
}
Expand Down
30 changes: 15 additions & 15 deletions DBProfileViewController/DBProfileViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
#error "DBProfileViewController doesn't support iOS 6.x and lower. Please, change your minimum deployment target to iOS 7.0"
#endif

#import "DBProfileSegmentedControl.h"
#import "DBProfileContentPresenting.h"
#import "DBProfileViewControllerDelegate.h"
#import "DBProfileViewControllerDataSource.h"
#import "DBProfileAccessoryViewLayoutAttributes.h"
#import "DBProfileHeaderViewLayoutAttributes.h"
#import "DBProfileAvatarViewLayoutAttributes.h"
#import "DBProfileAccessoryView.h"
#import "DBProfileAvatarView.h"
#import "DBProfileBlurView.h"
#import "DBProfileCoverPhotoView.h"
#import "DBProfileHeaderOverlayView.h"
#import "DBProfileTitleView.h"
#import "DBProfileTintView.h"
#import <DBProfileViewController/DBProfileSegmentedControl.h>
#import <DBProfileViewController/DBProfileContentPresenting.h>
#import <DBProfileViewController/DBProfileViewControllerDelegate.h>
#import <DBProfileViewController/DBProfileViewControllerDataSource.h>
#import <DBProfileViewController/DBProfileAccessoryViewLayoutAttributes.h>
#import <DBProfileViewController/DBProfileHeaderViewLayoutAttributes.h>
#import <DBProfileViewController/DBProfileAvatarViewLayoutAttributes.h>
#import <DBProfileViewController/DBProfileAccessoryView.h>
#import <DBProfileViewController/DBProfileAvatarView.h>
#import <DBProfileViewController/DBProfileBlurView.h>
#import <DBProfileViewController/DBProfileCoverPhotoView.h>
#import <DBProfileViewController/DBProfileHeaderOverlayView.h>
#import <DBProfileViewController/DBProfileTitleView.h>
#import <DBProfileViewController/DBProfileTintView.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -86,7 +86,7 @@ FOUNDATION_EXPORT CGSize DBProfileViewControllerDefaultHeaderReferenceSize;
*/

/**
* The segmented control managed by the profile view controller.
* The segmented control managed by the profile view controller. Created during `viewDidLoad`.
*/
@property (nonatomic, readonly) DBProfileSegmentedControl *segmentedControl;

Expand Down
8 changes: 5 additions & 3 deletions DBProfileViewController/DBProfileViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
NSString * const DBProfileAccessoryKindHeader = @"DBProfileAccessoryKindHeader";

CGSize DBProfileViewControllerDefaultAvatarReferenceSize = { .width = 0, .height = 72 };
CGSize DBProfileViewControllerDefaultHeaderReferenceSize = { .width = 0, .height = 240 };
CGSize DBProfileViewControllerDefaultHeaderReferenceSize = { .width = 0, .height = 160 };

static const CGFloat DBProfileViewControllerOverlayAnimationDuration = 0.2;

Expand Down Expand Up @@ -131,6 +131,7 @@ - (void)dealloc {
- (void)viewDidLoad {
[super viewDidLoad];

self.view.backgroundColor = [UIColor whiteColor];
self.view.tintColor = [UIColor whiteColor];

self.containerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
Expand Down Expand Up @@ -358,7 +359,7 @@ - (void)updateOverlayInformation {

NSUInteger controllerIndex = self.indexForDisplayedContentController;

if ([self.delegate respondsToSelector:@selector(profileViewController:titleForContentControllerAtIndex:)]) {
if ([self.dataSource respondsToSelector:@selector(profileViewController:titleForContentControllerAtIndex:)]) {
overlayTitle = [self.dataSource profileViewController:self titleForContentControllerAtIndex:controllerIndex];
}

Expand All @@ -368,7 +369,7 @@ - (void)updateOverlayInformation {

if (self.traitCollection.verticalSizeClass != UIUserInterfaceSizeClassCompact) {

if ([self.delegate respondsToSelector:@selector(profileViewController:titleForContentControllerAtIndex:)]) {
if ([self.dataSource respondsToSelector:@selector(profileViewController:subtitleForContentControllerAtIndex:)]) {
overlaySubtitle = [self.dataSource profileViewController:self subtitleForContentControllerAtIndex:controllerIndex];
}
}
Expand Down Expand Up @@ -658,6 +659,7 @@ - (void)reloadData {

[self updateSegmentedControlTitles];
[self showContentControllerAtIndex:self.indexForDisplayedContentController];
[self scrollContentControllerToTop:self.displayedContentController animated:NO];
}

- (void)startRefreshAnimations
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// UICollectionViewController+DBProfileContentPresenting.h
// Pods
//
// Created by Devon Boyer on 2016-05-14.
//
//

#import <UIKit/UIKit.h>
#import <DBProfileViewController/DBProfileContentPresenting.h>

@interface UICollectionViewController (DBProfileContentPresenting) <DBProfileContentPresenting>

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// UICollectionViewController+DBProfileContentPresenting.m
// Pods
//
// Created by Devon Boyer on 2016-05-14.
//
//

#import "UICollectionViewController+DBProfileContentPresenting.h"

@implementation UICollectionViewController (DBProfileContentPresenting)

- (UIScrollView *)contentScrollView {
return self.collectionView;
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// UITableViewController+DBProfileContentPresenting.h
// Pods
//
// Created by Devon Boyer on 2016-05-14.
//
//

#import <UIKit/UIKit.h>
#import <DBProfileViewController/DBProfileContentPresenting.h>

@interface UITableViewController (DBProfileContentPresenting) <DBProfileContentPresenting>

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// UITableViewController+DBProfileContentPresenting.m
// Pods
//
// Created by Devon Boyer on 2016-05-14.
//
//

#import "UITableViewController+DBProfileContentPresenting.h"

@implementation UITableViewController (DBProfileContentPresenting)

- (UIScrollView *)contentScrollView {
return self.tableView;
}

@end
Loading