Skip to content

Commit

Permalink
project
Browse files Browse the repository at this point in the history
  • Loading branch information
Onetaway committed Sep 17, 2014
1 parent afdce22 commit cb0f67a
Show file tree
Hide file tree
Showing 162 changed files with 8,568 additions and 1,716 deletions.
875 changes: 875 additions & 0 deletions BrowseOverflow.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>07497CA6-4DBB-449E-815C-CB5DD836DB60</string>
<key>IDESourceControlProjectName</key>
<string>BrowseOverflow</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>61D4D9A926E395FC3194AD1BDD818A1CD74DDBC2</key>
<string>ssh://github.com/iamleeg/BrowseOverflow.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>BrowseOverflow.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>61D4D9A926E395FC3194AD1BDD818A1CD74DDBC2</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://github.com/iamleeg/BrowseOverflow.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>61D4D9A926E395FC3194AD1BDD818A1CD74DDBC2</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>61D4D9A926E395FC3194AD1BDD818A1CD74DDBC2</string>
<key>IDESourceControlWCCName</key>
<string>BrowseOverflow</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
<true/>
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -14,24 +14,10 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F912FCED19B955200064867F"
BuildableName = "iOS TDD Study.app"
BlueprintName = "iOS TDD Study"
ReferencedContainer = "container:iOS TDD Study.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F912FD0319B955200064867F"
BuildableName = "iOS TDD StudyTests.xctest"
BlueprintName = "iOS TDD StudyTests"
ReferencedContainer = "container:iOS TDD Study.xcodeproj">
BlueprintIdentifier = "98A548CA130D3ABC003C4F0F"
BuildableName = "BrowseOverflow.app"
BlueprintName = "BrowseOverflow"
ReferencedContainer = "container:BrowseOverflow.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -46,20 +32,20 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F912FD0319B955200064867F"
BuildableName = "iOS TDD StudyTests.xctest"
BlueprintName = "iOS TDD StudyTests"
ReferencedContainer = "container:iOS TDD Study.xcodeproj">
BlueprintIdentifier = "98A548EE130D3ABF003C4F0F"
BuildableName = "BrowseOverflowTests.xctest"
BlueprintName = "BrowseOverflowTests"
ReferencedContainer = "container:BrowseOverflow.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F912FCED19B955200064867F"
BuildableName = "iOS TDD Study.app"
BlueprintName = "iOS TDD Study"
ReferencedContainer = "container:iOS TDD Study.xcodeproj">
BlueprintIdentifier = "98A548CA130D3ABC003C4F0F"
BuildableName = "BrowseOverflow.app"
BlueprintName = "BrowseOverflow"
ReferencedContainer = "container:BrowseOverflow.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
Expand All @@ -75,10 +61,10 @@
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F912FCED19B955200064867F"
BuildableName = "iOS TDD Study.app"
BlueprintName = "iOS TDD Study"
ReferencedContainer = "container:iOS TDD Study.xcodeproj">
BlueprintIdentifier = "98A548CA130D3ABC003C4F0F"
BuildableName = "BrowseOverflow.app"
BlueprintName = "BrowseOverflow"
ReferencedContainer = "container:BrowseOverflow.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
Expand All @@ -93,10 +79,10 @@
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F912FCED19B955200064867F"
BuildableName = "iOS TDD Study.app"
BlueprintName = "iOS TDD Study"
ReferencedContainer = "container:iOS TDD Study.xcodeproj">
BlueprintIdentifier = "98A548CA130D3ABC003C4F0F"
BuildableName = "BrowseOverflow.app"
BlueprintName = "BrowseOverflow"
ReferencedContainer = "container:BrowseOverflow.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>iOS TDD Study.xcscheme</key>
<key>BrowseOverflow.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>F912FCED19B955200064867F</key>
<key>98A548CA130D3ABC003C4F0F</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>F912FD0319B955200064867F</key>
<key>98A548EE130D3ABF003C4F0F</key>
<dict>
<key>primary</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>98A548CA130D3ABC003C4F0F</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>98A548EE130D3ABF003C4F0F</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
23 changes: 23 additions & 0 deletions BrowseOverflow/Answer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// Answer.h
// BrowseOverflow
//
// Created by Graham J Lee on 25/02/2011.
// Copyright 2011 Fuzzy Aliens Ltd. All rights reserved.
//

#import <Foundation/Foundation.h>
@class Person;

@interface Answer : NSObject {

}

@property (copy) NSString *text;
@property (retain) Person *person;
@property (getter=isAccepted) BOOL accepted;
@property NSInteger score;

- (NSComparisonResult)compare: (Answer *)otherAnswer;

@end
35 changes: 35 additions & 0 deletions BrowseOverflow/Answer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// Answer.m
// BrowseOverflow
//
// Created by Graham J Lee on 25/02/2011.
// Copyright 2011 Fuzzy Aliens Ltd. All rights reserved.
//

#import "Answer.h"
#import "Person.h"

@implementation Answer

@synthesize text;
@synthesize person;
@synthesize accepted;
@synthesize score;

- (NSComparisonResult)compare:(Answer *)otherAnswer {
if (accepted && !(otherAnswer.accepted)) {
return NSOrderedAscending;
} else if (!accepted && otherAnswer.accepted){
return NSOrderedDescending;
}
if (score > otherAnswer.score) {
return NSOrderedAscending;
} else if (score < otherAnswer.score) {
return NSOrderedDescending;
} else {
return NSOrderedSame;
}
}


@end
39 changes: 39 additions & 0 deletions BrowseOverflow/AnswerBuilder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// AnswerBuilder.h
// BrowseOverflow
//
// Created by Graham Lee on 25/04/2011.
// Copyright 2011 Fuzzy Aliens Ltd. All rights reserved.
//

#import <Foundation/Foundation.h>

@class Question;

/**
* Constructing Answer objects from data sent by the Stack Overflow site.
* @see Answer
*/
@interface AnswerBuilder : NSObject {

}

/**
* Populate a question object with the answers
* supplied by the Stack Overflow web service.
* @param question The question to which answers are required.
* @param objectNotation The data containing the answer content.
* @param error A by-reference error return.
* @return YES if answers are successfully parsed, otherwise NO and error is filled to describe the problem.
* @note If the data is valid but there are no answers to add, this is not an error.
*/
- (BOOL)addAnswersToQuestion: (Question *)question fromJSON: (NSString *)objectNotation error: (NSError **)error;

@end

extern NSString *AnswerBuilderErrorDomain;

enum {
AnswerBuilderErrorInvalidJSONError,
AnswerBuilderErrorMissingDataError,
};
55 changes: 55 additions & 0 deletions BrowseOverflow/AnswerBuilder.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// AnswerBuilder.m
// BrowseOverflow
//
// Created by Graham Lee on 25/04/2011.
// Copyright 2011 Fuzzy Aliens Ltd. All rights reserved.
//

#import "AnswerBuilder.h"
#import "Answer.h"
#import "Question.h"
#import "UserBuilder.h"

@implementation AnswerBuilder

- (BOOL)addAnswersToQuestion: (Question *)question fromJSON: (NSString *)objectNotation error: (NSError **)error {
NSParameterAssert(objectNotation != nil);
NSParameterAssert(question != nil);
NSData *unicodeNotation = [objectNotation dataUsingEncoding: NSUTF8StringEncoding];
NSError *localError = nil;
NSDictionary *answerData = [NSJSONSerialization JSONObjectWithData: unicodeNotation options: 0 error: &localError];
if (answerData == nil) {
if (error) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity: 1];
if (localError != nil) {
[userInfo setObject: localError forKey: NSUnderlyingErrorKey];
}
*error = [NSError errorWithDomain: AnswerBuilderErrorDomain code: AnswerBuilderErrorInvalidJSONError userInfo: userInfo];
}
return NO;
}

NSArray *answers = [answerData objectForKey: @"answers"];
if (answers == nil) {
if (error) {
*error = [NSError errorWithDomain: AnswerBuilderErrorDomain code:AnswerBuilderErrorMissingDataError userInfo: nil];
}
return NO;
}

for (NSDictionary *answerData in answers) {
Answer *thisAnswer = [[Answer alloc] init];
thisAnswer.text = [answerData objectForKey: @"body"];
thisAnswer.accepted = [[answerData objectForKey: @"accepted"] boolValue];
thisAnswer.score = [[answerData objectForKey: @"score"] integerValue];
NSDictionary *ownerData = [answerData objectForKey: @"owner"];
thisAnswer.person = [UserBuilder personFromDictionary: ownerData];
[question addAnswer: thisAnswer];
}
return YES;
}

@end

NSString *AnswerBuilderErrorDomain = @"AnswerBuilderErrorDomain";
19 changes: 19 additions & 0 deletions BrowseOverflow/AnswerCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// AnswerCell.h
// BrowseOverflow
//
// Created by Graham Lee on 26/09/2011.
// Copyright (c) 2011 Fuzzy Aliens Ltd. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AnswerCell : UITableViewCell

@property (nonatomic, weak) IBOutlet UILabel *scoreLabel;
@property (nonatomic, weak) IBOutlet UILabel *acceptedIndicator;
@property (nonatomic, weak) IBOutlet UILabel *personName;
@property (nonatomic, weak) IBOutlet UIImageView *personAvatar;
@property (nonatomic, weak) IBOutlet UIWebView *bodyWebView;

@end
Loading

0 comments on commit cb0f67a

Please sign in to comment.