From 512fe7df36b86b1a39c26f3d9dfd46ace69ef318 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Thu, 22 Oct 2015 14:30:07 +0800 Subject: [PATCH] add PickFeedSkillView --- Podfile.lock | 2 +- Yep.xcodeproj/project.pbxproj | 12 +++++ .../NewFeed/NewFeed.storyboard | 12 +++++ .../NewFeed/NewFeedViewController.swift | 4 +- .../PickFeedSkill/PickFeedSkillView.swift | 50 +++++++++++++++++++ 5 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 Yep/Views/PickFeedSkill/PickFeedSkillView.swift diff --git a/Podfile.lock b/Podfile.lock index ac242a5a..4f1ab3ae 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -52,7 +52,7 @@ DEPENDENCIES: EXTERNAL SOURCES: MZFayeClient: - :path: "../CatchLib-iOS/MZFayeClient/" + :path: ../CatchLib-iOS/MZFayeClient/ SPEC CHECKSUMS: 1PasswordExtension: 676a216461ffa9189db66541b5a2465e10ae4743 diff --git a/Yep.xcodeproj/project.pbxproj b/Yep.xcodeproj/project.pbxproj index 78880765..02b3ab83 100644 --- a/Yep.xcodeproj/project.pbxproj +++ b/Yep.xcodeproj/project.pbxproj @@ -207,6 +207,7 @@ 50A640EA1B6F45FA0050E4A3 /* DoNotDisturbPeriodCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50A640E81B6F45FA0050E4A3 /* DoNotDisturbPeriodCell.xib */; }; 50A640EC1B6F4E420050E4A3 /* DoNotDisturbPeriodViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A640EB1B6F4E420050E4A3 /* DoNotDisturbPeriodViewController.swift */; }; 50A820241B969B0F007CD30E /* NSTimeZone+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A820231B969B0F007CD30E /* NSTimeZone+Yep.swift */; }; + 50A93A931BD8B883007005DB /* PickFeedSkillView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A93A921BD8B883007005DB /* PickFeedSkillView.swift */; settings = {ASSET_TAGS = (); }; }; 50A9D44B1ACD37A8000B2599 /* NSFileManager+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A9D44A1ACD37A8000B2599 /* NSFileManager+Yep.swift */; }; 50A9D44E1ACD382B000B2599 /* NSDateTimeAgo.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 50A9D44C1ACD382B000B2599 /* NSDateTimeAgo.bundle */; }; 50A9D4511ACD383E000B2599 /* NSDate+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A9D4501ACD383E000B2599 /* NSDate+Extension.swift */; }; @@ -510,6 +511,7 @@ 50A640E81B6F45FA0050E4A3 /* DoNotDisturbPeriodCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = DoNotDisturbPeriodCell.xib; path = Views/Cells/DoNotDisturb/DoNotDisturbPeriodCell.xib; sourceTree = ""; }; 50A640EB1B6F4E420050E4A3 /* DoNotDisturbPeriodViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DoNotDisturbPeriodViewController.swift; path = ViewControllers/DoNotDisturbPeriod/DoNotDisturbPeriodViewController.swift; sourceTree = ""; }; 50A820231B969B0F007CD30E /* NSTimeZone+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSTimeZone+Yep.swift"; path = "Extensions/NSTimeZone+Yep.swift"; sourceTree = ""; }; + 50A93A921BD8B883007005DB /* PickFeedSkillView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PickFeedSkillView.swift; path = Views/PickFeedSkill/PickFeedSkillView.swift; sourceTree = ""; }; 50A9D44A1ACD37A8000B2599 /* NSFileManager+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSFileManager+Yep.swift"; path = "Extensions/NSFileManager+Yep.swift"; sourceTree = ""; }; 50A9D44C1ACD382B000B2599 /* NSDateTimeAgo.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = NSDateTimeAgo.bundle; path = Extensions/NSDateTimeAgo.bundle; sourceTree = ""; }; 50A9D4501ACD383E000B2599 /* NSDate+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSDate+Extension.swift"; path = "Extensions/NSDate+Extension.swift"; sourceTree = ""; }; @@ -994,6 +996,7 @@ 50AACEC91BB54132004DD54B /* Feed */, 50F5AF891BBBB2B30033C9BC /* HorizontalLine */, 50535D1B1BCD19B4002FE1A4 /* TouchClosures */, + 50A93A941BD8B887007005DB /* PickFeedSkill */, ); name = Views; sourceTree = ""; @@ -1676,6 +1679,14 @@ name = DoNotDisturbPeriod; sourceTree = ""; }; + 50A93A941BD8B887007005DB /* PickFeedSkill */ = { + isa = PBXGroup; + children = ( + 50A93A921BD8B883007005DB /* PickFeedSkillView.swift */, + ); + name = PickFeedSkill; + sourceTree = ""; + }; 50A9D4581ACD3943000B2599 /* AudioWaves */ = { isa = PBXGroup; children = ( @@ -2311,6 +2322,7 @@ 0A9018821B0120A500AE4B7F /* OAuthViewController.swift in Sources */, 508D17471ACCF4710092D666 /* ChatLeftAudioCell.swift in Sources */, 50894D021AEA6433000981AF /* EditProfileLessInfoCell.swift in Sources */, + 50A93A931BD8B883007005DB /* PickFeedSkillView.swift in Sources */, 501138261BCB59120055A014 /* FeedConversationsViewController.swift in Sources */, 50894CFA1AEA54BA000981AF /* SettingsMoreCell.swift in Sources */, 50AFBF4B1BB2A44C007D19DA /* InfoView.swift in Sources */, diff --git a/Yep/ViewControllers/NewFeed/NewFeed.storyboard b/Yep/ViewControllers/NewFeed/NewFeed.storyboard index 7111d8ff..6af75386 100644 --- a/Yep/ViewControllers/NewFeed/NewFeed.storyboard +++ b/Yep/ViewControllers/NewFeed/NewFeed.storyboard @@ -45,17 +45,27 @@ + + + + + + + + + + @@ -66,6 +76,8 @@ + + diff --git a/Yep/ViewControllers/NewFeed/NewFeedViewController.swift b/Yep/ViewControllers/NewFeed/NewFeedViewController.swift index 225d96b8..58e61177 100644 --- a/Yep/ViewControllers/NewFeed/NewFeedViewController.swift +++ b/Yep/ViewControllers/NewFeed/NewFeedViewController.swift @@ -20,6 +20,8 @@ class NewFeedViewController: UIViewController { @IBOutlet weak var messageTextView: UITextView! @IBOutlet weak var mediaCollectionView: UICollectionView! + @IBOutlet weak var pickFeedSkillView: PickFeedSkillView! + @IBOutlet weak var pickFeedSkillViewHeightConstraint: NSLayoutConstraint! var imageAssets: [PHAsset] = [] @@ -53,7 +55,7 @@ class NewFeedViewController: UIViewController { messageTextView.text = "" messageTextView.textContainer.lineFragmentPadding = 0 messageTextView.textContainerInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) - messageTextView.becomeFirstResponder() + //messageTextView.becomeFirstResponder() mediaCollectionView.backgroundColor = UIColor.clearColor() diff --git a/Yep/Views/PickFeedSkill/PickFeedSkillView.swift b/Yep/Views/PickFeedSkill/PickFeedSkillView.swift new file mode 100644 index 00000000..93b0f937 --- /dev/null +++ b/Yep/Views/PickFeedSkill/PickFeedSkillView.swift @@ -0,0 +1,50 @@ +// +// PickFeedSkillView.swift +// Yep +// +// Created by nixzhu on 15/10/22. +// Copyright © 2015年 Catch Inc. All rights reserved. +// + +import UIKit + +class PickFeedSkillView: UIView { + + lazy var skillsCollectionView: UICollectionView = { + let view = UICollectionView(frame: CGRectZero, collectionViewLayout: UICollectionViewFlowLayout()) + view.backgroundColor = UIColor.redColor() + return view + }() + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + + makeUI() + } + + override init(frame: CGRect) { + super.init(frame: frame) + + makeUI() + } + + private func makeUI() { + + backgroundColor = UIColor.lightGrayColor() + + addSubview(skillsCollectionView) + skillsCollectionView.translatesAutoresizingMaskIntoConstraints = false + + let views = [ + "skillsCollectionView": skillsCollectionView, + ] + + let skillsCollectionViewConstraintsH = NSLayoutConstraint.constraintsWithVisualFormat("H:|[skillsCollectionView]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: views) + + let skillsCollectionViewConstraintsV = NSLayoutConstraint.constraintsWithVisualFormat("V:|[skillsCollectionView]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: views) + + NSLayoutConstraint.activateConstraints(skillsCollectionViewConstraintsH) + NSLayoutConstraint.activateConstraints(skillsCollectionViewConstraintsV) + } +} +