From f553899283c84494dbcb80d5c0cbbcc0fc1669d2 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 17 Nov 2015 13:24:38 +0800 Subject: [PATCH] layout detail in Profile --- .../Profile/ProfileViewController.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Yep/ViewControllers/Profile/ProfileViewController.swift b/Yep/ViewControllers/Profile/ProfileViewController.swift index 51056b4f..eab42344 100644 --- a/Yep/ViewControllers/Profile/ProfileViewController.swift +++ b/Yep/ViewControllers/Profile/ProfileViewController.swift @@ -1532,16 +1532,17 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel return UIEdgeInsets(top: 20, left: 0, bottom: 20, right: 0) case ProfileSection.SeparationLine.rawValue: - return UIEdgeInsets(top: 40, left: 0, bottom: 30, right: 0) + return UIEdgeInsets(top: 40, left: 0, bottom: 0, right: 0) case ProfileSection.SocialAccount.rawValue: - return UIEdgeInsets(top: 0, left: 0, bottom: 30, right: 0) + let inset: CGFloat = (profileUser?.providersCount ?? 0) > 0 ? 30 : 0 + return UIEdgeInsets(top: inset, left: 0, bottom: inset, right: 0) case ProfileSection.SeparationLine2.rawValue: - return UIEdgeInsets(top: 40, left: 0, bottom: 30, right: 0) + return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) case ProfileSection.Feeds.rawValue: - return UIEdgeInsets(top: 0, left: 0, bottom: 30, right: 0) + return UIEdgeInsets(top: 30, left: 0, bottom: 30, right: 0) default: return UIEdgeInsetsZero @@ -1579,7 +1580,7 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel return CGSize(width: collectionViewWidth, height: 1) case ProfileSection.SocialAccount.rawValue: - return CGSize(width: collectionViewWidth, height: 40) + return CGSize(width: collectionViewWidth, height: (profileUser?.providersCount ?? 0) > 0 ? 40 : 0) case ProfileSection.SeparationLine2.rawValue: return CGSize(width: collectionViewWidth, height: 1)