Skip to content

Commit

Permalink
Merge branch 'release/1.1_40'
Browse files Browse the repository at this point in the history
  • Loading branch information
duemunk committed Dec 3, 2014
2 parents 312a009 + 5350f5d commit 6966541
Show file tree
Hide file tree
Showing 26 changed files with 173 additions and 15 deletions.
4 changes: 3 additions & 1 deletion BeMyEyes Tests/BeMyEyes Tests-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#import <MiawKit/MKLocalization.h>
#import <MiawKit/MKFunctions.h>
#import "MKLocalizationKeys.h"

#import "BMEPointEntry.h"
#import "BMECommunityStats.h"

#import "BMEHelperMainViewController.h"
#import "BMEBlindMainViewController.h"
35 changes: 35 additions & 0 deletions BeMyEyes Tests/BlindMainViewController_Tests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// BlindMainViewController_Tests.swift
// BeMyEyes
//
// Created by Tobias Due Munk on 02/12/14.
// Copyright (c) 2014 Be My Eyes. All rights reserved.
//

import UIKit
import XCTest

class BlindMainViewController_Tests: FBSnapshotTestCase {

var helperVC: BMEBlindMainViewController?

override func setUp() {
super.setUp()
// recordMode = true

helperVC = UIApplication.sharedApplication().keyWindow?.rootViewController?.storyboard?.instantiateViewControllerWithIdentifier(BMEMainBlindControllerIdentifier) as? BMEBlindMainViewController
helperVC?.viewDidLoad()
}

override func tearDown() {
super.tearDown()
}

func testOnAllDevices() {
verifyViewOnAllDevices(helperVC!.view)
}

func testCreatePromoScreenshots() {
verifyViewForPromoScreenshots(helperVC!.view)
}
}
59 changes: 57 additions & 2 deletions BeMyEyes Tests/DataHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
// Copyright (c) 2014 Be My Eyes. All rights reserved.
//

import UIKit

extension BMEUser {

class func idealUser() -> BMEUser {
let user = BMEUser()
user.setValue("Sarah", forKey: "firstName")
user.setValue(330, forKey: "totalPoints")
if let image = UIImage(named: "ProfileSarah.png") {
user.setValue(image, forKey: "profileImage")
}
user.setValue("Sara", forKey: "firstName")
user.setValue(345, forKey: "totalPoints")
user.setValue(13, forKey: "peopleHelped")

let currentLevel = BMEUserLevel()
currentLevel.title = "Trusted Helper"
Expand All @@ -21,7 +27,56 @@ extension BMEUser {
let nextLevel = BMEUserLevel()
nextLevel.threshold = 500
user.setValue(nextLevel, forKey: "nextLevel")

var point1 = BMEPointEntry()
point1.setValue(30, forKey: "point")
point1.setValue("finish_helping_request", forKey: "event")
point1.setValue(NSDate().dateByAddingTimeInterval(-60*2), forKey: "date")
var point2 = BMEPointEntry()
point2.setValue(5, forKey: "point")
point2.setValue("answer_push_message", forKey: "event")
point2.setValue(NSDate().dateByAddingTimeInterval(-60*60*3), forKey: "date")
var point3 = BMEPointEntry()
point3.setValue(30, forKey: "point")
point3.setValue("finish_helping_request", forKey: "event")
point3.setValue(NSDate().dateByAddingTimeInterval(-60*60*24), forKey: "date")
var point4 = BMEPointEntry()
point4.setValue(30, forKey: "point")
point4.setValue("finish_helping_request", forKey: "event")
point4.setValue(NSDate().dateByAddingTimeInterval(-60*60*72), forKey: "date")
user.setValue([point1, point2, point3, point4], forKey: "lastPointEntries")

return user
}
}

extension BMECommunityStats {

class func idealStats() -> BMECommunityStats {
var stats = BMECommunityStats()
stats.sighted = 361
stats.blind = 121
stats.helped = 554
return stats
}
}


//@"signup"]) {
// S_ENTRY_SIGNUP_DESCRIPTION;
// String:@"answer_push_message"]) {
// S_ENTRY_ANSWER_PUSH_MESSAGE_DESCRIPTION;
// String:@"answer_push_message_technical_error"]
// S_ENTRY_ANSWER_PUSH_MESSAGE_TECHNICAL_ERROR_DE
// String:@"finish_helping_request"]) {
// S_ENTRY_FINISH_HELPING_REQUEST_DESCRIPTION;
// String:@"finish_10_helping_request_in_a_week"]
// S_ENTRY_FINISH_10_HELPING_REQUESTS_IN_A_WEEK_D
// String:@"finish_5_high_fives_in_a_week"]) {
// S_ENTRY_FINISH_5_HIGH_FIVES_IN_A_WEEK_DESCRIPT
// String:@"share_on_twitter"]) {
// S_ENTRY_SHARE_ON_TWITTER_DESCRIPTION;
// String:@"share_on_facebook"]) {
// S_ENTRY_SHARE_ON_FACEBOOK_DESCRIPTION;
// String:@"watch_video"]) {
// S_ENTRY_WATCH_VIDEO_DESCRIPTION;
9 changes: 9 additions & 0 deletions BeMyEyes Tests/HelperMainViewController_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ class HelperMainViewController_Tests: FBSnapshotTestCase {
func testOnAllDevices() {
if let helperVC = helperVC {
helperVC.user = BMEUser.idealUser()
helperVC.stats = BMECommunityStats.idealStats()
}
verifyViewOnAllDevices(helperVC!.view)
}

func testCreatePromoScreenshots() {
if let helperVC = helperVC {
helperVC.user = BMEUser.idealUser()
helperVC.stats = BMECommunityStats.idealStats()
}
verifyViewForPromoScreenshots(helperVC!.view)
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BeMyEyes Tests/Resources/ProfileSarah.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BeMyEyes Tests/Resources/Profile_of_a_Woman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions BeMyEyes Tests/SnapshotHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ struct Device {
Device(bounds: CGRect(x: 0, y: 0, width: 621, height: 1104), description: "iPhone 6+"),
Device(bounds: CGRect(x: 0, y: 0, width: 768, height: 1024), description: "iPad")]
}

static func allPromoScreenshots() -> [Device] {
return [ Device(bounds: CGRect(x: 0, y: 0, width: 375, height: 590), description: "iPhone 6 for promo Screenshot"),
Device(bounds: CGRect(x: 0, y: 0, width: 375, height: 667), description: "iPhone 6 for promo Screenshot (full)")]
}
}

extension FBSnapshotTestCase {
Expand All @@ -43,4 +48,13 @@ extension FBSnapshotTestCase {
verifyView(view, identifier: identifier + device.description)
}
}

func verifyViewForPromoScreenshots(view: UIView, identifier: String = "") {

for device in Device.allPromoScreenshots() {
view.frame = device.bounds

verifyView(view, identifier: identifier + device.description)
}
}
}
32 changes: 27 additions & 5 deletions BeMyEyes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
2FD4008389D1CCFBA33318E8 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22A222A28C44403D94B34BA1 /* libPods.a */; };
4E08EE7A19E1693200B45088 /* OpenTok.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E08EE7919E1693200B45088 /* OpenTok.framework */; };
4E1916CF19E5800300B85E61 /* MaskedLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E1916CE19E5800300B85E61 /* MaskedLabel.swift */; };
4E1916D119E5804800B85E61 /* SplitMaskedLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E1916D019E5804800B85E61 /* SplitMaskedLabel.swift */; };
Expand All @@ -24,7 +23,6 @@
4E7BA9AC1A1BDC1400F9744A /* ClientTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7BA9AB1A1BDC1400F9744A /* ClientTest.swift */; };
4E7BA9B61A1CE2DC00F9744A /* MaskedLabel_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7BA9B51A1CE2DC00F9744A /* MaskedLabel_Tests.swift */; };
4E7BA9B81A1CE64300F9744A /* GVUserDefaults+Settings.m in Sources */ = {isa = PBXBuildFile; fileRef = 729B1CD21901699500B5ABEA /* GVUserDefaults+Settings.m */; };
4E7BA9BA1A1CF4B800F9744A /* MaskedLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E1916CE19E5800300B85E61 /* MaskedLabel.swift */; };
4E7BA9BC1A1CF50C00F9744A /* SnapshotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7BA9BB1A1CF50C00F9744A /* SnapshotHelper.swift */; };
4E7BA9BE1A1CF5DA00F9744A /* DataHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7BA9BD1A1CF5DA00F9744A /* DataHelper.swift */; };
4E7BA9C31A1DEE4500F9744A /* HelperMainViewController_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7BA9C21A1DEE4500F9744A /* HelperMainViewController_Tests.swift */; };
Expand All @@ -51,7 +49,13 @@
4EBE9BFA19E8C91000CBC675 /* DismissSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EBE9BF919E8C91000CBC675 /* DismissSegue.m */; };
4EC696EE1A2625E6007E5680 /* BMEUserTypeConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EC696ED1A2625E6007E5680 /* BMEUserTypeConverter.m */; };
4EDCE93F1A01E069006C7A4A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4EDCE9411A01E069006C7A4A /* LaunchScreen.storyboard */; };
4EE671BE1A2DAEE50037865B /* Profile_of_a_Woman.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EE671BD1A2DAEE50037865B /* Profile_of_a_Woman.png */; };
4EE671C01A2DB3240037865B /* ProfileSarah.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EE671BF1A2DB3240037865B /* ProfileSarah.png */; };
4EE671C11A2DB4260037865B /* Profile_of_a_Woman.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EE671BD1A2DAEE50037865B /* Profile_of_a_Woman.png */; };
4EE671C21A2DB4260037865B /* ProfileSarah.png in Resources */ = {isa = PBXBuildFile; fileRef = 4EE671BF1A2DB3240037865B /* ProfileSarah.png */; };
4EE671C41A2DF9C10037865B /* BlindMainViewController_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE671C31A2DF9C10037865B /* BlindMainViewController_Tests.swift */; };
4EE91D1419E5977C00CF4F23 /* RadioButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE91D1319E5977C00CF4F23 /* RadioButton.swift */; };
4EFA28081A2B7A4F0050450C /* MaskedLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E1916CE19E5800300B85E61 /* MaskedLabel.swift */; };
556D82D33DA8A505A137BD4A /* libPods-BeMyEyes Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 03381774851623C2C6BE0645 /* libPods-BeMyEyes Tests.a */; };
7206A76118FA9BF000251824 /* BMEPointLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7206A76018FA9BF000251824 /* BMEPointLabel.m */; };
7206A76618FA9C0D00251824 /* BMEPointGraphEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 7206A76318FA9C0D00251824 /* BMEPointGraphEntry.m */; };
Expand Down Expand Up @@ -258,6 +262,9 @@
4EC696EC1A2625E6007E5680 /* BMEUserTypeConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BMEUserTypeConverter.h; sourceTree = "<group>"; };
4EC696ED1A2625E6007E5680 /* BMEUserTypeConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BMEUserTypeConverter.m; sourceTree = "<group>"; };
4EDCE9441A01E07A006C7A4A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4EE671BD1A2DAEE50037865B /* Profile_of_a_Woman.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Profile_of_a_Woman.png; sourceTree = "<group>"; };
4EE671BF1A2DB3240037865B /* ProfileSarah.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ProfileSarah.png; sourceTree = "<group>"; };
4EE671C31A2DF9C10037865B /* BlindMainViewController_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlindMainViewController_Tests.swift; sourceTree = "<group>"; };
4EE91D1319E5977C00CF4F23 /* RadioButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioButton.swift; sourceTree = "<group>"; };
541D916399355C19CD490FDC /* Pods-BeMyEyes Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BeMyEyes Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BeMyEyes Tests/Pods-BeMyEyes Tests.debug.xcconfig"; sourceTree = "<group>"; };
5DB997FFB6ADF4A3BE47FEBF /* Pods.releasedev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.releasedev.xcconfig; path = "Pods/Target Support Files/Pods/Pods.releasedev.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -455,7 +462,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2FD4008389D1CCFBA33318E8 /* libPods.a in Frameworks */,
556D82D33DA8A505A137BD4A /* libPods-BeMyEyes Tests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -505,9 +511,11 @@
4E7BA9AB1A1BDC1400F9744A /* ClientTest.swift */,
4E7BA9B51A1CE2DC00F9744A /* MaskedLabel_Tests.swift */,
4E7BA9C21A1DEE4500F9744A /* HelperMainViewController_Tests.swift */,
4EE671C31A2DF9C10037865B /* BlindMainViewController_Tests.swift */,
4E7BA9BB1A1CF50C00F9744A /* SnapshotHelper.swift */,
4E7BA9BD1A1CF5DA00F9744A /* DataHelper.swift */,
4E7BA9A81A1B5E9900F9744A /* BeMyEyes Tests-Bridging-Header.h */,
4EE671BC1A2DAEE50037865B /* Resources */,
4E7BA99B1A1B5D9300F9744A /* Supporting Files */,
);
path = "BeMyEyes Tests";
Expand All @@ -521,6 +529,15 @@
name = "Supporting Files";
sourceTree = "<group>";
};
4EE671BC1A2DAEE50037865B /* Resources */ = {
isa = PBXGroup;
children = (
4EE671BD1A2DAEE50037865B /* Profile_of_a_Woman.png */,
4EE671BF1A2DB3240037865B /* ProfileSarah.png */,
);
path = Resources;
sourceTree = "<group>";
};
721CAF1F192D2EAA00B5B4E4 /* Resources */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -990,6 +1007,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4EE671BE1A2DAEE50037865B /* Profile_of_a_Woman.png in Resources */,
4EE671C01A2DB3240037865B /* ProfileSarah.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1020,6 +1039,8 @@
72414AFA196AAD5C00A2C5F4 /* BMELanguagesLocalizationTable.strings in Resources */,
729656A818CC9D5F00E1A9EE /* BMESettingsLocalizationTable.strings in Resources */,
725B0EFD19598B3C00BB4AE0 /* call-repeat.aiff in Resources */,
4EE671C21A2DB4260037865B /* ProfileSarah.png in Resources */,
4EE671C11A2DB4260037865B /* Profile_of_a_Woman.png in Resources */,
72DA826E18D4699F001F3312 /* BMEBlindMainLocalizationTable.strings in Resources */,
7236E01118B8A87B00F622AA /* Main.storyboard in Resources */,
4E6544721A00279000B71C1C /* PostCallLocalizationTable.strings in Resources */,
Expand Down Expand Up @@ -1131,10 +1152,11 @@
buildActionMask = 2147483647;
files = (
4E7BA9B61A1CE2DC00F9744A /* MaskedLabel_Tests.swift in Sources */,
4E7BA9BA1A1CF4B800F9744A /* MaskedLabel.swift in Sources */,
4E7BA9B81A1CE64300F9744A /* GVUserDefaults+Settings.m in Sources */,
4EFA28081A2B7A4F0050450C /* MaskedLabel.swift in Sources */,
4E7BA9BE1A1CF5DA00F9744A /* DataHelper.swift in Sources */,
4E7BA9AC1A1BDC1400F9744A /* ClientTest.swift in Sources */,
4EE671C41A2DF9C10037865B /* BlindMainViewController_Tests.swift in Sources */,
4E7BA9C31A1DEE4500F9744A /* HelperMainViewController_Tests.swift in Sources */,
4E7BA9BC1A1CF50C00F9744A /* SnapshotHelper.swift in Sources */,
);
Expand Down Expand Up @@ -1746,7 +1768,7 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
COPY_PHASE_STRIP = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
Expand Down
2 changes: 1 addition & 1 deletion BeMyEyes/BeMyEyes-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>39</string>
<string>40</string>
<key>FacebookAppID</key>
<string>771890076161460</string>
<key>FacebookDisplayName</key>
Expand Down
1 change: 1 addition & 0 deletions BeMyEyes/Source/Controllers/BMEHelperMainViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
@interface BMEHelperMainViewController : BMEBaseViewController <MKLocalizable>

@property (strong, nonatomic) BMEUser *user;
@property (strong, nonatomic) BMECommunityStats *stats;

@end
30 changes: 24 additions & 6 deletions BeMyEyes/Source/Controllers/BMEHelperMainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ - (void)updateToProfile {
[self.profileImageView sd_setImageWithURL:url];
} else {
[self.profileImageView sd_cancelCurrentImageLoad];
self.profileImageView.image = [UIImage imageNamed:@"ProfileFilledInSquare"];
if (user.profileImage) {
self.profileImageView.image = user.profileImage;
} else {
self.profileImageView.image = [UIImage imageNamed:@"ProfileFilledInSquare"];
}
}

[self updatePointsAnimated:NO];
Expand Down Expand Up @@ -291,8 +295,8 @@ - (void)updatePointsAnimated:(BOOL)animated {
BMEUser *user = self.user;
self.levelLabel.text = MKLocalizedFromTable(user.currentLevel.localizableKeyForTitle, BMEHelperMainLocalizationTable);

[self.pointsHelpedPersonsLabel setPoint:user.peopleHelped.integerValue animated:YES];
[self.pointsTotalLabel setPoint:user.totalPoints.integerValue animated:YES];
[self.pointsHelpedPersonsLabel setPoint:user.peopleHelped.integerValue animated:animated];
[self.pointsTotalLabel setPoint:user.totalPoints.integerValue animated:animated];

self.pointsBarView.text = [NSString stringWithFormat:MKLocalizedFromTable(BME_HELPER_MAIN_LEVEL_POINTS_NEXT_DESCRIPTION, BMEHelperMainLocalizationTable), user.pointsToNextLevel];
self.pointsBarView.progress = user.levelProgress;
Expand All @@ -301,6 +305,12 @@ - (void)updatePointsAnimated:(BOOL)animated {
[self.tableView reloadData];
}

- (void)updateStatsPointsAnimated:(BOOL)animated {
[self.pointsCommunityBlindLabel setPoint:self.stats.blind.integerValue animated:animated];
[self.pointsCommunitySightedLabel setPoint:self.stats.sighted.integerValue animated:animated];
[self.pointsCommunityHelpedLabel setPoint:self.stats.helped.integerValue animated:animated];
}

- (void)reloadPoints {
[[BMEClient sharedClient] loadUserStatsCompletion:^(BMEUser *user, NSError *error) {
if (error) {
Expand All @@ -315,9 +325,8 @@ - (void)reloadPoints {
if (error) {
NSLog(@"Could not load point for days: %@", error);
} else {
[self.pointsCommunityBlindLabel setPoint:stats.blind.integerValue animated:YES];
[self.pointsCommunitySightedLabel setPoint:stats.sighted.integerValue animated:YES];
[self.pointsCommunityHelpedLabel setPoint:stats.helped.integerValue animated:YES];
_stats = stats;
[self updateStatsPointsAnimated:YES];
}
}];
}
Expand Down Expand Up @@ -391,4 +400,13 @@ - (void)setUser:(BMEUser *)user
}
}

- (void)setStats:(BMECommunityStats *)stats
{
if (stats != _stats) {
_stats = stats;

[self updateStatsPointsAnimated:NO];
}
}

@end
2 changes: 2 additions & 0 deletions BeMyEyes/Source/Models/BMEUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class BMEUserLevel;
#import "BMEUserTask.h"
Expand Down Expand Up @@ -39,6 +40,7 @@ typedef NS_ENUM(NSInteger, BMEUserType) {
@property (readonly, nonatomic) NSArray *lastPointEntries;
@property (readonly, nonatomic) NSArray *completedTasks;
@property (readonly, nonatomic) NSArray *remainingTasks;
@property (readonly, nonatomic) UIImage *profileImage;

- (BOOL)isHelper;
- (BOOL)isBlind;
Expand Down

0 comments on commit 6966541

Please sign in to comment.