Merge branch 'feature/new_profile' into develop

This commit is contained in:
nixzhu
2015-04-08 16:11:59 +08:00
13 changed files with 230 additions and 51 deletions
+16
View File
@@ -75,6 +75,8 @@
503CAB431AC00CB100DFE830 /* ConversationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 503CAB421AC00CB100DFE830 /* ConversationViewController.swift */; };
504F41251ACE2D1D00FBB19A /* SampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504F41241ACE2D1D00FBB19A /* SampleView.swift */; };
504F41571AD4D35400FBB19A /* ProfileLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504F41561AD4D35400FBB19A /* ProfileLayout.swift */; };
504F415A1AD5028200FBB19A /* SkillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504F41581AD5028200FBB19A /* SkillCell.swift */; };
504F415B1AD5028200FBB19A /* SkillCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 504F41591AD5028200FBB19A /* SkillCell.xib */; };
506EC20A1AC95BFC00CE42B3 /* UIFont+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506EC2091AC95BFC00CE42B3 /* UIFont+Yep.swift */; };
5076C56A1AC46B9F00B22952 /* FayeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5076C5691AC46B9F00B22952 /* FayeService.swift */; };
508D17401ACCD2740092D666 /* YepButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508D173F1ACCD2740092D666 /* YepButton.swift */; };
@@ -189,6 +191,8 @@
503CAB421AC00CB100DFE830 /* ConversationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ConversationViewController.swift; path = ViewControllers/Conversation/ConversationViewController.swift; sourceTree = "<group>"; };
504F41241ACE2D1D00FBB19A /* SampleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SampleView.swift; path = Views/AudioWaves/SampleView.swift; sourceTree = "<group>"; };
504F41561AD4D35400FBB19A /* ProfileLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProfileLayout.swift; path = ViewControllers/Profile/ProfileLayout.swift; sourceTree = "<group>"; };
504F41581AD5028200FBB19A /* SkillCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SkillCell.swift; path = Views/Cells/Skill/SkillCell.swift; sourceTree = "<group>"; };
504F41591AD5028200FBB19A /* SkillCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = SkillCell.xib; path = Views/Cells/Skill/SkillCell.xib; sourceTree = "<group>"; };
506EC2091AC95BFC00CE42B3 /* UIFont+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIFont+Yep.swift"; path = "Extensions/UIFont+Yep.swift"; sourceTree = "<group>"; };
5076C5691AC46B9F00B22952 /* FayeService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FayeService.swift; path = Services/FayeService.swift; sourceTree = "<group>"; };
508D173F1ACCD2740092D666 /* YepButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = YepButton.swift; path = Views/Buttons/YepButton.swift; sourceTree = "<group>"; };
@@ -437,6 +441,7 @@
children = (
5023DE3B1AB697B000B3EE96 /* Conversation */,
502AE5421AB88866005BD199 /* SkillRank */,
504F415C1AD5028500FBB19A /* Skill */,
502AE5501AB93178005BD199 /* ProfileHeader */,
502AE5551AB93218005BD199 /* ProfileFooter */,
50E114FE1ABC549800F13000 /* Contacts */,
@@ -624,6 +629,15 @@
name = Conversation;
sourceTree = "<group>";
};
504F415C1AD5028500FBB19A /* Skill */ = {
isa = PBXGroup;
children = (
504F41581AD5028200FBB19A /* SkillCell.swift */,
504F41591AD5028200FBB19A /* SkillCell.xib */,
);
name = Skill;
sourceTree = "<group>";
};
508D17491ACCF4740092D666 /* ChatLeftAudio */ = {
isa = PBXGroup;
children = (
@@ -826,6 +840,7 @@
buildActionMask = 2147483647;
files = (
5023DE381AB6979600B3EE96 /* ConversationCell.xib in Resources */,
504F415B1AD5028200FBB19A /* SkillCell.xib in Resources */,
502AE5591AB932D5005BD199 /* ProfileSectionHeaderReusableView.xib in Resources */,
502AE5411AB88862005BD199 /* SkillRankCell.xib in Resources */,
502AE5541AB93215005BD199 /* ProfileFooterCell.xib in Resources */,
@@ -980,6 +995,7 @@
502AE5531AB93215005BD199 /* ProfileFooterCell.swift in Sources */,
0A5D83991AC5D91E000045BF /* ContactsSearchTableViewController.swift in Sources */,
0A944C251AC8BB2F00037A06 /* YepStorageService.swift in Sources */,
504F415A1AD5028200FBB19A /* SkillCell.swift in Sources */,
5023DE521AB6C51300B3EE96 /* CGRect+Yep.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
+1 -1
View File
@@ -238,7 +238,7 @@
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="VZO-hp-fyU" userLabel="Profile Collection View">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="0.0" id="WvZ-fD-rR0" customClass="ProfileLayout" customModule="Yep" customModuleProvider="target">
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="WvZ-fD-rR0" customClass="ProfileLayout" customModule="Yep" customModuleProvider="target">
<size key="itemSize" width="141" height="116"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
+4
View File
@@ -12,4 +12,8 @@ extension UIFont {
class func chatTextFont() -> UIFont {
return UIFont.systemFontOfSize(16)
}
class func skillTextFont() -> UIFont {
return UIFont(name: "Helvetica-Light", size: 14)!
}
}
+24
View File
@@ -0,0 +1,24 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "skill_bubble.pdf",
"resizing" : {
"mode" : "3-part-horizontal",
"center" : {
"mode" : "fill",
"width" : 1
},
"capInsets" : {
"right" : 12,
"left" : 12
}
}
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
@@ -32,6 +32,55 @@ class ProfileLayout: UICollectionViewFlowLayout {
}
}
// item centerY
var rowCollections = [CGFloat: [UICollectionViewLayoutAttributes]]()
for (index, attributes) in enumerate(layoutAttributes) {
let centerY = CGRectGetMidY(attributes.frame)
if let rowCollection = rowCollections[centerY] {
var rowCollection = rowCollection
rowCollection.append(attributes)
rowCollections[centerY] = rowCollection
} else {
rowCollections[centerY] = [attributes]
}
}
// item frame
for (key, rowCollection) in rowCollections {
let rowItemsCount = rowCollection.count
// InteritemSpacing
let aggregateInteritemSpacing = minimumInteritemSpacing * CGFloat(rowItemsCount - 1)
// items
var aggregateItemsWidth: CGFloat = 0
for attributes in rowCollection {
aggregateItemsWidth += CGRectGetWidth(attributes.frame)
}
// width offset
let alignmentWidth = aggregateItemsWidth + aggregateInteritemSpacing
let alignmentOffsetX = (CGRectGetWidth(collectionView!.bounds) - alignmentWidth) / 2
// item origin.x
var previousFrame = CGRectZero
for attributes in rowCollection {
var itemFrame = attributes.frame
if CGRectEqualToRect(previousFrame, CGRectZero) {
itemFrame.origin.x = alignmentOffsetX
} else {
itemFrame.origin.x = CGRectGetMaxX(previousFrame) + minimumInteritemSpacing
}
attributes.frame = itemFrame
previousFrame = itemFrame
}
}
return layoutAttributes
}
@@ -16,7 +16,7 @@ class ProfileViewController: UIViewController {
@IBOutlet weak var profileCollectionView: UICollectionView!
let skillRanckCellIdentifier = "SkillRankCell"
let skillCellIdentifier = "SkillCell"
let headerCellIdentifier = "ProfileHeaderCell"
let footerCellIdentifier = "ProfileFooterCell"
let sectionHeaderIdentifier = "ProfileSectionHeaderReusableView"
@@ -27,12 +27,9 @@ class ProfileViewController: UIViewController {
}()
lazy var sectionLeftEdgeInset: CGFloat = { return 20 }()
lazy var sectionRightEdgeInset: CGFloat = { return 20 }()
lazy var sectionBottomEdgeInset: CGFloat = { return 20 }()
lazy var sectionBottomEdgeInset: CGFloat = { return 15 }()
lazy var cellWidth: CGFloat = {
return (self.collectionViewWidth - (self.sectionLeftEdgeInset + self.sectionRightEdgeInset)) / 3
}()
let cellHeight: CGFloat = 40
let skillCellHeight: CGFloat = 24
let introductionText = "I would like to learn Design or Speech, I can teach you iOS Dev in return. 😃"
@@ -41,6 +38,9 @@ class ProfileViewController: UIViewController {
["skill":"iOS Dev", "rank":3],
["skill":"Linux", "rank":2],
["skill":"Cook", "rank":1],
["skill":"Love", "rank":1],
["skill":"Walk", "rank":1],
["skill":"Eat", "rank":1],
]
let learningSkills = [
@@ -48,6 +48,8 @@ class ProfileViewController: UIViewController {
["skill":"Speech", "rank":0],
]
let skillTextAttributes = [NSFontAttributeName: UIFont.skillTextFont()]
lazy var footerCellHeight: CGFloat = {
let attributes = [NSFontAttributeName: profileIntroductionLabelFont]
let labelWidth = self.collectionViewWidth - (profileIntroductionLabelLeadingSpaceToContainer + profileIntroductionLabelTrailingSpaceToContainer)
@@ -58,7 +60,7 @@ class ProfileViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
profileCollectionView.registerNib(UINib(nibName: skillRanckCellIdentifier, bundle: nil), forCellWithReuseIdentifier: skillRanckCellIdentifier)
profileCollectionView.registerNib(UINib(nibName: skillCellIdentifier, bundle: nil), forCellWithReuseIdentifier: skillCellIdentifier)
profileCollectionView.registerNib(UINib(nibName: headerCellIdentifier, bundle: nil), forCellWithReuseIdentifier: headerCellIdentifier)
profileCollectionView.registerNib(UINib(nibName: footerCellIdentifier, bundle: nil), forCellWithReuseIdentifier: footerCellIdentifier)
profileCollectionView.registerNib(UINib(nibName: sectionHeaderIdentifier, bundle: nil), forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: sectionHeaderIdentifier)
@@ -66,7 +68,7 @@ class ProfileViewController: UIViewController {
profileCollectionView.alwaysBounceVertical = true
self.automaticallyAdjustsScrollViewInsets = false
automaticallyAdjustsScrollViewInsets = false
if let tabBarController = tabBarController {
profileCollectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: CGRectGetHeight(tabBarController.tabBar.bounds), right: 0)
@@ -78,14 +80,16 @@ class ProfileViewController: UIViewController {
navigationController.navigationBar.shadowImage = UIImage()
navigationController.navigationBar.barStyle = UIBarStyle.BlackTranslucent
navigationController.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
let textAttributes = [
NSForegroundColorAttributeName: UIColor.whiteColor(),
NSFontAttributeName: UIFont(name: "HelveticaNeue-CondensedBlack", size: 20)!
]
navigationController.navigationBar.titleTextAttributes = textAttributes
navigationItem.title = YepUserDefaults.nickname()
}
let textAttributes = [
NSForegroundColorAttributeName: UIColor.whiteColor(),
NSFontAttributeName: UIFont(name: "HelveticaNeue-CondensedBlack", size: 20)!
]
self.navigationController?.navigationBar.titleTextAttributes = textAttributes
}
override func viewWillAppear(animated: Bool) {
@@ -151,9 +155,9 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel
enum ProfileSection: Int {
case Header = 0
case Footer
case Master
case Learning
case Footer
}
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
@@ -168,10 +172,10 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel
return 1
case ProfileSection.Master.rawValue:
return 3
return masterSkills.count
case ProfileSection.Learning.rawValue:
return 2
return learningSkills.count
case ProfileSection.Footer.rawValue:
return 1
@@ -229,24 +233,19 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel
return cell
case ProfileSection.Master.rawValue:
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(skillRanckCellIdentifier, forIndexPath: indexPath) as! SkillRankCell
cell.rankView.barColor = UIColor.skillMasterColor()
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(skillCellIdentifier, forIndexPath: indexPath) as! SkillCell
let skillInfo = masterSkills[indexPath.row % masterSkills.count]
cell.skillLabel.text = skillInfo["skill"] as? String
cell.rankView.rank = skillInfo["rank"] as! Int
return cell
case ProfileSection.Learning.rawValue:
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(skillRanckCellIdentifier, forIndexPath: indexPath) as! SkillRankCell
cell.rankView.barColor = UIColor.skillLearningColor()
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(skillCellIdentifier, forIndexPath: indexPath) as! SkillCell
let skillInfo = learningSkills[indexPath.row % learningSkills.count]
cell.skillLabel.text = skillInfo["skill"] as? String
cell.rankView.rank = skillInfo["rank"] as! Int
return cell
@@ -258,7 +257,7 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel
return cell
default:
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(skillRanckCellIdentifier, forIndexPath: indexPath) as! SkillRankCell
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(skillCellIdentifier, forIndexPath: indexPath) as! SkillCell
return cell
}
@@ -272,18 +271,12 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel
switch indexPath.section {
case ProfileSection.Header.rawValue:
header.titleLabel.text = ""
case ProfileSection.Master.rawValue:
header.titleLabel.text = NSLocalizedString("Master", comment: "")
case ProfileSection.Learning.rawValue:
header.titleLabel.text = NSLocalizedString("Learning", comment: "")
case ProfileSection.Footer.rawValue:
header.titleLabel.text = NSLocalizedString("Introduction", comment: "")
default:
header.titleLabel.text = ""
}
@@ -325,10 +318,28 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel
return CGSizeMake(collectionViewWidth, collectionViewWidth * profileAvatarAspectRatio)
case ProfileSection.Master.rawValue:
return CGSizeMake(cellWidth, cellHeight)
let skillInfo = masterSkills[indexPath.row % masterSkills.count]
if let skillString = skillInfo["skill"] as? String {
let rect = skillString.boundingRectWithSize(CGSize(width: CGFloat(FLT_MAX), height: skillCellHeight), options: .UsesLineFragmentOrigin | .UsesFontLeading, attributes: skillTextAttributes, context: nil)
return CGSizeMake(rect.width + 24, skillCellHeight)
}
return CGSizeZero
case ProfileSection.Learning.rawValue:
return CGSizeMake(cellWidth, cellHeight)
let skillInfo = learningSkills[indexPath.row % learningSkills.count]
if let skillString = skillInfo["skill"] as? String {
let rect = skillString.boundingRectWithSize(CGSize(width: CGFloat(FLT_MAX), height: skillCellHeight), options: .UsesLineFragmentOrigin | .UsesFontLeading, attributes: skillTextAttributes, context: nil)
return CGSizeMake(rect.width + 24, skillCellHeight)
}
return CGSizeZero
case ProfileSection.Footer.rawValue:
return CGSizeMake(collectionViewWidth, footerCellHeight)
@@ -340,11 +351,11 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
if section == ProfileSection.Header.rawValue {
if section == ProfileSection.Header.rawValue || section == ProfileSection.Footer.rawValue {
return CGSizeMake(collectionViewWidth, 0)
} else {
return CGSizeMake(collectionViewWidth, cellHeight)
return CGSizeMake(collectionViewWidth, 40)
}
}
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7525" systemVersion="14C1510" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7528.3" systemVersion="14C1514" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7516"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7518.3"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -12,9 +12,9 @@
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="I would like to learn Design or Speech, I can teach you iOS Dev in return. 😃" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Yw-Z7-Wv4" userLabel="Introduction Label">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="I would like to learn Design or Speech, I can teach you iOS Dev in return. 😃" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Yw-Z7-Wv4" userLabel="Introduction Label">
<rect key="frame" x="20" y="11" width="280" height="29"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Thin" family="Helvetica Neue" pointSize="12"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="12"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
@@ -21,6 +21,9 @@ class ProfileHeaderCell: UICollectionViewCell {
override func awakeFromNib() {
super.awakeFromNib()
nameLabel.hidden = true
joinedDateLabel.hidden = true
let tap = UITapGestureRecognizer(target: self, action: "tryChangeAvatar")
avatarImageView.userInteractionEnabled = true
@@ -28,8 +28,8 @@
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="O8h-bQ-ZK8" userLabel="Location Label">
<rect key="frame" x="320" y="219" width="53" height="15"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="广州市" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="O8h-bQ-ZK8" userLabel="Location Label">
<rect key="frame" x="178" y="219" width="36" height="15"/>
<fontDescription key="fontDescription" type="system" weight="thin" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
@@ -39,14 +39,14 @@
</view>
<constraints>
<constraint firstItem="9iO-cK-3UB" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="0GC-5l-kfn"/>
<constraint firstItem="O8h-bQ-ZK8" firstAttribute="centerY" secondItem="NGG-vt-AMI" secondAttribute="centerY" id="0l4-yp-iX1"/>
<constraint firstItem="NGG-vt-AMI" firstAttribute="top" secondItem="g9S-Zs-82d" secondAttribute="bottom" constant="9" id="8I5-zm-l9l"/>
<constraint firstItem="NGG-vt-AMI" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="20" id="8fv-Rm-QbG"/>
<constraint firstAttribute="centerX" secondItem="O8h-bQ-ZK8" secondAttribute="centerX" constant="0.5" id="AQb-AI-JHu"/>
<constraint firstAttribute="bottom" secondItem="NGG-vt-AMI" secondAttribute="bottom" constant="20" id="Cu1-M1-6gp"/>
<constraint firstItem="g9S-Zs-82d" firstAttribute="leading" secondItem="NGG-vt-AMI" secondAttribute="leading" id="GmS-dS-tav"/>
<constraint firstAttribute="bottom" secondItem="O8h-bQ-ZK8" secondAttribute="bottom" constant="20" id="INr-hz-CLg"/>
<constraint firstAttribute="trailing" secondItem="9iO-cK-3UB" secondAttribute="trailing" id="Ykz-Gm-skT"/>
<constraint firstAttribute="bottom" secondItem="9iO-cK-3UB" secondAttribute="bottom" id="ZaW-Gv-rm4"/>
<constraint firstAttribute="trailing" secondItem="O8h-bQ-ZK8" secondAttribute="trailing" constant="20" id="m1m-M7-tKT"/>
<constraint firstItem="9iO-cK-3UB" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="sHm-q3-PrJ"/>
</constraints>
<size key="customSize" width="393" height="254"/>
+23
View File
@@ -0,0 +1,23 @@
//
// SkillCell.swift
// Yep
//
// Created by NIX on 15/4/8.
// Copyright (c) 2015 Catch Inc. All rights reserved.
//
import UIKit
class SkillCell: UICollectionViewCell {
@IBOutlet weak var backgroundImageView: UIImageView!
@IBOutlet weak var skillLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
skillLabel.font = UIFont.skillTextFont()
}
}
+48
View File
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7528.3" systemVersion="14C1514" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7518.3"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="SkillCell" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="99" height="24"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="99" height="24"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="skill_bubble" translatesAutoresizingMaskIntoConstraints="NO" id="4KZ-yR-VQ6" userLabel="Background Image View">
<rect key="frame" x="0.0" y="0.0" width="99" height="24"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Skill" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="prI-fu-aCg" userLabel="Skill Label">
<rect key="frame" x="0.0" y="0.0" width="99" height="24"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="14"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<constraints>
<constraint firstItem="4KZ-yR-VQ6" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="4sC-RB-pGY"/>
<constraint firstItem="prI-fu-aCg" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="VFw-pk-5m2"/>
<constraint firstItem="prI-fu-aCg" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="XPk-hp-Pnx"/>
<constraint firstAttribute="trailing" secondItem="4KZ-yR-VQ6" secondAttribute="trailing" id="YxK-JV-RP9"/>
<constraint firstAttribute="bottom" secondItem="4KZ-yR-VQ6" secondAttribute="bottom" id="ewi-IE-HdV"/>
<constraint firstAttribute="bottom" secondItem="prI-fu-aCg" secondAttribute="bottom" id="j2p-h5-mgW"/>
<constraint firstAttribute="trailing" secondItem="prI-fu-aCg" secondAttribute="trailing" id="tfv-VL-6Ld"/>
<constraint firstItem="4KZ-yR-VQ6" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="w4Z-jQ-pXH"/>
</constraints>
<size key="customSize" width="99" height="50"/>
<connections>
<outlet property="backgroundImageView" destination="4KZ-yR-VQ6" id="qZe-Gq-CEM"/>
<outlet property="skillLabel" destination="prI-fu-aCg" id="UgO-cv-Laf"/>
</connections>
<point key="canvasLocation" x="250.5" y="325"/>
</collectionViewCell>
</objects>
<resources>
<image name="skill_bubble" width="25" height="24"/>
</resources>
</document>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7525" systemVersion="14C1510" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7528.3" systemVersion="14C1514" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7516"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7518.3"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -10,9 +10,9 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Master || Learning" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jUu-2Q-uyR">
<rect key="frame" x="20" y="14" width="126" height="21"/>
<fontDescription key="fontDescription" type="system" weight="thin" pointSize="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Master || Learning" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jUu-2Q-uyR">
<rect key="frame" x="20" y="13" width="280" height="24"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
@@ -20,6 +20,7 @@
<constraints>
<constraint firstAttribute="centerY" secondItem="jUu-2Q-uyR" secondAttribute="centerY" constant="0.5" id="1ZI-gC-gcl"/>
<constraint firstItem="jUu-2Q-uyR" firstAttribute="leading" secondItem="U6b-Vx-4bR" secondAttribute="leading" constant="20" id="dY5-Yz-hAH"/>
<constraint firstAttribute="trailing" secondItem="jUu-2Q-uyR" secondAttribute="trailing" constant="20" id="hHy-Oz-K9a"/>
</constraints>
<connections>
<outlet property="titleLabel" destination="jUu-2Q-uyR" id="BZ3-xM-iK1"/>