From 2352327dafea91b5e13b5a70b29bf3f5fbf2f5ab Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 15 Dec 2015 09:22:57 +0800 Subject: [PATCH 1/7] adjust logic for nextButton.enabled when register --- .../Register/RegisterPickAvatarViewController.swift | 3 ++- .../Register/RegisterPickMobileViewController.swift | 3 ++- .../Register/RegisterPickNameViewController.swift | 3 ++- .../Register/RegisterVerifyMobileViewController.swift | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift b/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift index c5a35ac2..a2d5e1c2 100644 --- a/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift +++ b/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift @@ -137,12 +137,13 @@ class RegisterPickAvatarViewController: UIViewController { cameraRollButton.tintColor = UIColor.yepTintColor() captureButton.tintColor = UIColor.yepTintColor() retakeButton.setTitleColor(UIColor.yepTintColor(), forState: .Normal) + + nextButton.enabled = false } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) - nextButton.enabled = false } // MARK: Navigation diff --git a/Yep/ViewControllers/Register/RegisterPickMobileViewController.swift b/Yep/ViewControllers/Register/RegisterPickMobileViewController.swift index 3865030b..b004c40a 100644 --- a/Yep/ViewControllers/Register/RegisterPickMobileViewController.swift +++ b/Yep/ViewControllers/Register/RegisterPickMobileViewController.swift @@ -50,12 +50,13 @@ class RegisterPickMobileViewController: UIViewController { pickMobileNumberPromptLabelTopConstraint.constant = Ruler.iPhoneVertical(30, 50, 60, 60).value mobileNumberTextFieldTopConstraint.constant = Ruler.iPhoneVertical(30, 40, 50, 50).value + + nextButton.enabled = false } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) - nextButton.enabled = false } override func viewDidAppear(animated: Bool) { diff --git a/Yep/ViewControllers/Register/RegisterPickNameViewController.swift b/Yep/ViewControllers/Register/RegisterPickNameViewController.swift index 65b3272b..afea45fd 100644 --- a/Yep/ViewControllers/Register/RegisterPickNameViewController.swift +++ b/Yep/ViewControllers/Register/RegisterPickNameViewController.swift @@ -73,12 +73,13 @@ class RegisterPickNameViewController: BaseViewController { pickNamePromptLabelTopConstraint.constant = Ruler.iPhoneVertical(30, 50, 60, 60).value nameTextFieldTopConstraint.constant = Ruler.iPhoneVertical(30, 40, 50, 50).value + + nextButton.enabled = false } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) - nextButton.enabled = false } override func viewDidAppear(animated: Bool) { diff --git a/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift b/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift index 3339ee76..c3958830 100644 --- a/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift +++ b/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift @@ -83,6 +83,8 @@ class RegisterVerifyMobileViewController: UIViewController { nextButton.enabled = false callMeButton.enabled = false + + verifyCodeTextField.text = nil } override func viewDidAppear(animated: Bool) { From 0c9ea054a910c37864885c27a9065693f6ba16c5 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 15 Dec 2015 09:39:53 +0800 Subject: [PATCH 2/7] fix auto layout in RegisterPickSkills --- Yep/Base.lproj/Intro.storyboard | 85 ++++----------------------------- 1 file changed, 8 insertions(+), 77 deletions(-) diff --git a/Yep/Base.lproj/Intro.storyboard b/Yep/Base.lproj/Intro.storyboard index 4d5a344a..0fbba531 100644 --- a/Yep/Base.lproj/Intro.storyboard +++ b/Yep/Base.lproj/Intro.storyboard @@ -1,8 +1,8 @@ - + - + @@ -21,21 +21,18 @@ - @@ -115,13 +109,11 @@ - @@ -134,13 +126,11 @@ - @@ -148,7 +138,6 @@ - @@ -189,13 +178,11 @@ - @@ -214,7 +201,6 @@ - @@ -227,13 +213,11 @@ - @@ -276,7 +260,6 @@ - @@ -286,27 +269,23 @@ - @@ -375,14 +352,11 @@ - - - @@ -404,13 +378,11 @@ - @@ -499,7 +467,7 @@ - + @@ -509,8 +477,7 @@ - - + @@ -523,47 +490,31 @@ - - - - + + - - - - - - + - - - - - - - - @@ -589,7 +540,6 @@ - @@ -605,7 +555,6 @@ - @@ -616,14 +565,12 @@ - - @@ -665,7 +610,6 @@ - @@ -705,7 +649,6 @@ - @@ -730,13 +673,11 @@ - @@ -752,14 +693,12 @@ - @@ -771,7 +710,6 @@ - @@ -814,13 +752,11 @@ - @@ -830,21 +766,18 @@ - From 4d04cd200e577531b49f47a1d0d300d711b0ec17 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 15 Dec 2015 09:52:24 +0800 Subject: [PATCH 3/7] hide messageCountLabel for Feed Cells if feed.messagesCount == 0 --- Yep/Views/Cells/FeedBasic/FeedBasicCell.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Yep/Views/Cells/FeedBasic/FeedBasicCell.swift b/Yep/Views/Cells/FeedBasic/FeedBasicCell.swift index f43075f8..61b65b7a 100644 --- a/Yep/Views/Cells/FeedBasic/FeedBasicCell.swift +++ b/Yep/Views/Cells/FeedBasic/FeedBasicCell.swift @@ -129,6 +129,7 @@ class FeedBasicCell: UITableViewCell { timeLabel.text = "\(NSDate(timeIntervalSince1970: feed.createdUnixTime).timeAgo)" messageCountLabel.text = "\(feed.messagesCount)" + messageCountLabel.hidden = (feed.messagesCount == 0) } // MARK: Actions From db75b59555d355e13bf383d41380d61f1f9ce894 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 15 Dec 2015 10:05:48 +0800 Subject: [PATCH 4/7] add positionStyle for HorizontalLineView --- .../HorizontalLine/HorizontalLineView.swift | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Yep/Views/HorizontalLine/HorizontalLineView.swift b/Yep/Views/HorizontalLine/HorizontalLineView.swift index 247e0ed4..1ba45182 100644 --- a/Yep/Views/HorizontalLine/HorizontalLineView.swift +++ b/Yep/Views/HorizontalLine/HorizontalLineView.swift @@ -38,6 +38,19 @@ class HorizontalLineView: UIView { } } + enum PositionStyle: Int { + case Top + case Center + case Bottom + } + + @IBInspectable + var positionStyle: PositionStyle = .Center { + didSet { + setNeedsDisplay() + } + } + // MARK: Draw override func drawRect(rect: CGRect) { @@ -49,7 +62,16 @@ class HorizontalLineView: UIView { CGContextSetLineWidth(context, lineWidth) - let y = ceil(CGRectGetHeight(rect) * 0.5) + let y: CGFloat + let fullHeight = CGRectGetHeight(rect) + switch positionStyle { + case .Top: + y = lineWidth * 0.5 + case .Center: + y = (fullHeight * 0.5) - lineWidth * 0.5 + case .Bottom: + y = fullHeight - lineWidth * 0.5 + } CGContextMoveToPoint(context, leftMargin, y) CGContextAddLineToPoint(context, CGRectGetWidth(rect) - rightMargin, y) From 887334f6093e689b3718fe4003dd5c74cb06f040 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 15 Dec 2015 10:17:33 +0800 Subject: [PATCH 5/7] update SubscribeView & FeedView --- Yep/Views/Feed/FeedView.xib | 17 ++++++----------- .../HorizontalLine/HorizontalLineView.swift | 18 +++++------------- Yep/Views/Subscribe/SubscribeView.swift | 3 ++- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/Yep/Views/Feed/FeedView.xib b/Yep/Views/Feed/FeedView.xib index 3b328b77..74bb8cfe 100644 --- a/Yep/Views/Feed/FeedView.xib +++ b/Yep/Views/Feed/FeedView.xib @@ -1,8 +1,8 @@ - + - + @@ -14,21 +14,18 @@ - - @@ -41,14 +38,12 @@ - @@ -57,15 +52,16 @@ - + + + - diff --git a/Yep/Views/HorizontalLine/HorizontalLineView.swift b/Yep/Views/HorizontalLine/HorizontalLineView.swift index 1ba45182..d591c4db 100644 --- a/Yep/Views/HorizontalLine/HorizontalLineView.swift +++ b/Yep/Views/HorizontalLine/HorizontalLineView.swift @@ -38,14 +38,8 @@ class HorizontalLineView: UIView { } } - enum PositionStyle: Int { - case Top - case Center - case Bottom - } - @IBInspectable - var positionStyle: PositionStyle = .Center { + var atBottom: Bool = true { didSet { setNeedsDisplay() } @@ -64,13 +58,11 @@ class HorizontalLineView: UIView { let y: CGFloat let fullHeight = CGRectGetHeight(rect) - switch positionStyle { - case .Top: - y = lineWidth * 0.5 - case .Center: - y = (fullHeight * 0.5) - lineWidth * 0.5 - case .Bottom: + + if atBottom { y = fullHeight - lineWidth * 0.5 + } else { + y = lineWidth * 0.5 } CGContextMoveToPoint(context, leftMargin, y) diff --git a/Yep/Views/Subscribe/SubscribeView.swift b/Yep/Views/Subscribe/SubscribeView.swift index f8a0d23c..e43f543c 100644 --- a/Yep/Views/Subscribe/SubscribeView.swift +++ b/Yep/Views/Subscribe/SubscribeView.swift @@ -68,7 +68,8 @@ class SubscribeView: UIView { horizontalLineView.translatesAutoresizingMaskIntoConstraints = false horizontalLineView.backgroundColor = UIColor.clearColor() - horizontalLineView.lineColor = UIColor.grayColor() + //horizontalLineView.lineColor = UIColor.lightGrayColor() + horizontalLineView.atBottom = false let views = [ "horizontalLineView": horizontalLineView, From 9a17dbe8447a4775f2a502f4e0c451cb8a0af27e Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 15 Dec 2015 10:23:28 +0800 Subject: [PATCH 6/7] adjust more line --- .../Feedback/Feedback.storyboard | 10 +++++-- .../NewFeed/NewFeed.storyboard | 26 +++++++------------ .../NewFeedVoiceRecord.storyboard | 5 ++-- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Yep/ViewControllers/Feedback/Feedback.storyboard b/Yep/ViewControllers/Feedback/Feedback.storyboard index 1f28ca33..2f119f2a 100644 --- a/Yep/ViewControllers/Feedback/Feedback.storyboard +++ b/Yep/ViewControllers/Feedback/Feedback.storyboard @@ -1,8 +1,8 @@ - + - + @@ -36,6 +36,9 @@ + + + @@ -43,6 +46,9 @@ + + + diff --git a/Yep/ViewControllers/NewFeed/NewFeed.storyboard b/Yep/ViewControllers/NewFeed/NewFeed.storyboard index 86ee261d..2514816d 100644 --- a/Yep/ViewControllers/NewFeed/NewFeed.storyboard +++ b/Yep/ViewControllers/NewFeed/NewFeed.storyboard @@ -1,8 +1,8 @@ - + - + @@ -22,12 +22,10 @@ - - @@ -39,7 +37,6 @@ - @@ -70,7 +67,7 @@ - @@ -316,7 +309,6 @@ - diff --git a/Yep/ViewControllers/NewFeedVoiceRecord/NewFeedVoiceRecord.storyboard b/Yep/ViewControllers/NewFeedVoiceRecord/NewFeedVoiceRecord.storyboard index faabab74..f5d9405a 100644 --- a/Yep/ViewControllers/NewFeedVoiceRecord/NewFeedVoiceRecord.storyboard +++ b/Yep/ViewControllers/NewFeedVoiceRecord/NewFeedVoiceRecord.storyboard @@ -1,8 +1,8 @@ - + - + @@ -34,6 +34,7 @@ + From 0008756fcaa3dc9c9fe3e38668d48e43a63a88bb Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 15 Dec 2015 10:26:15 +0800 Subject: [PATCH 7/7] add lines for NewFeed --- .../NewFeed/NewFeed.storyboard | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Yep/ViewControllers/NewFeed/NewFeed.storyboard b/Yep/ViewControllers/NewFeed/NewFeed.storyboard index 2514816d..c45774b4 100644 --- a/Yep/ViewControllers/NewFeed/NewFeed.storyboard +++ b/Yep/ViewControllers/NewFeed/NewFeed.storyboard @@ -22,7 +22,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +