Merge branch 'feature/user_badge' into develop

This commit is contained in:
nixzhu
2015-07-02 23:23:42 +08:00
54 changed files with 981 additions and 48 deletions
+28
View File
@@ -49,6 +49,8 @@
0AEB1CC41B0E6A4B00178C9C /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AEB1CC31B0E6A4B00178C9C /* Crashlytics.framework */; };
0AEB1CC61B0E742400178C9C /* Double+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AEB1CC51B0E742400178C9C /* Double+Yep.swift */; };
15606C18E1487982869C0A42 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD88F6095DB46DFAD41AB5DB /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
500A0B1C1B450C2100D49358 /* EditNicknameAndBadgeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500A0B1B1B450C2100D49358 /* EditNicknameAndBadgeViewController.swift */; };
500A0B1F1B451A6F00D49358 /* BadgeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500A0B1E1B451A6F00D49358 /* BadgeView.swift */; };
501560D71B427FD6000933F0 /* Results+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 501560D61B427FD6000933F0 /* Results+Yep.swift */; };
50165C451AC2860900C7AEBE /* ConversationLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50165C441AC2860900C7AEBE /* ConversationLayout.swift */; };
5019F6311B39BFE00000D993 /* ConversationMoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5019F6301B39BFE00000D993 /* ConversationMoreView.swift */; };
@@ -97,6 +99,7 @@
5039594F1B05E6E000797A3E /* ProfileSocialAccountGithubCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5039594D1B05E6E000797A3E /* ProfileSocialAccountGithubCell.xib */; };
503A54ED1B328ADB002077BD /* NSLocale+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 503A54EC1B328ADB002077BD /* NSLocale+Yep.swift */; };
503CAB431AC00CB100DFE830 /* ConversationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 503CAB421AC00CB100DFE830 /* ConversationViewController.swift */; };
504BDC151B4528A500DBD35D /* Badges.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504BDC141B4528A500DBD35D /* Badges.xcassets */; };
504CBA3D1B3D04B800663A90 /* ChatTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504CBA3C1B3D04B800663A90 /* ChatTextView.swift */; };
504F41251ACE2D1D00FBB19A /* SampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504F41241ACE2D1D00FBB19A /* SampleView.swift */; };
504F41571AD4D35400FBB19A /* ProfileLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504F41561AD4D35400FBB19A /* ProfileLayout.swift */; };
@@ -272,6 +275,8 @@
0AEB1CC31B0E6A4B00178C9C /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = "<group>"; };
0AEB1CC51B0E742400178C9C /* Double+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Double+Yep.swift"; path = "Extensions/Double+Yep.swift"; sourceTree = "<group>"; };
2268251A75FF6766DC31CCFB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
500A0B1B1B450C2100D49358 /* EditNicknameAndBadgeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EditNicknameAndBadgeViewController.swift; path = ViewControllers/EditNicknameAndBadge/EditNicknameAndBadgeViewController.swift; sourceTree = "<group>"; };
500A0B1E1B451A6F00D49358 /* BadgeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BadgeView.swift; path = Views/Badge/BadgeView.swift; sourceTree = "<group>"; };
501560D61B427FD6000933F0 /* Results+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Results+Yep.swift"; path = "Extensions/Results+Yep.swift"; sourceTree = "<group>"; };
50165C441AC2860900C7AEBE /* ConversationLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ConversationLayout.swift; path = ViewControllers/Conversation/ConversationLayout.swift; sourceTree = "<group>"; };
5019F6301B39BFE00000D993 /* ConversationMoreView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ConversationMoreView.swift; path = Views/ConversationMore/ConversationMoreView.swift; sourceTree = "<group>"; };
@@ -320,6 +325,7 @@
5039594D1B05E6E000797A3E /* ProfileSocialAccountGithubCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = ProfileSocialAccountGithubCell.xib; path = Views/Cells/ProfileSocialAccount/ProfileSocialAccountGithubCell.xib; sourceTree = "<group>"; };
503A54EC1B328ADB002077BD /* NSLocale+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSLocale+Yep.swift"; path = "Extensions/NSLocale+Yep.swift"; sourceTree = "<group>"; };
503CAB421AC00CB100DFE830 /* ConversationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ConversationViewController.swift; path = ViewControllers/Conversation/ConversationViewController.swift; sourceTree = "<group>"; };
504BDC141B4528A500DBD35D /* Badges.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Badges.xcassets; sourceTree = "<group>"; };
504CBA3C1B3D04B800663A90 /* ChatTextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ChatTextView.swift; path = Views/TextViews/ChatTextView.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>"; };
@@ -554,6 +560,7 @@
0A8F54B41AB67D11004AD60E /* Main.storyboard */,
502AE5171AB70D72005BD199 /* Intro.storyboard */,
0A8F54B71AB67D11004AD60E /* Images.xcassets */,
504BDC141B4528A500DBD35D /* Badges.xcassets */,
0A8F54B91AB67D11004AD60E /* LaunchScreen.xib */,
0A8F54AE1AB67D11004AD60E /* Supporting Files */,
);
@@ -651,6 +658,22 @@
name = JPush;
sourceTree = "<group>";
};
500A0B1D1B450C2F00D49358 /* EditNicknameAndBadge */ = {
isa = PBXGroup;
children = (
500A0B1B1B450C2100D49358 /* EditNicknameAndBadgeViewController.swift */,
);
name = EditNicknameAndBadge;
sourceTree = "<group>";
};
500A0B201B451A7400D49358 /* Badge */ = {
isa = PBXGroup;
children = (
500A0B1E1B451A6F00D49358 /* BadgeView.swift */,
);
name = Badge;
sourceTree = "<group>";
};
5019F62F1B39BFCB0000D993 /* ConversationMore */ = {
isa = PBXGroup;
children = (
@@ -692,6 +715,7 @@
0A5D83951AC5D3CD000045BF /* TabBar */,
50894CF21AEA472B000981AF /* Settings */,
50894CFF1AEA5A7E000981AF /* EditProfile */,
500A0B1D1B450C2F00D49358 /* EditNicknameAndBadge */,
0A1CAC6C1AFA3D8C00826B45 /* SkillHome */,
507CF1691AFC84AA00E261B4 /* CustomNavigationBar */,
0A9018831B0120A800AE4B7F /* OAuth */,
@@ -780,6 +804,7 @@
0AC25F041B1100F3009E6E13 /* ScrollView */,
50E18BB81B180F8E0076C3C6 /* SayHi */,
5019F62F1B39BFCB0000D993 /* ConversationMore */,
500A0B201B451A7400D49358 /* Badge */,
);
name = Views;
sourceTree = "<group>";
@@ -1606,6 +1631,7 @@
0A8F54B81AB67D11004AD60E /* Images.xcassets in Resources */,
50EB8CC51AE89F12001AC1EE /* ChatRightVideoCell.xib in Resources */,
502AE5191AB70D72005BD199 /* Intro.storyboard in Resources */,
504BDC151B4528A500DBD35D /* Badges.xcassets in Resources */,
0A9018871B01321F00AE4B7F /* WebViewJavascriptBridge.js.txt in Resources */,
50894D081AEDFDA2000981AF /* EditProfileMoreInfoCell.xib in Resources */,
508D174D1ACCF49B0092D666 /* ChatRightAudioCell.xib in Resources */,
@@ -1709,6 +1735,7 @@
502AE5381AB866E3005BD199 /* LoginVerifyMobileViewController.swift in Sources */,
5056AD6E1B05CB92003F9359 /* ProfileSocialAccountImagesCell.swift in Sources */,
506923141ADE025F00D27574 /* YepRefreshView.swift in Sources */,
500A0B1F1B451A6F00D49358 /* BadgeView.swift in Sources */,
503CAB431AC00CB100DFE830 /* ConversationViewController.swift in Sources */,
50553F931ADBA50600F80B59 /* NSDate+Yep.swift in Sources */,
50E61CEB1AF1F69D00908A9D /* ConversationTitleView.swift in Sources */,
@@ -1716,6 +1743,7 @@
503315971AC1017E0008A209 /* ChatLeftTextCell.swift in Sources */,
0A8F54B11AB67D11004AD60E /* AppDelegate.swift in Sources */,
508F8FC81B0161EF00461B0B /* ProfileSeparationLineCell.swift in Sources */,
500A0B1C1B450C2100D49358 /* EditNicknameAndBadgeViewController.swift in Sources */,
501560D71B427FD6000933F0 /* Results+Yep.swift in Sources */,
0AEB1CC61B0E742400178C9C /* Double+Yep.swift in Sources */,
508D174C1ACCF49B0092D666 /* ChatRightAudioCell.swift in Sources */,
+2 -2
View File
@@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
setSchemaVersion(12, Realm.defaultPath, { migration, oldSchemaVersion in
setSchemaVersion(13, Realm.defaultPath, { migration, oldSchemaVersion in
// We havent migrated anything yet, so oldSchemaVersion == 0
if oldSchemaVersion < 1 {
// Nothing to do!
@@ -63,7 +63,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}
if oldSchemaVersion < 12 {
if oldSchemaVersion < 13 {
}
})
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_android.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_apple.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_ball.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_bubble.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_camera.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_game.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_heart.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_music.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_palette.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_pet.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_plane.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_star.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_steve.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_tech.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "badge_wine.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode",
"template-rendering-intent" : "template"
}
}
Binary file not shown.
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "enabled_badge_background.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
+245 -1
View File
@@ -4,6 +4,7 @@
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Conversations-->
@@ -125,7 +126,7 @@
<userDefinedRuntimeAttribute type="string" keyPath="title" value="Choose photo"/>
</userDefinedRuntimeAttributes>
</button>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HcA-7v-16m" userLabel="Take Photo Button" customClass="MessageTypeButton" customModule="Yep" customModuleProvider="target">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HcA-7v-16m" userLabel="Take Photo Button" customClass="MessageTypeButton" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="213" y="20" width="174" height="260"/>
<animations/>
<state key="normal">
@@ -1006,6 +1007,7 @@
<outlet property="avatarImageViewWidthConstraint" destination="fy0-3p-Tx4" id="u5u-Us-aIh"/>
<outlet property="editProfileTableView" destination="obf-ax-Bn7" id="wPW-Jg-rwD"/>
<outlet property="mobileLabel" destination="bhV-NM-wXG" id="rUc-6h-9GQ"/>
<segue destination="dFC-hj-FfI" kind="show" identifier="showEditNicknameAndBadge" id="yNh-aJ-2PK"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="u2y-XJ-4gR" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -1017,6 +1019,247 @@
</objects>
<point key="canvasLocation" x="3586" y="717"/>
</scene>
<!--Edit Nickname And Badge View Controller-->
<scene sceneID="eed-5B-jyz">
<objects>
<tableViewController storyboardIdentifier="EditNicknameAndBadgeViewController" id="dFC-hj-FfI" customClass="EditNicknameAndBadgeViewController" customModule="Yep" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="pjg-sc-BhV">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/>
<sections>
<tableViewSection id="TBf-1w-J6s">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="60" id="hf0-DA-HE1">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hf0-DA-HE1" id="M5n-HW-GKn">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="NIX" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="QU0-LQ-GUp">
<rect key="frame" x="0.0" y="0.0" width="600" height="59"/>
<animations/>
<color key="textColor" red="0.40000000600000002" green="0.40000000600000002" blue="0.40000000600000002" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="Helvetica" family="Helvetica" pointSize="18"/>
<textInputTraits key="textInputTraits" returnKeyType="done"/>
</textField>
</subviews>
<animations/>
<constraints>
<constraint firstItem="QU0-LQ-GUp" firstAttribute="leading" secondItem="M5n-HW-GKn" secondAttribute="leading" id="9Kr-Hv-8hb"/>
<constraint firstAttribute="trailing" secondItem="QU0-LQ-GUp" secondAttribute="trailing" id="Q7S-ak-yyL"/>
<constraint firstAttribute="bottom" secondItem="QU0-LQ-GUp" secondAttribute="bottom" id="bvY-8U-ozD"/>
<constraint firstItem="QU0-LQ-GUp" firstAttribute="top" secondItem="M5n-HW-GKn" secondAttribute="top" id="pKI-ND-6jk"/>
</constraints>
</tableViewCellContentView>
<animations/>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection id="Osi-AX-ugj">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="250" id="rCs-Rg-jvK">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="rCs-Rg-jvK" id="Q18-jR-H2H">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="enabled_badge_background" translatesAutoresizingMaskIntoConstraints="NO" id="bd9-dd-MZA" userLabel="Badge Enabled Image View">
<rect key="frame" x="10" y="10" width="50" height="50"/>
<animations/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Iz2-o9-17H" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="115" y="48" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="FnR-av-JRq"/>
<constraint firstAttribute="width" constant="50" id="oxn-2a-F76"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mgs-nU-6GD" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="195" y="48" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="Oet-yJ-Jb8"/>
<constraint firstAttribute="width" constant="50" id="ciO-dF-UqB"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AtA-Ag-AzS" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="355" y="48" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="50" id="MfJ-cZ-Cim"/>
<constraint firstAttribute="height" constant="50" id="vJS-sa-3o3"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zpA-BY-1sO" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="435" y="48" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="GWn-RC-Ubu"/>
<constraint firstAttribute="width" constant="50" id="cEY-79-Od7"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SjH-ms-KaO" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="115" y="118" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="50" id="D7R-NN-m6r"/>
<constraint firstAttribute="height" constant="50" id="TV7-0q-F6Q"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hU0-li-PMo" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="195" y="118" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="MYJ-Ll-Ifo"/>
<constraint firstAttribute="width" constant="50" id="w3v-NQ-MIi"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6V5-ZD-ySN" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="275" y="118" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="WhU-Sh-Us1"/>
<constraint firstAttribute="width" constant="50" id="sGV-Jg-UhD"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ys0-N9-ZWV" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="355" y="118" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="8Yt-VY-BXY"/>
<constraint firstAttribute="width" constant="50" id="oQU-J6-roJ"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Y9P-e7-eZ5" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="435" y="118" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="50" id="2FP-CS-XWR"/>
<constraint firstAttribute="height" constant="50" id="ZVZ-9X-89T"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="05f-r8-WNL" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="115" y="188" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="Urm-wJ-CJH"/>
<constraint firstAttribute="width" constant="50" id="e5J-eC-p0F"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cXW-bq-1DS" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="195" y="188" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="icA-hh-X6c"/>
<constraint firstAttribute="width" constant="50" id="s1H-6S-jvp"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xdf-d7-hOE" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="275" y="188" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="50" id="D3g-Ka-0yn"/>
<constraint firstAttribute="height" constant="50" id="aqu-56-fOp"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="86U-zL-BF2" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="355" y="188" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="PD9-iF-HCF"/>
<constraint firstAttribute="width" constant="50" id="Qom-LV-lki"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xQ4-Pw-gO4" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="435" y="188" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="xR7-ue-dMM"/>
<constraint firstAttribute="width" constant="50" id="xSR-GH-BOD"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0U9-LP-d6j" customClass="BadgeView" customModule="Yep" customModuleProvider="target">
<rect key="frame" x="275" y="48" width="50" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="5vQ-px-m0V"/>
<constraint firstAttribute="width" constant="50" id="D2F-ef-ueg"/>
</constraints>
</view>
</subviews>
<animations/>
<constraints>
<constraint firstItem="zpA-BY-1sO" firstAttribute="leading" secondItem="AtA-Ag-AzS" secondAttribute="trailing" constant="30" id="1lV-M6-3XH"/>
<constraint firstItem="6V5-ZD-ySN" firstAttribute="centerX" secondItem="0U9-LP-d6j" secondAttribute="centerX" id="48p-UL-twb"/>
<constraint firstItem="AtA-Ag-AzS" firstAttribute="centerY" secondItem="0U9-LP-d6j" secondAttribute="centerY" id="4V7-Xp-54n"/>
<constraint firstItem="mgs-nU-6GD" firstAttribute="centerY" secondItem="0U9-LP-d6j" secondAttribute="centerY" id="5P5-6w-pkJ"/>
<constraint firstAttribute="centerX" secondItem="0U9-LP-d6j" secondAttribute="centerX" id="81H-Ii-sbZ"/>
<constraint firstItem="0U9-LP-d6j" firstAttribute="leading" secondItem="mgs-nU-6GD" secondAttribute="trailing" constant="30" id="EXp-MC-v7u"/>
<constraint firstItem="cXW-bq-1DS" firstAttribute="centerY" secondItem="xdf-d7-hOE" secondAttribute="centerY" id="EjK-xm-E25"/>
<constraint firstItem="Ys0-N9-ZWV" firstAttribute="centerY" secondItem="Y9P-e7-eZ5" secondAttribute="centerY" id="HL9-t4-SY6"/>
<constraint firstItem="cXW-bq-1DS" firstAttribute="centerY" secondItem="05f-r8-WNL" secondAttribute="centerY" id="Jbh-wq-ZEd"/>
<constraint firstItem="xQ4-Pw-gO4" firstAttribute="centerX" secondItem="Y9P-e7-eZ5" secondAttribute="centerX" id="Mv7-Yx-fTy"/>
<constraint firstItem="hU0-li-PMo" firstAttribute="centerY" secondItem="SjH-ms-KaO" secondAttribute="centerY" id="UXh-Mc-PIu"/>
<constraint firstItem="xdf-d7-hOE" firstAttribute="centerY" secondItem="86U-zL-BF2" secondAttribute="centerY" id="Uw9-DR-NlG"/>
<constraint firstItem="6V5-ZD-ySN" firstAttribute="centerY" secondItem="Ys0-N9-ZWV" secondAttribute="centerY" id="Vag-41-0IY"/>
<constraint firstItem="AtA-Ag-AzS" firstAttribute="leading" secondItem="0U9-LP-d6j" secondAttribute="trailing" constant="30" id="VbX-Lr-9Dx"/>
<constraint firstItem="mgs-nU-6GD" firstAttribute="centerY" secondItem="Iz2-o9-17H" secondAttribute="centerY" id="YCn-9X-o5f"/>
<constraint firstItem="xdf-d7-hOE" firstAttribute="centerX" secondItem="6V5-ZD-ySN" secondAttribute="centerX" id="YL4-y9-flK"/>
<constraint firstItem="mgs-nU-6GD" firstAttribute="leading" secondItem="Iz2-o9-17H" secondAttribute="trailing" constant="30" id="YpC-8p-aZq"/>
<constraint firstItem="hU0-li-PMo" firstAttribute="centerY" secondItem="6V5-ZD-ySN" secondAttribute="centerY" id="aLB-DF-dsZ"/>
<constraint firstItem="zpA-BY-1sO" firstAttribute="centerY" secondItem="AtA-Ag-AzS" secondAttribute="centerY" id="k9J-02-CyK"/>
<constraint firstItem="86U-zL-BF2" firstAttribute="centerX" secondItem="Ys0-N9-ZWV" secondAttribute="centerX" id="lej-eq-55f"/>
<constraint firstItem="SjH-ms-KaO" firstAttribute="centerX" secondItem="Iz2-o9-17H" secondAttribute="centerX" id="maA-EB-exO"/>
<constraint firstItem="6V5-ZD-ySN" firstAttribute="top" secondItem="0U9-LP-d6j" secondAttribute="bottom" constant="20" id="mqN-VY-gr6"/>
<constraint firstItem="0U9-LP-d6j" firstAttribute="top" secondItem="Q18-jR-H2H" secondAttribute="topMargin" constant="40" id="nJj-pX-ASY"/>
<constraint firstItem="AtA-Ag-AzS" firstAttribute="centerX" secondItem="Ys0-N9-ZWV" secondAttribute="centerX" id="p5d-DZ-JdY"/>
<constraint firstItem="cXW-bq-1DS" firstAttribute="centerX" secondItem="hU0-li-PMo" secondAttribute="centerX" id="pWZ-t7-n3c"/>
<constraint firstItem="05f-r8-WNL" firstAttribute="centerX" secondItem="SjH-ms-KaO" secondAttribute="centerX" id="q0q-Qn-G7i"/>
<constraint firstItem="xQ4-Pw-gO4" firstAttribute="centerY" secondItem="86U-zL-BF2" secondAttribute="centerY" id="qar-Yx-jqc"/>
<constraint firstItem="xdf-d7-hOE" firstAttribute="top" secondItem="6V5-ZD-ySN" secondAttribute="bottom" constant="20" id="tMf-SP-BPd"/>
<constraint firstItem="hU0-li-PMo" firstAttribute="centerX" secondItem="mgs-nU-6GD" secondAttribute="centerX" id="vbh-rS-XRn"/>
<constraint firstItem="zpA-BY-1sO" firstAttribute="centerX" secondItem="Y9P-e7-eZ5" secondAttribute="centerX" id="yem-F2-dSE"/>
</constraints>
</tableViewCellContentView>
<animations/>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="dFC-hj-FfI" id="vGj-mK-Udb"/>
<outlet property="delegate" destination="dFC-hj-FfI" id="31q-6f-32S"/>
</connections>
</tableView>
<connections>
<outlet property="androidBadgeView" destination="SjH-ms-KaO" id="ObT-Tv-ydL"/>
<outlet property="appleBadgeView" destination="hU0-li-PMo" id="gdg-ew-qzj"/>
<outlet property="badgeEnabledImageView" destination="bd9-dd-MZA" id="QdB-Fn-IpM"/>
<outlet property="ballBadgeView" destination="86U-zL-BF2" id="rhc-o7-V2z"/>
<outlet property="bubbleBadgeView" destination="zpA-BY-1sO" id="O7p-Iw-2JW"/>
<outlet property="cameraBadgeView" destination="cXW-bq-1DS" id="Kca-RZ-Pnn"/>
<outlet property="centerLeft1GapConstraint" destination="EXp-MC-v7u" id="XWH-sk-WOf"/>
<outlet property="centerRight1GapConstraint" destination="VbX-Lr-9Dx" id="4pi-0J-Fmi"/>
<outlet property="gameBadgeView" destination="xdf-d7-hOE" id="62f-cp-fai"/>
<outlet property="heartBadgeView" destination="0U9-LP-d6j" id="L4r-eK-KFQ"/>
<outlet property="left1Left2GapConstraint" destination="YpC-8p-aZq" id="NDj-zG-wUl"/>
<outlet property="musicBadgeView" destination="Y9P-e7-eZ5" id="uWH-T3-PsQ"/>
<outlet property="nicknameTextField" destination="QU0-LQ-GUp" id="Zid-x7-7C0"/>
<outlet property="paletteBadgeView" destination="Iz2-o9-17H" id="Eac-Uh-eNb"/>
<outlet property="petBadgeView" destination="6V5-ZD-ySN" id="Rak-cV-T08"/>
<outlet property="planeBadgeView" destination="mgs-nU-6GD" id="VrZ-ph-vsb"/>
<outlet property="right1Right2GapConstraint" destination="1lV-M6-3XH" id="HkA-a5-L4K"/>
<outlet property="starBadgeView" destination="AtA-Ag-AzS" id="Fzn-aB-o42"/>
<outlet property="steveBadgeView" destination="05f-r8-WNL" id="NlA-OR-Nnl"/>
<outlet property="techBadgeView" destination="xQ4-Pw-gO4" id="Kkc-6J-bIY"/>
<outlet property="wineBadgeView" destination="Ys0-N9-ZWV" id="9IV-Vb-CQ0"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="KVb-CY-yr0" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="4343" y="717"/>
</scene>
<!--Yep Tab Bar Controller-->
<scene sceneID="vud-lc-IAG">
<objects>
@@ -1386,6 +1629,7 @@
</scenes>
<resources>
<image name="default_avatar" width="100" height="100"/>
<image name="enabled_badge_background" width="50" height="50"/>
<image name="icon_chat" width="30" height="30"/>
<image name="icon_chat_active" width="30" height="30"/>
<image name="icon_contact" width="30" height="30"/>
+1 -1
View File
@@ -12,7 +12,7 @@ import RealmSwift
class AvatarCache {
static let sharedInstance = AvatarCache()
var cache = NSCache()
let cache = NSCache()
// func roundImageNamed(name: String, ofRadius radius: CGFloat) -> UIImage {
// let roundImageKey = "round-\(name)-\(radius)"
+1 -1
View File
@@ -13,7 +13,7 @@ import MapKit
class ImageCache {
static let sharedInstance = ImageCache()
var cache = NSCache()
let cache = NSCache()
func imageOfMessage(message: Message, withSize size: CGSize, tailDirection: MessageImageTailDirection, loadingProgress: Double -> Void, completion: (UIImage) -> ()) {
+7 -2
View File
@@ -55,11 +55,16 @@ func cleanRealmAndCaches() {
realm.deleteAll()
}
// clean Message caches
// cleam all memory caches
AvatarCache.sharedInstance.cache.removeAllObjects()
ImageCache.sharedInstance.cache.removeAllObjects()
// clean Message File caches
NSFileManager.cleanMessageCaches()
// clean Avatar caches
// clean Avatar File caches
NSFileManager.cleanAvatarCaches()
+22 -1
View File
@@ -14,6 +14,7 @@ let userIDKey = "userID"
let nicknameKey = "nickname"
let introductionKey = "introduction"
let avatarURLStringKey = "avatarURLString"
let badgeKey = "badge"
let pusherIDKey = "pusherID"
let areaCodeKey = "areaCode"
@@ -89,6 +90,7 @@ class YepUserDefaults {
defaults.removeObjectForKey(nicknameKey)
defaults.removeObjectForKey(introductionKey)
defaults.removeObjectForKey(avatarURLStringKey)
defaults.removeObjectForKey(badgeKey)
defaults.removeObjectForKey(pusherIDKey)
defaults.removeObjectForKey(areaCodeKey)
@@ -201,6 +203,26 @@ class YepUserDefaults {
}
}()
static var badge: Listenable<String?> = {
let defaults = NSUserDefaults.standardUserDefaults()
let badge = defaults.stringForKey(badgeKey)
return Listenable<String?>(badge) { badge in
defaults.setObject(badge, forKey: badgeKey)
let realm = Realm()
if let
badge = badge,
myUserID = YepUserDefaults.userID.value,
me = userWithUserID(myUserID, inRealm: realm) {
realm.beginWrite()
me.badge = badge
realm.commitWrite()
}
}
}()
static var pusherID: Listenable<String?> = {
let defaults = NSUserDefaults.standardUserDefaults()
let pusherID = defaults.stringForKey(pusherIDKey)
@@ -240,7 +262,6 @@ class YepUserDefaults {
defaults.setObject(mobile, forKey: mobileKey)
}
}()
}
+1
View File
@@ -73,6 +73,7 @@ class User: Object {
dynamic var introduction: String = ""
dynamic var avatarURLString: String = ""
dynamic var avatar: Avatar?
dynamic var badge: String = ""
dynamic var createdUnixTime: NSTimeInterval = NSDate().timeIntervalSince1970
dynamic var lastSignInUnixTime: NSTimeInterval = NSDate().timeIntervalSince1970
+3 -1
View File
@@ -710,6 +710,7 @@ struct DiscoveredUser {
let nickname: String
let introduction: String?
let avatarURLString: String
let badge: String?
let createdUnixTime: NSTimeInterval
let lastSignInUnixTime: NSTimeInterval
@@ -750,8 +751,9 @@ let parseDiscoveredUser: JSONDictionary -> DiscoveredUser? = { userInfo in
}
let introduction = userInfo["introduction"] as? String
let badge = userInfo["badge"] as? String
let discoverUser = DiscoveredUser(id: id, nickname: nickname, introduction: introduction, avatarURLString: avatarURLString, createdUnixTime: createdUnixTime, lastSignInUnixTime: lastSignInUnixTime, longitude: longitude, latitude: latitude, distance: distance, masterSkills: masterSkills, learningSkills: learningSkills, socialAccountProviders: socialAccountProviders)
let discoverUser = DiscoveredUser(id: id, nickname: nickname, introduction: introduction, avatarURLString: avatarURLString, badge: badge, createdUnixTime: createdUnixTime, lastSignInUnixTime: lastSignInUnixTime, longitude: longitude, latitude: latitude, distance: distance, masterSkills: masterSkills, learningSkills: learningSkills, socialAccountProviders: socialAccountProviders)
return discoverUser
}
+20
View File
@@ -209,6 +209,10 @@ func syncMyInfoAndDoFurtherAction(furtherAction: () -> Void) {
user.avatarURLString = avatarURLString
}
if let badge = friendInfo["badge"] as? String {
user.badge = badge
}
//
if let learningSkillsData = friendInfo["learning_skills"] as? [JSONDictionary] {
@@ -254,6 +258,10 @@ func syncMyInfoAndDoFurtherAction(furtherAction: () -> Void) {
YepUserDefaults.avatarURLString.value = avatarURLString
}
if let badge = friendInfo["badge"] as? String {
YepUserDefaults.badge.value = badge
}
if let areaCode = friendInfo["phone_code"] as? String {
YepUserDefaults.areaCode.value = areaCode
}
@@ -355,6 +363,10 @@ func syncFriendshipsAndDoFurtherAction(furtherAction: () -> Void) {
user.avatarURLString = avatarURLString
}
if let badge = friendInfo["badge"] as? String {
user.badge = badge
}
if let friendshipID = friendshipInfo["id"] as? String {
user.friendshipID = friendshipID
}
@@ -544,6 +556,10 @@ private func syncGroupWithGroupInfo(groupInfo: JSONDictionary, inRealm realm: Re
owner.avatarURLString = avatarURLString
}
if let badge = ownerInfo["badge"] as? String {
owner.badge = badge
}
//
if let learningSkillsData = ownerInfo["learning_skills"] as? [JSONDictionary] {
@@ -656,6 +672,10 @@ private func syncGroupWithGroupInfo(groupInfo: JSONDictionary, inRealm realm: Re
member.avatarURLString = avatarURLString
}
if let badge = memberInfo["badge"] as? String {
member.badge = badge
}
//
if let learningSkillsData = memberInfo["learning_skills"] as? [JSONDictionary] {
@@ -110,6 +110,14 @@ extension ContactsViewController: UITableViewDataSource, UITableViewDelegate {
}
cell.nameLabel.text = friend.nickname
if let badge = BadgeView.Badge(rawValue: friend.badge) {
cell.badgeImageView.image = badge.image
cell.badgeImageView.tintColor = badge.color
} else {
cell.badgeImageView.image = nil
}
cell.joinedDateLabel.text = friend.introduction
cell.lastTimeSeenLabel.text = NSDate(timeIntervalSince1970: friend.createdUnixTime).timeAgo
}
@@ -155,6 +155,13 @@ extension DiscoverViewController: UITableViewDataSource, UITableViewDelegate {
cell.nameLabel.text = discoveredUser.nickname
if let badgeName = discoveredUser.badge, badge = BadgeView.Badge(rawValue: badgeName) {
cell.badgeImageView.image = badge.image
cell.badgeImageView.tintColor = badge.color
} else {
cell.badgeImageView.image = nil
}
return cell
}
@@ -0,0 +1,198 @@
//
// EditNicknameAndBadgeViewController.swift
// Yep
//
// Created by NIX on 15/7/2.
// Copyright (c) 2015 Catch Inc. All rights reserved.
//
import UIKit
class EditNicknameAndBadgeViewController: UITableViewController {
@IBOutlet weak var nicknameTextField: UITextField!
@IBOutlet weak var centerLeft1GapConstraint: NSLayoutConstraint!
@IBOutlet weak var centerRight1GapConstraint: NSLayoutConstraint!
@IBOutlet weak var left1Left2GapConstraint: NSLayoutConstraint!
@IBOutlet weak var right1Right2GapConstraint: NSLayoutConstraint!
@IBOutlet weak var badgeEnabledImageView: UIImageView!
@IBOutlet weak var paletteBadgeView: BadgeView!
@IBOutlet weak var planeBadgeView: BadgeView!
@IBOutlet weak var heartBadgeView: BadgeView!
@IBOutlet weak var starBadgeView: BadgeView!
@IBOutlet weak var bubbleBadgeView: BadgeView!
@IBOutlet weak var androidBadgeView: BadgeView!
@IBOutlet weak var appleBadgeView: BadgeView!
@IBOutlet weak var petBadgeView: BadgeView!
@IBOutlet weak var wineBadgeView: BadgeView!
@IBOutlet weak var musicBadgeView: BadgeView!
@IBOutlet weak var steveBadgeView: BadgeView!
@IBOutlet weak var cameraBadgeView: BadgeView!
@IBOutlet weak var gameBadgeView: BadgeView!
@IBOutlet weak var ballBadgeView: BadgeView!
@IBOutlet weak var techBadgeView: BadgeView!
var badgeViews = [BadgeView]()
override func viewDidLoad() {
super.viewDidLoad()
title = NSLocalizedString("Nickname", comment: "")
nicknameTextField.text = YepUserDefaults.nickname.value
nicknameTextField.delegate = self
let gap = UIDevice.matchWidthFrom(10, 25, 32)
centerLeft1GapConstraint.constant = gap
centerRight1GapConstraint.constant = gap
left1Left2GapConstraint.constant = gap
right1Right2GapConstraint.constant = gap
paletteBadgeView.badge = .Palette
planeBadgeView.badge = .Plane
heartBadgeView.badge = .Heart
starBadgeView.badge = .Star
bubbleBadgeView.badge = .Bubble
androidBadgeView.badge = .Android
appleBadgeView.badge = .Apple
petBadgeView.badge = .Pet
wineBadgeView.badge = .Wine
musicBadgeView.badge = .Music
steveBadgeView.badge = .Steve
cameraBadgeView.badge = .Camera
gameBadgeView.badge = .Game
ballBadgeView.badge = .Ball
techBadgeView.badge = .Tech
badgeViews = [
paletteBadgeView,
planeBadgeView,
heartBadgeView,
starBadgeView,
bubbleBadgeView,
androidBadgeView,
appleBadgeView,
petBadgeView,
wineBadgeView,
musicBadgeView,
steveBadgeView,
cameraBadgeView,
gameBadgeView,
ballBadgeView,
techBadgeView,
]
let disableAllBadges: () -> Void = {
badgeViews.map { $0.enabled = false }
}
badgeViews.map {
$0.tapAction = { badgeView in
disableAllBadges()
badgeView.enabled = true
// select animation
if self.badgeEnabledImageView.hidden {
self.badgeEnabledImageViewAppearInCenter(badgeView.center)
} else {
UIView.animateWithDuration(0.2, delay: 0.0, usingSpringWithDamping: 0.65, initialSpringVelocity: 0.0, options: UIViewAnimationOptions(0), animations: { _ in
self.badgeEnabledImageView.center = badgeView.center
}, completion: { finished in
})
}
// try save online & local
let newBadgeName = badgeView.badge.rawValue
updateMyselfWithInfo(["badge": newBadgeName], failureHandler: { [weak self] (reason, errorMessage) in
defaultFailureHandler(reason, errorMessage)
dispatch_async(dispatch_get_main_queue()) {
badgeView.enabled = false
YepAlert.alertSorry(message: errorMessage ?? NSLocalizedString("Set badge failed!", comment: ""), inViewController: self)
}
}, completion: { success in
dispatch_async(dispatch_get_main_queue()) {
YepUserDefaults.badge.value = newBadgeName
}
})
}
}
}
func badgeEnabledImageViewAppearInCenter(center: CGPoint) {
badgeEnabledImageView.center = center
badgeEnabledImageView.alpha = 0
badgeEnabledImageView.hidden = false
badgeEnabledImageView.transform = CGAffineTransformMakeScale(0.0001, 0.0001)
UIView.animateWithDuration(0.2, delay: 0.0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.0, options: UIViewAnimationOptions(0), animations: { _ in
self.badgeEnabledImageView.alpha = 1
self.badgeEnabledImageView.transform = CGAffineTransformMakeScale(1.0, 1.0)
}, completion: { finished in
self.badgeEnabledImageView.transform = CGAffineTransformIdentity
})
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
if let badgeName = YepUserDefaults.badge.value {
badgeViews.map { $0.enabled = ($0.badge.rawValue == badgeName) }
}
if let enabledBadgeView = badgeViews.filter({ $0.enabled }).first {
badgeEnabledImageViewAppearInCenter(enabledBadgeView.center)
}
}
}
extension EditNicknameAndBadgeViewController: UITextFieldDelegate {
func textFieldShouldReturn(textField: UITextField) -> Bool {
if textField == nicknameTextField {
textField.resignFirstResponder()
let newNickname = textField.text
if newNickname != YepUserDefaults.nickname.value {
updateMyselfWithInfo(["nickname": newNickname], failureHandler: { (reason, errorMessage) in
defaultFailureHandler(reason, errorMessage)
dispatch_async(dispatch_get_main_queue()) {
YepAlert.alertSorry(message: errorMessage ?? NSLocalizedString("Set nickname failed!", comment: ""), inViewController: self)
}
}, completion: { success in
dispatch_async(dispatch_get_main_queue()) {
YepUserDefaults.nickname.value = newNickname
}
})
}
}
return true
}
}
@@ -38,11 +38,13 @@ class EditProfileViewController: UIViewController {
struct Listener {
static let Nickname = "EditProfileLessInfoCell.Nickname"
static let Introduction = "EditProfileLessInfoCell.Introduction"
static let Badge = "EditProfileLessInfoCell.Badge"
}
deinit {
YepUserDefaults.nickname.removeListenerWithName(Listener.Nickname)
YepUserDefaults.introduction.removeListenerWithName(Listener.Introduction)
YepUserDefaults.badge.removeListenerWithName(Listener.Badge)
}
override func viewDidLoad() {
@@ -168,6 +170,19 @@ extension EditProfileViewController: UITableViewDataSource, UITableViewDelegate
cell?.infoLabel.text = nickname
}
YepUserDefaults.badge.bindAndFireListener(Listener.Badge) { [weak cell] badgeName in
if let badgeName = badgeName, badge = BadgeView.Badge(rawValue: badgeName) {
cell?.badgeImageView.image = badge.image
cell?.badgeImageView.tintColor = badge.color
cell?.infoLabelTrailingConstraint.constant = EditProfileLessInfoCell.ConstraintConstant.normalInfoLabelTrailing
} else {
cell?.badgeImageView.image = nil
cell?.infoLabelTrailingConstraint.constant = EditProfileLessInfoCell.ConstraintConstant.minInfoLabelTrailing
}
}
return cell
case InfoRow.Intro.rawValue:
@@ -238,30 +253,7 @@ extension EditProfileViewController: UITableViewDataSource, UITableViewDelegate
case InfoRow.Name.rawValue:
YepAlert.textInput(title: NSLocalizedString("Change nickname", comment: ""), placeholder: YepUserDefaults.nickname.value, oldText: YepUserDefaults.nickname.value, confirmTitle: NSLocalizedString("OK", comment: ""), cancelTitle: NSLocalizedString("Cancel", comment: ""), inViewController: self, withConfirmAction: { newNickname in
if let oldNickname = YepUserDefaults.nickname.value {
if oldNickname == newNickname {
return
}
}
YepHUD.showActivityIndicator()
updateMyselfWithInfo(["nickname": newNickname], failureHandler: { (reason, errorMessage) in
defaultFailureHandler(reason, errorMessage)
YepHUD.hideActivityIndicator()
}, completion: { success in
dispatch_async(dispatch_get_main_queue()) {
YepUserDefaults.nickname.value = newNickname
}
YepHUD.hideActivityIndicator()
})
}, cancelAction: nil)
performSegueWithIdentifier("showEditNicknameAndBadge", sender: nil)
case InfoRow.Intro.rawValue:
@@ -98,6 +98,13 @@ extension SearchedUsersViewController: UITableViewDataSource, UITableViewDelegat
cell.nameLabel.text = discoveredUser.nickname
if let badgeName = discoveredUser.badge, badge = BadgeView.Badge(rawValue: badgeName) {
cell.badgeImageView.image = badge.image
cell.badgeImageView.tintColor = badge.color
} else {
cell.badgeImageView.image = nil
}
return cell
}
@@ -316,6 +316,13 @@ extension SkillHomeViewController: UITableViewDelegate, UITableViewDataSource{
cell.lastTimeSeenLabel.text = "\(distance) km | \(NSDate(timeIntervalSince1970: discoveredUser.lastSignInUnixTime).timeAgo)"
cell.nameLabel.text = discoveredUser.nickname
if let badgeName = discoveredUser.badge, badge = BadgeView.Badge(rawValue: badgeName) {
cell.badgeImageView.image = badge.image
cell.badgeImageView.tintColor = badge.color
} else {
cell.badgeImageView.image = nil
}
return cell
}
+131
View File
@@ -0,0 +1,131 @@
//
// BadgeView.swift
// Yep
//
// Created by NIX on 15/7/2.
// Copyright (c) 2015 Catch Inc. All rights reserved.
//
import UIKit
//@IBDesignable
class BadgeView: UIView {
enum Badge: String {
case Palette = "palette"
case Plane = "plane"
case Heart = "heart"
case Star = "star"
case Bubble = "bubble"
case Android = "android"
case Apple = "apple"
case Pet = "pet"
case Wine = "wine"
case Music = "music"
case Steve = "steve"
case Camera = "camera"
case Game = "game"
case Ball = "ball"
case Tech = "tech"
struct Color {
static let red = UIColor(red: 1, green: 56/255.0, blue: 36/255.0, alpha: 1)
static let green = UIColor(red:0.1, green:0.74, blue:0.61, alpha:1)
static let blue = UIColor(red: 56/255.0, green: 166/255.0, blue: 249/255.0, alpha: 1)
static let yellow = UIColor(red: 245/255.0, green: 166/255.0, blue: 35/255.0, alpha: 1)
static let dark = UIColor(red: 52/255.0, green: 73/255.0, blue: 94/255.0, alpha: 1)
}
var color: UIColor {
switch self {
case .Palette:
return Color.red
case .Plane:
return Color.blue
case .Heart:
return Color.red
case .Star:
return Color.yellow
case .Bubble:
return Color.dark
case .Android:
return Color.green
case .Apple:
return Color.dark
case .Pet:
return Color.yellow
case .Wine:
return Color.red
case .Music:
return Color.green
case .Steve:
return Color.blue
case .Camera:
return Color.green
case .Game:
return Color.dark
case .Ball:
return Color.blue
case .Tech:
return Color.blue
}
}
var image: UIImage? {
return UIImage(named: "badge_" + self.rawValue)
}
}
//@IBInspectable
var badge: Badge = .Heart {
willSet {
badgeImageView.image = newValue.image
badgeImageView.tintColor = newValue.color
}
}
var enabled: Bool = false {
willSet {
UIView.animateWithDuration(0.1, delay: 0.0, options: .CurveEaseInOut, animations: { _ in
self.badgeImageView.tintColor = newValue ? UIColor.whiteColor() : self.badge.color
}, completion: { finished in
})
}
}
var tapAction: ((BadgeView) -> Void)?
lazy var badgeImageView: UIImageView = {
let imageView = UIImageView()
return imageView
}()
override func didMoveToSuperview() {
super.didMoveToSuperview()
makeUI()
let tap = UITapGestureRecognizer(target: self, action: "tap")
addGestureRecognizer(tap)
}
func makeUI() {
addSubview(badgeImageView)
badgeImageView.setTranslatesAutoresizingMaskIntoConstraints(false)
let iconConstraintCenterX = NSLayoutConstraint(item: badgeImageView, attribute: .CenterX, relatedBy: .Equal, toItem: self, attribute: .CenterX, multiplier: 1, constant: 0)
let iconConstraintCenterY = NSLayoutConstraint(item: badgeImageView, attribute: .CenterY, relatedBy: .Equal, toItem: self, attribute: .CenterY, multiplier: 1, constant: 0)
NSLayoutConstraint.activateConstraints([iconConstraintCenterX, iconConstraintCenterY])
}
func tap() {
tapAction?(self)
}
}
@@ -12,6 +12,7 @@ class ContactsCell: UITableViewCell {
@IBOutlet weak var avatarImageView: UIImageView!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var badgeImageView: UIImageView!
@IBOutlet weak var joinedDateLabel: UILabel!
@IBOutlet weak var lastTimeSeenLabel: UILabel!
+24 -6
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="15A204h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
@@ -17,46 +17,64 @@
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yGz-R6-Ojm">
<rect key="frame" x="10" y="9" width="60" height="60"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="60" id="aIX-QM-JmX"/>
<constraint firstAttribute="width" secondItem="yGz-R6-Ojm" secondAttribute="height" multiplier="1:1" id="lmu-1p-Arx"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Last seen just now" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GZ1-Eh-QgO">
<rect key="frame" x="214" y="11" width="98" height="14.5"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Last seen just now" textAlignment="right" lineBreakMode="headTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GZ1-Eh-QgO">
<rect key="frame" x="152" y="10" width="160" height="15"/>
<animations/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="12"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.20000000000000001" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Joined 2 days ago" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FiT-eM-gyl">
<rect key="frame" x="85" y="31" width="227" height="14.5"/>
<rect key="frame" x="85" y="31" width="227" height="14"/>
<animations/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="12"/>
<color key="textColor" white="0.5039117192" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ivk-sQ-ylu">
<rect key="frame" x="85" y="9" width="38.5" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ivk-sQ-ylu">
<rect key="frame" x="85" y="9" width="39" height="17"/>
<animations/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" white="0.24954602940000001" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="tcJ-0E-OaK" userLabel="Badge Image View">
<rect key="frame" x="128" y="8" width="20" height="20"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="20" id="13c-mN-wTw"/>
<constraint firstAttribute="height" constant="20" id="ym9-Np-uSB"/>
</constraints>
</imageView>
</subviews>
<animations/>
<constraints>
<constraint firstItem="yGz-R6-Ojm" firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="FiT-eM-gyl" secondAttribute="bottom" id="0z3-gW-v7y"/>
<constraint firstItem="FiT-eM-gyl" firstAttribute="top" secondItem="Ivk-sQ-ylu" secondAttribute="bottom" constant="5" id="1kW-2j-UuV"/>
<constraint firstAttribute="trailingMargin" secondItem="FiT-eM-gyl" secondAttribute="trailing" id="5If-Nf-IA4"/>
<constraint firstItem="Ivk-sQ-ylu" firstAttribute="centerY" secondItem="GZ1-Eh-QgO" secondAttribute="centerY" id="E3d-lm-33u"/>
<constraint firstItem="tcJ-0E-OaK" firstAttribute="centerY" secondItem="Ivk-sQ-ylu" secondAttribute="centerY" id="F7j-lm-KhY"/>
<constraint firstItem="GZ1-Eh-QgO" firstAttribute="leading" secondItem="tcJ-0E-OaK" secondAttribute="trailing" constant="4" id="FSh-I3-H5N"/>
<constraint firstAttribute="trailingMargin" secondItem="GZ1-Eh-QgO" secondAttribute="trailing" id="Gm9-19-lG0"/>
<constraint firstItem="yGz-R6-Ojm" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="2" id="KCX-fD-Fa3"/>
<constraint firstItem="Ivk-sQ-ylu" firstAttribute="top" secondItem="yGz-R6-Ojm" secondAttribute="top" id="OZ4-3P-YhA"/>
<constraint firstItem="tcJ-0E-OaK" firstAttribute="leading" secondItem="Ivk-sQ-ylu" secondAttribute="trailing" constant="4" id="SBz-AF-J0n"/>
<constraint firstAttribute="centerY" secondItem="yGz-R6-Ojm" secondAttribute="centerY" id="UQR-Dh-Vgo"/>
<constraint firstItem="yGz-R6-Ojm" firstAttribute="width" secondItem="yGz-R6-Ojm" secondAttribute="height" multiplier="1:1" id="ZAK-Uh-3Kv"/>
<constraint firstItem="FiT-eM-gyl" firstAttribute="leading" secondItem="yGz-R6-Ojm" secondAttribute="trailing" constant="15" id="bB9-Ud-vlZ"/>
<constraint firstItem="Ivk-sQ-ylu" firstAttribute="leading" secondItem="yGz-R6-Ojm" secondAttribute="trailing" constant="15" id="dTe-Mk-5Xz"/>
</constraints>
</tableViewCellContentView>
<animations/>
<connections>
<outlet property="avatarImageView" destination="yGz-R6-Ojm" id="O3c-lg-gwo"/>
<outlet property="badgeImageView" destination="tcJ-0E-OaK" id="XS4-SI-UqT"/>
<outlet property="joinedDateLabel" destination="FiT-eM-gyl" id="h56-pB-9Rl"/>
<outlet property="lastTimeSeenLabel" destination="GZ1-Eh-QgO" id="nBg-yA-C5F"/>
<outlet property="nameLabel" destination="Ivk-sQ-ylu" id="Atm-Ra-qKr"/>
@@ -13,11 +13,21 @@ class EditProfileLessInfoCell: UITableViewCell {
@IBOutlet weak var annotationLabel: UILabel!
@IBOutlet weak var infoLabel: UILabel!
@IBOutlet weak var infoLabelTrailingConstraint: NSLayoutConstraint!
struct ConstraintConstant {
static let minInfoLabelTrailing: CGFloat = 8
static let normalInfoLabelTrailing: CGFloat = 8 + 30 + 8
}
@IBOutlet weak var badgeImageView: UIImageView!
@IBOutlet weak var accessoryImageView: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
accessoryImageView.tintColor = UIColor.lightGrayColor()
}
override func setSelected(selected: Bool, animated: Bool) {
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="15A204h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -13,32 +13,59 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Annotation" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0FC-Jf-4Gf" userLabel="Annotation Label">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Annotation" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0FC-Jf-4Gf" userLabel="Annotation Label">
<rect key="frame" x="20" y="33" width="84" height="22"/>
<animations/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Info" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fGP-fu-MyB" userLabel="Info Label">
<rect key="frame" x="114" y="33" width="188" height="22"/>
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_accessory" translatesAutoresizingMaskIntoConstraints="NO" id="0NC-W7-akb" userLabel="Accessory Image View">
<rect key="frame" x="289" y="34" width="11" height="20"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="11" id="ChB-JG-3DU"/>
<constraint firstAttribute="height" constant="20" id="dxD-M9-cbe"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="badge_heart" translatesAutoresizingMaskIntoConstraints="NO" id="jP3-gP-mQQ" userLabel="Badge Image View">
<rect key="frame" x="251" y="29" width="30" height="30"/>
<animations/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Info" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fGP-fu-MyB" userLabel="Info Label">
<rect key="frame" x="114" y="33" width="129" height="22"/>
<animations/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="18"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<constraints>
<constraint firstAttribute="centerY" secondItem="fGP-fu-MyB" secondAttribute="centerY" id="082-8c-wbn"/>
<constraint firstItem="0FC-Jf-4Gf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="20" id="Ktt-S1-9Cv"/>
<constraint firstItem="fGP-fu-MyB" firstAttribute="leading" secondItem="0FC-Jf-4Gf" secondAttribute="trailing" constant="10" id="UHV-0J-Zaw"/>
<constraint firstAttribute="trailing" secondItem="fGP-fu-MyB" secondAttribute="trailing" constant="18" id="Une-Pw-pgT"/>
<constraint firstItem="0NC-W7-akb" firstAttribute="leading" secondItem="jP3-gP-mQQ" secondAttribute="trailing" constant="8" id="cco-RU-D7u"/>
<constraint firstItem="0NC-W7-akb" firstAttribute="leading" secondItem="fGP-fu-MyB" secondAttribute="trailing" constant="46" id="jwJ-Ba-pSI"/>
<constraint firstAttribute="centerY" secondItem="0FC-Jf-4Gf" secondAttribute="centerY" id="lV1-c6-cFn"/>
<constraint firstAttribute="trailing" secondItem="0NC-W7-akb" secondAttribute="trailing" constant="20" id="pEZ-0p-HYS"/>
<constraint firstItem="jP3-gP-mQQ" firstAttribute="centerY" secondItem="0NC-W7-akb" secondAttribute="centerY" id="q5E-hz-FOw"/>
<constraint firstAttribute="centerY" secondItem="0NC-W7-akb" secondAttribute="centerY" id="wb5-wi-DJT"/>
</constraints>
</tableViewCellContentView>
<animations/>
<connections>
<outlet property="accessoryImageView" destination="0NC-W7-akb" id="l4y-nU-0t0"/>
<outlet property="annotationLabel" destination="0FC-Jf-4Gf" id="RHM-ZO-VeP"/>
<outlet property="badgeImageView" destination="jP3-gP-mQQ" id="fsi-H7-Me4"/>
<outlet property="infoLabel" destination="fGP-fu-MyB" id="PzP-fc-sc1"/>
<outlet property="infoLabelTrailingConstraint" destination="jwJ-Ba-pSI" id="1Lq-p3-BSJ"/>
</connections>
<point key="canvasLocation" x="444" y="394"/>
</tableViewCell>
</objects>
<resources>
<image name="badge_heart" width="30" height="30"/>
<image name="icon_accessory" width="11" height="20"/>
</resources>
</document>
@@ -96,7 +96,6 @@ class ProfileHeaderCell: UICollectionViewCell {
} else {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
let blurredImage = image.blurredImageWithRadius(20, iterations: 20, tintColor: UIColor.blackColor())
completion(blurredImage)
}
}