From 8ffd3dd907e91e684673ac52ef68233be0fc48b3 Mon Sep 17 00:00:00 2001 From: kevinzhow Date: Sat, 18 Apr 2015 05:10:10 +0800 Subject: [PATCH 1/4] Upgrade realm --- Podfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index b06c19c3..d66691c8 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -25,9 +25,9 @@ PODS: - MZFayeClient (1.0.0): - Base64 (~> 1.0.1) - SocketRocket (~> 0.3.1-beta2) - - Realm (0.91.1): - - Realm/Headers (= 0.91.1) - - Realm/Headers (0.91.1) + - Realm (0.91.3): + - Realm/Headers (= 0.91.3) + - Realm/Headers (0.91.3) - SocketRocket (0.3.1-beta2) DEPENDENCIES: @@ -45,7 +45,7 @@ SPEC CHECKSUMS: Base64: 4924bf3ca6fa559a5161ef717291bd450eb7bd1a JPushSDK: c68dd04c595a5c93aa003f212974010790410d8e MZFayeClient: 19df756a4c86c8f414668e6edc54fccfee54adbb - Realm: b9c1fd9defa26aa7276ce938a8df52ec81f24528 + Realm: 4bfdac6f0f3170a3947c7196e2e9a2e49c943719 SocketRocket: 7284ab9370a06c99aba92b2fe3a32aedd0f9a6fa COCOAPODS: 0.36.3 From 2d4b04f7de983ec0c48c3a199c1c540d75742588 Mon Sep 17 00:00:00 2001 From: kevinzhow Date: Sun, 19 Apr 2015 14:41:53 +0800 Subject: [PATCH 2/4] Move annoation Label to inside --- Yep.xcodeproj/project.pbxproj | 12 ++++ Yep/Base.lproj/Intro.storyboard | 57 ++++++++++++------- Yep/Base.lproj/Main.storyboard | 6 +- .../RegisterSelectSkillsViewController.swift | 26 +++++++-- .../AnnoationCollectionReusableView.swift | 14 +++++ 5 files changed, 86 insertions(+), 29 deletions(-) create mode 100644 Yep/Views/ReusableViews/AnnoationLabel/AnnoationCollectionReusableView.swift diff --git a/Yep.xcodeproj/project.pbxproj b/Yep.xcodeproj/project.pbxproj index afff29f1..b809e557 100644 --- a/Yep.xcodeproj/project.pbxproj +++ b/Yep.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 0A02E46F1AC9208A00235DBF /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A02E46E1AC9208A00235DBF /* libxml2.dylib */; }; + 0A0A117F1AE382AC0008772C /* AnnoationCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A0A117E1AE382AC0008772C /* AnnoationCollectionReusableView.swift */; }; 0A271FD71ACA055400822DFC /* YepAudioService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A271FD61ACA055400822DFC /* YepAudioService.swift */; }; 0A3E60601ACCA9C0003DC853 /* String+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A3E605F1ACCA9C0003DC853 /* String+Yep.swift */; }; 0A3E60671ACCAECE003DC853 /* YepLocationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A3E60661ACCAECE003DC853 /* YepLocationService.swift */; }; @@ -134,6 +135,7 @@ /* Begin PBXFileReference section */ 0A02E46E1AC9208A00235DBF /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; + 0A0A117E1AE382AC0008772C /* AnnoationCollectionReusableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AnnoationCollectionReusableView.swift; path = Views/ReusableViews/AnnoationLabel/AnnoationCollectionReusableView.swift; sourceTree = ""; }; 0A271FD61ACA055400822DFC /* YepAudioService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = YepAudioService.swift; path = Services/YepAudioService.swift; sourceTree = ""; }; 0A3E605F1ACCA9C0003DC853 /* String+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+Yep.swift"; path = "Extensions/String+Yep.swift"; sourceTree = ""; }; 0A3E60661ACCAECE003DC853 /* YepLocationService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = YepLocationService.swift; path = Services/YepLocationService.swift; sourceTree = ""; }; @@ -290,6 +292,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0A0A11801AE382AF0008772C /* Annoation */ = { + isa = PBXGroup; + children = ( + 0A0A117E1AE382AC0008772C /* AnnoationCollectionReusableView.swift */, + ); + name = Annoation; + sourceTree = ""; + }; 0A3E60631ACCAC02003DC853 /* NSDate+TimeAgo */ = { isa = PBXGroup; children = ( @@ -610,6 +620,7 @@ children = ( 502AE55A1AB932D9005BD199 /* ProfileSectionHeader */, 50C090A21ADE391900CC6389 /* AddSkills */, + 0A0A11801AE382AF0008772C /* Annoation */, ); name = ReusableViews; sourceTree = ""; @@ -1090,6 +1101,7 @@ 5023DE301AB6861500B3EE96 /* ProfileViewController.swift in Sources */, 50E114F71ABBFA7000F13000 /* RLMSupport.swift in Sources */, 5023DE261AB6856300B3EE96 /* ConversationsViewController.swift in Sources */, + 0A0A117F1AE382AC0008772C /* AnnoationCollectionReusableView.swift in Sources */, 50A9D4511ACD383E000B2599 /* NSDate+Extension.swift in Sources */, 506EC20A1AC95BFC00CE42B3 /* UIFont+Yep.swift in Sources */, 50C0909B1ADE234F00CC6389 /* RegisterPickSkillsViewController.swift in Sources */, diff --git a/Yep/Base.lproj/Intro.storyboard b/Yep/Base.lproj/Intro.storyboard index 104b303d..ae7e8d98 100644 --- a/Yep/Base.lproj/Intro.storyboard +++ b/Yep/Base.lproj/Intro.storyboard @@ -1,5 +1,5 @@ - + @@ -194,7 +194,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -546,32 +546,50 @@ - - + - + + + + + + + + + + + + + + + - + @@ -589,14 +607,11 @@ - + - - - @@ -650,7 +665,7 @@ - + @@ -665,7 +680,7 @@ - + diff --git a/Yep/Base.lproj/Main.storyboard b/Yep/Base.lproj/Main.storyboard index 0b22106c..917fc243 100644 --- a/Yep/Base.lproj/Main.storyboard +++ b/Yep/Base.lproj/Main.storyboard @@ -1,7 +1,7 @@ - + - + @@ -70,7 +70,7 @@ - + diff --git a/Yep/ViewControllers/Register/RegisterSelectSkillsViewController.swift b/Yep/ViewControllers/Register/RegisterSelectSkillsViewController.swift index df84818f..fdc0d3c3 100644 --- a/Yep/ViewControllers/Register/RegisterSelectSkillsViewController.swift +++ b/Yep/ViewControllers/Register/RegisterSelectSkillsViewController.swift @@ -83,11 +83,7 @@ class RegisterSelectSkillsViewController: UIViewController { skillsCollectionView.registerNib(UINib(nibName: skillSelectionCellIdentifier, bundle: nil), forCellWithReuseIdentifier: skillSelectionCellIdentifier) - annotationLabel.text = annotationText - let tap = UITapGestureRecognizer(target: self, action: "dismiss") - annotationLabel.userInteractionEnabled = true - annotationLabel.addGestureRecognizer(tap) } override func viewDidAppear(animated: Bool) { @@ -105,6 +101,26 @@ class RegisterSelectSkillsViewController: UIViewController { extension RegisterSelectSkillsViewController: UICollectionViewDataSource, UICollectionViewDelegate { + func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView { + var reusableview: UICollectionReusableView! + + if kind == UICollectionElementKindSectionHeader { + var headerView: AnnoationCollectionReusableView = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionHeader, withReuseIdentifier: "annoationLabelView", forIndexPath: indexPath) as! AnnoationCollectionReusableView + + headerView.label.text = annotationText + + let tap = UITapGestureRecognizer(target: self, action: "dismiss") + headerView.label.userInteractionEnabled = true + headerView.label.addGestureRecognizer(tap) + self.annotationLabel = headerView.label + + reusableview = headerView + } + + + return reusableview + } + func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { return 1 } @@ -180,7 +196,7 @@ extension RegisterSelectSkillsViewController: UICollectionViewDataSource, UIColl UIView.animateWithDuration(0.5, delay: 0.2, options: .CurveEaseInOut, animations: { () -> Void in - self.skillsCollectionViewBottomConstrain.constant = 0 + self.skillsCollectionViewBottomConstrain.constant = -150 self.view.layoutIfNeeded() diff --git a/Yep/Views/ReusableViews/AnnoationLabel/AnnoationCollectionReusableView.swift b/Yep/Views/ReusableViews/AnnoationLabel/AnnoationCollectionReusableView.swift new file mode 100644 index 00000000..dac5129f --- /dev/null +++ b/Yep/Views/ReusableViews/AnnoationLabel/AnnoationCollectionReusableView.swift @@ -0,0 +1,14 @@ +// +// AnnoationCollectionReusableView.swift +// Yep +// +// Created by kevinzhow on 15/4/19. +// Copyright (c) 2015年 Catch Inc. All rights reserved. +// + +import UIKit + +class AnnoationCollectionReusableView: UICollectionReusableView { + @IBOutlet weak var label: UILabel! + +} From f68cdd61bde499d6dae9446dcfbcee6a4e88ab0d Mon Sep 17 00:00:00 2001 From: kevinzhow Date: Sun, 19 Apr 2015 17:20:44 +0800 Subject: [PATCH 3/4] Add second annoation and animation --- Podfile | 1 + Podfile.lock | 3 + Yep.xcodeproj/project.pbxproj | 8 + Yep/Base.lproj/Intro.storyboard | 37 ++++- .../RegisterSelectSkillsViewController.swift | 91 +++++++++-- .../Register/RegisterSkillsLayout.swift | 142 ++++++++++++++++++ .../SecondAnnoationLabelView.swift | 13 ++ 7 files changed, 275 insertions(+), 20 deletions(-) create mode 100644 Yep/ViewControllers/Register/RegisterSkillsLayout.swift create mode 100644 Yep/Views/ReusableViews/AnnoationLabel/SecondAnnoationLabelView.swift diff --git a/Podfile b/Podfile index e79dd2ba..adeb4fd6 100644 --- a/Podfile +++ b/Podfile @@ -2,6 +2,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! +pod 'pop' pod 'AFNetworking' pod 'MZFayeClient', :path => '../CatchLib-iOS/MZFayeClient/' pod 'JPushSDK' diff --git a/Podfile.lock b/Podfile.lock index d66691c8..4b36481a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -25,6 +25,7 @@ PODS: - MZFayeClient (1.0.0): - Base64 (~> 1.0.1) - SocketRocket (~> 0.3.1-beta2) + - pop (1.0.7) - Realm (0.91.3): - Realm/Headers (= 0.91.3) - Realm/Headers (0.91.3) @@ -34,6 +35,7 @@ DEPENDENCIES: - AFNetworking - JPushSDK - MZFayeClient (from `../CatchLib-iOS/MZFayeClient/`) + - pop - Realm EXTERNAL SOURCES: @@ -45,6 +47,7 @@ SPEC CHECKSUMS: Base64: 4924bf3ca6fa559a5161ef717291bd450eb7bd1a JPushSDK: c68dd04c595a5c93aa003f212974010790410d8e MZFayeClient: 19df756a4c86c8f414668e6edc54fccfee54adbb + pop: 628ffc631644601567ee8bfaaaea493ebd7d0923 Realm: 4bfdac6f0f3170a3947c7196e2e9a2e49c943719 SocketRocket: 7284ab9370a06c99aba92b2fe3a32aedd0f9a6fa diff --git a/Yep.xcodeproj/project.pbxproj b/Yep.xcodeproj/project.pbxproj index b809e557..0e1bafb8 100644 --- a/Yep.xcodeproj/project.pbxproj +++ b/Yep.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 0A02E46F1AC9208A00235DBF /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A02E46E1AC9208A00235DBF /* libxml2.dylib */; }; 0A0A117F1AE382AC0008772C /* AnnoationCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A0A117E1AE382AC0008772C /* AnnoationCollectionReusableView.swift */; }; + 0A0A11821AE389380008772C /* RegisterSkillsLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A0A11811AE389380008772C /* RegisterSkillsLayout.swift */; }; 0A271FD71ACA055400822DFC /* YepAudioService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A271FD61ACA055400822DFC /* YepAudioService.swift */; }; 0A3E60601ACCA9C0003DC853 /* String+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A3E605F1ACCA9C0003DC853 /* String+Yep.swift */; }; 0A3E60671ACCAECE003DC853 /* YepLocationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A3E60661ACCAECE003DC853 /* YepLocationService.swift */; }; @@ -21,6 +22,7 @@ 0A8F54C71AB67D11004AD60E /* YepTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8F54C61AB67D11004AD60E /* YepTests.swift */; }; 0A944C251AC8BB2F00037A06 /* YepStorageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A944C241AC8BB2F00037A06 /* YepStorageService.swift */; }; 0AAFCFF91AC8CA5B00EB0EF8 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AAFCFF81AC8CA5B00EB0EF8 /* MobileCoreServices.framework */; }; + 0AC725AE1AE3A94D005A3A98 /* SecondAnnoationLabelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC725AD1AE3A94D005A3A98 /* SecondAnnoationLabelView.swift */; }; 0AD7EA5E1AC3ED1200617758 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA5D1AC3ED1200617758 /* CFNetwork.framework */; }; 0AD7EA601AC3ED1900617758 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA5F1AC3ED1900617758 /* CoreFoundation.framework */; }; 0AD7EA621AC3ED2100617758 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA611AC3ED2100617758 /* CoreTelephony.framework */; }; @@ -136,6 +138,7 @@ /* Begin PBXFileReference section */ 0A02E46E1AC9208A00235DBF /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; 0A0A117E1AE382AC0008772C /* AnnoationCollectionReusableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AnnoationCollectionReusableView.swift; path = Views/ReusableViews/AnnoationLabel/AnnoationCollectionReusableView.swift; sourceTree = ""; }; + 0A0A11811AE389380008772C /* RegisterSkillsLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RegisterSkillsLayout.swift; path = ViewControllers/Register/RegisterSkillsLayout.swift; sourceTree = ""; }; 0A271FD61ACA055400822DFC /* YepAudioService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = YepAudioService.swift; path = Services/YepAudioService.swift; sourceTree = ""; }; 0A3E605F1ACCA9C0003DC853 /* String+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+Yep.swift"; path = "Extensions/String+Yep.swift"; sourceTree = ""; }; 0A3E60661ACCAECE003DC853 /* YepLocationService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = YepLocationService.swift; path = Services/YepLocationService.swift; sourceTree = ""; }; @@ -152,6 +155,7 @@ 0A8F54C61AB67D11004AD60E /* YepTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YepTests.swift; sourceTree = ""; }; 0A944C241AC8BB2F00037A06 /* YepStorageService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = YepStorageService.swift; path = Services/YepStorageService.swift; sourceTree = ""; }; 0AAFCFF81AC8CA5B00EB0EF8 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; + 0AC725AD1AE3A94D005A3A98 /* SecondAnnoationLabelView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SecondAnnoationLabelView.swift; path = Views/ReusableViews/AnnoationLabel/SecondAnnoationLabelView.swift; sourceTree = ""; }; 0AD7EA511AC3EA6F00617758 /* JPushSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JPushSDK.framework; path = "Pods/../build/Debug-iphoneos/Pods/JPushSDK.framework"; sourceTree = ""; }; 0AD7EA581AC3EAF300617758 /* Yep-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Yep-Bridging-Header.h"; sourceTree = ""; }; 0AD7EA5B1AC3ECD700617758 /* libPushSDK-1.8.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPushSDK-1.8.3.a"; path = "Yep/lib/libPushSDK-1.8.3.a"; sourceTree = ""; }; @@ -296,6 +300,7 @@ isa = PBXGroup; children = ( 0A0A117E1AE382AC0008772C /* AnnoationCollectionReusableView.swift */, + 0AC725AD1AE3A94D005A3A98 /* SecondAnnoationLabelView.swift */, ); name = Annoation; sourceTree = ""; @@ -544,6 +549,7 @@ 50C0909A1ADE234F00CC6389 /* RegisterPickSkillsViewController.swift */, 50C0909C1ADE294800CC6389 /* RegisterPickSkillsLayout.swift */, 50C090A31ADE46D500CC6389 /* RegisterSelectSkillsViewController.swift */, + 0A0A11811AE389380008772C /* RegisterSkillsLayout.swift */, ); name = Register; sourceTree = ""; @@ -1075,6 +1081,7 @@ 503CAB431AC00CB100DFE830 /* ConversationViewController.swift in Sources */, 50553F931ADBA50600F80B59 /* NSDate+Yep.swift in Sources */, 5023DE331AB688F600B3EE96 /* UIColor+Yep.swift in Sources */, + 0AC725AE1AE3A94D005A3A98 /* SecondAnnoationLabelView.swift in Sources */, 503315971AC1017E0008A209 /* ChatLeftTextCell.swift in Sources */, 0A8F54B11AB67D11004AD60E /* AppDelegate.swift in Sources */, 508D174C1ACCF49B0092D666 /* ChatRightAudioCell.swift in Sources */, @@ -1104,6 +1111,7 @@ 0A0A117F1AE382AC0008772C /* AnnoationCollectionReusableView.swift in Sources */, 50A9D4511ACD383E000B2599 /* NSDate+Extension.swift in Sources */, 506EC20A1AC95BFC00CE42B3 /* UIFont+Yep.swift in Sources */, + 0A0A11821AE389380008772C /* RegisterSkillsLayout.swift in Sources */, 50C0909B1ADE234F00CC6389 /* RegisterPickSkillsViewController.swift in Sources */, 508D16BD1ADCAF0400270E3F /* PullToRefreshView.swift in Sources */, 508D17441ACCDC9F0092D666 /* VoiceRecordButton.swift in Sources */, diff --git a/Yep/Base.lproj/Intro.storyboard b/Yep/Base.lproj/Intro.storyboard index ae7e8d98..c2a20440 100644 --- a/Yep/Base.lproj/Intro.storyboard +++ b/Yep/Base.lproj/Intro.storyboard @@ -557,11 +557,11 @@ - + -