diff --git a/Yep.xcodeproj/project.pbxproj b/Yep.xcodeproj/project.pbxproj index 95d1f7d4..34bd7fa0 100644 --- a/Yep.xcodeproj/project.pbxproj +++ b/Yep.xcodeproj/project.pbxproj @@ -207,10 +207,6 @@ 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 = (); }; }; - 50A93A971BD8BB0A007005DB /* PickFeedSkillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A93A951BD8BB0A007005DB /* PickFeedSkillCell.swift */; settings = {ASSET_TAGS = (); }; }; - 50A93A981BD8BB0A007005DB /* PickFeedSkillCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50A93A961BD8BB0A007005DB /* PickFeedSkillCell.xib */; settings = {ASSET_TAGS = (); }; }; - 50A93A9B1BD8BFC3007005DB /* PickFeedSkillLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A93A9A1BD8BFC3007005DB /* PickFeedSkillLayout.swift */; settings = {ASSET_TAGS = (); }; }; 50A93A9D1BD8C515007005DB /* FeedSkillPickerItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A93A9C1BD8C515007005DB /* FeedSkillPickerItemView.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 */; }; @@ -515,10 +511,6 @@ 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 = ""; }; - 50A93A951BD8BB0A007005DB /* PickFeedSkillCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PickFeedSkillCell.swift; path = Views/Cells/PickFeedSkill/PickFeedSkillCell.swift; sourceTree = ""; }; - 50A93A961BD8BB0A007005DB /* PickFeedSkillCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = PickFeedSkillCell.xib; path = Views/Cells/PickFeedSkill/PickFeedSkillCell.xib; sourceTree = ""; }; - 50A93A9A1BD8BFC3007005DB /* PickFeedSkillLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PickFeedSkillLayout.swift; path = Views/PickFeedSkill/PickFeedSkillLayout.swift; sourceTree = ""; }; 50A93A9C1BD8C515007005DB /* FeedSkillPickerItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FeedSkillPickerItemView.swift; path = Views/PickerItems/FeedSkill/FeedSkillPickerItemView.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 = ""; }; @@ -1004,7 +996,6 @@ 50AACEC91BB54132004DD54B /* Feed */, 50F5AF891BBBB2B30033C9BC /* HorizontalLine */, 50535D1B1BCD19B4002FE1A4 /* TouchClosures */, - 50A93A941BD8B887007005DB /* PickFeedSkill */, 50A93A9E1BD8C51D007005DB /* PickerItems */, ); name = Views; @@ -1064,7 +1055,6 @@ 502B605C1BD1102F00D9C17E /* Title */, 502B60611BD112EA00D9C17E /* QuickPickPhotos */, 502B60661BD1209300D9C17E /* Camera */, - 50A93A991BD8BB26007005DB /* PickFeedSkill */, ); name = Cells; sourceTree = ""; @@ -1689,24 +1679,6 @@ name = DoNotDisturbPeriod; sourceTree = ""; }; - 50A93A941BD8B887007005DB /* PickFeedSkill */ = { - isa = PBXGroup; - children = ( - 50A93A921BD8B883007005DB /* PickFeedSkillView.swift */, - 50A93A9A1BD8BFC3007005DB /* PickFeedSkillLayout.swift */, - ); - name = PickFeedSkill; - sourceTree = ""; - }; - 50A93A991BD8BB26007005DB /* PickFeedSkill */ = { - isa = PBXGroup; - children = ( - 50A93A951BD8BB0A007005DB /* PickFeedSkillCell.swift */, - 50A93A961BD8BB0A007005DB /* PickFeedSkillCell.xib */, - ); - name = PickFeedSkill; - sourceTree = ""; - }; 50A93A9E1BD8C51D007005DB /* PickerItems */ = { isa = PBXGroup; children = ( @@ -2216,7 +2188,6 @@ 0A8F54BB1AB67D11004AD60E /* LaunchScreen.xib in Resources */, 5053AD511AF82A1700B3CBFA /* PickLocationCell.xib in Resources */, 5011382D1BCB5E150055A014 /* FeedConversationDockCell.xib in Resources */, - 50A93A981BD8BB0A007005DB /* PickFeedSkillCell.xib in Resources */, 5053AD5B1AF83B4200B3CBFA /* ChatLeftLocationCell.xib in Resources */, 0A8F54B81AB67D11004AD60E /* Images.xcassets in Resources */, 50EB8CC51AE89F12001AC1EE /* ChatRightVideoCell.xib in Resources */, @@ -2359,7 +2330,6 @@ 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 */, @@ -2382,7 +2352,6 @@ 50535D201BCE43ED002FE1A4 /* ImageCacheController.swift in Sources */, 50FA9A441B661698009BF2A0 /* UIViewController+Yep.swift in Sources */, 0AC25F061B1105D5009E6E13 /* YepChildScrollView.swift in Sources */, - 50A93A971BD8BB0A007005DB /* PickFeedSkillCell.swift in Sources */, 0A943A7B1B0F8EAE0022DD67 /* BaseViewController.swift in Sources */, 50165C451AC2860900C7AEBE /* ConversationLayout.swift in Sources */, 50AFBF491BB2830E007D19DA /* EdgeBorderButton.swift in Sources */, @@ -2461,7 +2430,6 @@ 50F5AF8C1BBBB64C0033C9BC /* FeedCell.swift in Sources */, 50894CF11AEA4726000981AF /* SettingsViewController.swift in Sources */, 5023DE2A1AB685BA00B3EE96 /* ContactsViewController.swift in Sources */, - 50A93A9B1BD8BFC3007005DB /* PickFeedSkillLayout.swift in Sources */, 50CDBE491ACBAD3200459CE0 /* ChatLeftImageCell.swift in Sources */, 5033159C1AC101C80008A209 /* ChatRightTextCell.swift in Sources */, 50E1D7291B870D7500D90A82 /* NSParagraphStyle+Yep.swift in Sources */, diff --git a/Yep/ViewControllers/NewFeed/NewFeedViewController.swift b/Yep/ViewControllers/NewFeed/NewFeedViewController.swift index dea895ed..6c0f5723 100644 --- a/Yep/ViewControllers/NewFeed/NewFeedViewController.swift +++ b/Yep/ViewControllers/NewFeed/NewFeedViewController.swift @@ -15,14 +15,12 @@ import RealmSwift class NewFeedViewController: UIViewController { - @IBOutlet weak var feedWhiteBGView: UIView! - var afterCreatedFeedAction: ((feed: DiscoveredFeed) -> Void)? + @IBOutlet weak var feedWhiteBGView: UIView! + @IBOutlet weak var messageTextView: UITextView! @IBOutlet weak var mediaCollectionView: UICollectionView! - //@IBOutlet weak var pickFeedSkillView: PickFeedSkillView! - //@IBOutlet weak var pickFeedSkillViewHeightConstraint: NSLayoutConstraint! @IBOutlet weak var channelView: UIView! @IBOutlet weak var channelViewTopConstraint: NSLayoutConstraint! diff --git a/Yep/Views/Cells/PickFeedSkill/PickFeedSkillCell.swift b/Yep/Views/Cells/PickFeedSkill/PickFeedSkillCell.swift deleted file mode 100644 index 7703cb9b..00000000 --- a/Yep/Views/Cells/PickFeedSkill/PickFeedSkillCell.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// PickFeedSkillCell.swift -// Yep -// -// Created by nixzhu on 15/10/22. -// Copyright © 2015年 Catch Inc. All rights reserved. -// - -import UIKit - -class PickFeedSkillCell: UICollectionViewCell { - - @IBOutlet weak var skillLabel: UILabel! - - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - } - -} diff --git a/Yep/Views/Cells/PickFeedSkill/PickFeedSkillCell.xib b/Yep/Views/Cells/PickFeedSkill/PickFeedSkillCell.xib deleted file mode 100644 index 726a8d21..00000000 --- a/Yep/Views/Cells/PickFeedSkill/PickFeedSkillCell.xib +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Yep/Views/PickFeedSkill/PickFeedSkillLayout.swift b/Yep/Views/PickFeedSkill/PickFeedSkillLayout.swift deleted file mode 100644 index 6357be45..00000000 --- a/Yep/Views/PickFeedSkill/PickFeedSkillLayout.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// PickFeedSkillLayout.swift -// Yep -// -// Created by nixzhu on 15/10/22. -// Copyright © 2015年 Catch Inc. All rights reserved. -// - -import UIKit - -class PickFeedSkillLayout: UICollectionViewFlowLayout { - - override func prepareLayout() { - super.prepareLayout() - - minimumLineSpacing = 0 - } - - override func targetContentOffsetForProposedContentOffset(proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint { - - if let cv = self.collectionView { - - let cvBounds = cv.bounds - let halfWidth = cvBounds.size.width * 0.5; - let proposedContentOffsetCenterX = proposedContentOffset.x + halfWidth; - - if let attributesForVisibleCells = layoutAttributesForElementsInRect(cvBounds) { - - var candidateAttributes : UICollectionViewLayoutAttributes? - for attributes in attributesForVisibleCells { - - // == Skip comparison with non-cell items (headers and footers) == // - if attributes.representedElementCategory != UICollectionElementCategory.Cell { - continue - } - - if let candAttrs = candidateAttributes { - - let a = attributes.center.x - proposedContentOffsetCenterX - let b = candAttrs.center.x - proposedContentOffsetCenterX - - if abs(a) < abs(b) { - candidateAttributes = attributes; - } - - } else { // == First time in the loop == // - - candidateAttributes = attributes; - continue; - } - } - - return CGPoint(x: round(candidateAttributes!.center.x - halfWidth), y: proposedContentOffset.y) - } - } - - // Fallback - return super.targetContentOffsetForProposedContentOffset(proposedContentOffset) - } -} - diff --git a/Yep/Views/PickFeedSkill/PickFeedSkillView.swift b/Yep/Views/PickFeedSkill/PickFeedSkillView.swift deleted file mode 100644 index cb7f787c..00000000 --- a/Yep/Views/PickFeedSkill/PickFeedSkillView.swift +++ /dev/null @@ -1,96 +0,0 @@ -// -// PickFeedSkillView.swift -// Yep -// -// Created by nixzhu on 15/10/22. -// Copyright © 2015年 Catch Inc. All rights reserved. -// - -import UIKit - -class PickFeedSkillView: UIView { - - let pickFeedSkillCellID = "PickFeedSkillCell" - - lazy var skillsCollectionView: UICollectionView = { - - let layout = PickFeedSkillLayout() - - let view = UICollectionView(frame: CGRectZero, collectionViewLayout: layout) - - view.pagingEnabled = true - - view.backgroundColor = UIColor.lightGrayColor() - - view.registerNib(UINib(nibName: self.pickFeedSkillCellID, bundle: nil), forCellWithReuseIdentifier: self.pickFeedSkillCellID) - - view.dataSource = self - view.delegate = self - - 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) - } -} - -// MARK: - UICollectionViewDataSource, UICollectionViewDelegate - -extension PickFeedSkillView: UICollectionViewDataSource, UICollectionViewDelegate { - - func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { - return 1 - } - - func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return 15 - } - - func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { - - let cell = collectionView.dequeueReusableCellWithReuseIdentifier(pickFeedSkillCellID, forIndexPath: indexPath) as! PickFeedSkillCell - - cell.skillLabel.text = "Swift \(indexPath.item)" - - return cell - } - - func collectionView(collectionView: UICollectionView!, layout collectionViewLayout: UICollectionViewLayout!, sizeForItemAtIndexPath indexPath: NSIndexPath!) -> CGSize { - - return CGSize(width: collectionView.bounds.width, height: 44) - } - - func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets { - - return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) - } -} -