Skip to content

Commit 6705c12

Browse files
committed
Merge branch 'release/1.0'
2 parents 49cde05 + 167e2fb commit 6705c12

29 files changed

+88
-67
lines changed

β€ŽCriticalMaps.xcodeproj/project.pbxproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/* Begin PBXBuildFile section */
1010
90F46A24D8DB4FCAABF4CF34 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FD3CAC801A84BBA8D151E5D /* libPods.a */; };
11-
940A9AEE1AC861C800F90DC3 /* PLAdditional.m in Sources */ = {isa = PBXBuildFile; fileRef = 940A9AED1AC861C800F90DC3 /* PLAdditional.m */; };
1211
941511091A10004D0010205B /* PLTwitterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 941511081A10004D0010205B /* PLTwitterViewController.m */; };
1312
942B71B61A5770CA00D02CA1 /* PLTwitterTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 942B71B51A5770CA00D02CA1 /* PLTwitterTableViewCell.m */; };
1413
942E2D8219C316BD00BF92D7 /* PLUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 942E2D8119C316BD00BF92D7 /* PLUtils.m */; };
@@ -52,8 +51,6 @@
5251
/* Begin PBXFileReference section */
5352
1FD3CAC801A84BBA8D151E5D /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
5453
42F8D420591A3C7DB831663C /* 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>"; };
55-
940A9AEC1AC861C800F90DC3 /* PLAdditional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLAdditional.h; sourceTree = "<group>"; };
56-
940A9AED1AC861C800F90DC3 /* PLAdditional.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLAdditional.m; sourceTree = "<group>"; };
5754
941511071A10004D0010205B /* PLTwitterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLTwitterViewController.h; sourceTree = "<group>"; };
5855
941511081A10004D0010205B /* PLTwitterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLTwitterViewController.m; sourceTree = "<group>"; };
5956
942B71B41A5770CA00D02CA1 /* PLTwitterTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLTwitterTableViewCell.h; sourceTree = "<group>"; };
@@ -186,8 +183,6 @@
186183
94F0304819C1E4EC00F86611 /* PLConstants.m */,
187184
942E2D8019C316BD00BF92D7 /* PLUtils.h */,
188185
942E2D8119C316BD00BF92D7 /* PLUtils.m */,
189-
940A9AEC1AC861C800F90DC3 /* PLAdditional.h */,
190-
940A9AED1AC861C800F90DC3 /* PLAdditional.m */,
191186
94ECBDA41AD1B7CC00A8D75A /* UIColor+Helper.h */,
192187
94ECBDA51AD1B7CC00A8D75A /* UIColor+Helper.m */,
193188
);
@@ -425,7 +420,6 @@
425420
94A9C1AF19BF43AB0027C5DC /* PLDataModel.m in Sources */,
426421
94ECBDA61AD1B7CC00A8D75A /* UIColor+Helper.m in Sources */,
427422
945441AE1A111A6A00C8024F /* PLLabel.m in Sources */,
428-
940A9AEE1AC861C800F90DC3 /* PLAdditional.m in Sources */,
429423
94F0304919C1E4EC00F86611 /* PLConstants.m in Sources */,
430424
94CF089919BDF227009FFF43 /* PLTabBarController.m in Sources */,
431425
9484E8031A62E63F0007F9F3 /* HOButton.m in Sources */,

β€ŽCriticalMass/CriticalMaps-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.6.0</string>
20+
<string>1.0</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>0.6.0.2</string>
24+
<string>1.0.1</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string></string>
2727
<key>LSRequiresIPhoneOS</key>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

β€ŽCriticalMass/Images.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
{
44
"size" : "29x29",
55
"idiom" : "iphone",
6-
"filename" : "Appicon29@2x.png",
6+
"filename" : "cm_app_58x58.png",
77
"scale" : "2x"
88
},
99
{
1010
"size" : "40x40",
1111
"idiom" : "iphone",
12-
"filename" : "Appicon40@2x.png",
12+
"filename" : "cm_app_80x80.png",
1313
"scale" : "2x"
1414
},
1515
{
1616
"size" : "60x60",
1717
"idiom" : "iphone",
18-
"filename" : "Appicon60@2x.png",
18+
"filename" : "cm_app_120x120.png",
1919
"scale" : "2x"
2020
},
2121
{
2222
"size" : "60x60",
2323
"idiom" : "iphone",
24-
"filename" : "Appicon60@3x.png",
24+
"filename" : "cm_app_180x180.png",
2525
"scale" : "3x"
2626
}
2727
],
Loading
Loading
Loading
Loading

β€ŽCriticalMass/PLAppDelegate.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#import "PLRulesViewController.h"
1313
#import "PLConstants.h"
1414
#import "PLDataModel.h"
15-
#import "PLAdditional.h"
1615
#import "Appirater.h"
1716

1817
@implementation PLAppDelegate
@@ -21,18 +20,19 @@ @implementation PLAppDelegate
2120

2221
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
2322
{
23+
2424
// Set Appirater
2525
[Appirater setAppId:@"918669647"];
2626
[Appirater setDaysUntilPrompt:1];
2727
[Appirater setUsesUntilPrompt:10];
2828
[Appirater setSignificantEventsUntilPrompt:-1];
2929
[Appirater setTimeBeforeReminding:2];
3030

31-
if(kDebug && kDebugShowAppirater) {
31+
#ifdef DEBUG
32+
if(kDebugShowAppirater) {
3233
[Appirater setDebug:YES];
3334
}
34-
35-
[PLAdditional setup];
35+
#endif
3636

3737
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
3838
self.window.backgroundColor = [UIColor whiteColor];
@@ -41,9 +41,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4141
self.window.rootViewController = self.tabBarController;
4242
[self.window makeKeyAndVisible];
4343

44-
if(kDebug){
45-
[(UITabBarController *) self.window.rootViewController setSelectedIndex: 2];
46-
}
44+
#ifdef DEBUG
45+
[(UITabBarController *) self.window.rootViewController setSelectedIndex: kDebugInitialTabIndex];
46+
#endif
4747

4848
[Appirater appLaunched:YES];
4949

β€ŽCriticalMass/PLChatModel.m

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ - (id)init {
3838
}
3939

4040
- (void)collectMessage:(NSString*) text {
41-
4241
NSString *timestamp = [PLUtils getTimestamp];
4342
NSString *messageId = [NSString stringWithFormat:@"%@%@", _data.uid, timestamp];
4443
NSString *messageIdHashed = [messageId md5];
@@ -58,8 +57,7 @@ - (void)collectMessage:(NSString*) text {
5857
}
5958

6059
- (void)addMessages: (NSDictionary*)messages {
61-
62-
// iterate obtained messages
60+
// Iterate obtained messages
6361
for(id key in messages){
6462

6563
NSDictionary *message = [messages objectForKey:key];
@@ -69,7 +67,6 @@ - (void)addMessages: (NSDictionary*)messages {
6967
co.isActive = YES;
7068
co.timestamp = [message objectForKey:@"timestamp"];
7169
}else{
72-
7370
// create chat object
7471
PLChatObject *co = [[PLChatObject alloc] init];
7572
co.identifier = key;
@@ -80,12 +77,11 @@ - (void)addMessages: (NSDictionary*)messages {
8077
co.isActive = YES;
8178

8279
// fill dict
83-
8480
[_messages addObject:co];
8581
}
8682
}
8783

88-
// iterate existing messages and clear old
84+
// Iterate existing messages and clear old
8985
for (int i = 0; i < [_messages count]; i++) {
9086
PLChatObject *co = [_messages objectAtIndex:i];
9187
if(co.isActive){
@@ -95,7 +91,7 @@ - (void)addMessages: (NSDictionary*)messages {
9591
}
9692
}
9793

98-
// sort
94+
// Sort
9995
[_messages sortUsingDescriptors:
10096
[NSArray arrayWithObjects:
10197
[NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:YES], nil]];

β€ŽCriticalMass/PLChatViewController.m

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ - (void)viewDidLoad {
6767
self.btnSend = [HOButton buttonWithType:UIButtonTypeRoundedRect];
6868
self.btnSend.frame = CGRectMake(260, 0, 50, 50);
6969
self.btnSend.layer.borderWidth = 1.0;
70+
[self.btnSend setBackgroundColor:[UIColor clearColor]];
71+
[self.btnSend setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
7072
[self.btnSend addTarget:self action:@selector(onSend) forControlEvents:UIControlEventTouchUpInside];
7173
[self.btnSend setTitle:@"send" forState:UIControlStateNormal];
7274
[self.controlView addSubview: self.btnSend];
@@ -92,7 +94,6 @@ -(void)viewDidAppear:(BOOL)animated{
9294

9395
- (void)didReceiveMemoryWarning {
9496
[super didReceiveMemoryWarning];
95-
// Dispose of any resources that can be recreated.
9697
}
9798

9899
- (void)onSend {
@@ -105,7 +106,7 @@ - (void)onSend {
105106
self.textField.text = @"";
106107
}
107108

108-
- (void)moveContent:(BOOL)moveUp{
109+
- (void)moveContent:(BOOL)moveUp {
109110
[UIView beginAnimations:nil context:NULL];
110111
[UIView setAnimationDuration:0.3]; // if you want to slide up the view
111112

@@ -147,7 +148,6 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
147148
messageLabel.textColor = [UIColor blackColor];
148149
messageLabel.numberOfLines = 0;
149150
messageLabel.textAlignment = NSTextAlignmentCenter;
150-
// messageLabel.font = [UIFont fontWithName:@"Palatino-Italic" size:20];
151151
[messageLabel sizeToFit];
152152

153153
self.tableView.backgroundView = messageLabel;
@@ -168,7 +168,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
168168

169169
PLChatObject *message = [_chatModel.messages objectAtIndex:indexPath.row];
170170

171+
cell.textLabel.font = [self fontForCell];
171172
cell.textLabel.text = message.text;
173+
cell.textLabel.numberOfLines = 0;
174+
cell.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
172175
cell.imageView.image = [UIImage imageNamed:@"Punk"];
173176
cell.imageView.image = [cell.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
174177
cell.imageView.tintColor = [UIColor magicColor];
@@ -196,12 +199,24 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
196199
return cell;
197200
}
198201

199-
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
202+
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
203+
{
204+
PLChatObject *message = [_chatModel.messages objectAtIndex:indexPath.row];
205+
NSString *cellText = message.text;
206+
NSDictionary *attributes = @{NSFontAttributeName: [self fontForCell]};
207+
CGRect rect = [cellText boundingRectWithSize:CGSizeMake(self.view.frame.size.width, CGFLOAT_MAX)
208+
options:NSStringDrawingUsesLineFragmentOrigin
209+
attributes:attributes
210+
context:nil];
211+
return rect.size.height + 20;
212+
}
213+
214+
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
200215
[self moveContent:YES];
201216
return YES;
202217
}
203218

204-
-(void)textFieldDidEndEditing:(UITextField *)textField {
219+
- (void)textFieldDidEndEditing:(UITextField *)textField {
205220
[self moveContent:NO];
206221
}
207222

@@ -215,9 +230,12 @@ - (void)onMessagesReceived {
215230
// [self.tableView scrollToRowAtIndexPath: ipath atScrollPosition: UITableViewScrollPositionTop animated: YES];
216231
}
217232

218-
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
219-
{
233+
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
220234
[self.textField resignFirstResponder];
221235
}
222236

237+
- (UIFont*)fontForCell {
238+
return [UIFont systemFontOfSize:18.0];
239+
}
240+
223241
@end

β€ŽCriticalMass/PLConstants.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
@interface PLConstants : NSObject
1212

1313
// Debug
14-
FOUNDATION_EXPORT BOOL const kDebug;
1514
FOUNDATION_EXPORT BOOL const kDebugEnableTestURL;
1615
FOUNDATION_EXPORT BOOL const kDebugEnableTestLocation;
1716
FOUNDATION_EXPORT BOOL const kDebugDisableHTTPRequests;
1817
FOUNDATION_EXPORT BOOL const kDebugInitialTabIndex;
1918
FOUNDATION_EXPORT BOOL const kDebugShowAppirater;
2019

2120
// Urls
22-
//FOUNDATION_EXPORT NSString *const kUrlTile;
2321
FOUNDATION_EXPORT NSString *const kUrlService;
2422

2523
// Notifications

β€ŽCriticalMass/PLConstants.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ @implementation PLConstants
1313
@end
1414

1515
// Debug
16-
BOOL const kDebug = NO;
1716
BOOL const kDebugEnableTestURL = NO;
1817
BOOL const kDebugEnableTestLocation = NO;
1918
BOOL const kDebugDisableHTTPRequests = NO;

β€ŽCriticalMass/PLDataModel.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,18 @@ - (void)initLocationManager
5959
_locationManager.delegate = self;
6060
_locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
6161

62-
if(kDebug && kDebugEnableTestLocation){
62+
#ifdef DEBUG
63+
if(kDebugEnableTestLocation){
6364
CLLocation *testLocation = [[CLLocation alloc] initWithLatitude:kTestLocationLatitude longitude:kTestLocationLongitude];
6465
_currentLocation = testLocation;
6566
[self performSelector:@selector(startRequestInterval) withObject:nil afterDelay:1.0];
6667
}else{
6768
[self enableGps];
6869
}
70+
#else
71+
[self enableGps];
72+
#endif
73+
6974
}
7075

7176
- (void)initHTTPRequestManager
@@ -190,9 +195,15 @@ - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLoca
190195
if(_updateCount == 0){
191196
[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationInitialGpsDataReceived object:self];
192197

193-
if(!(kDebug && kDebugDisableHTTPRequests)){
198+
#ifdef DEBUG
199+
if(!kDebugDisableHTTPRequests){
194200
[self performSelector:@selector(startRequestInterval) withObject:nil afterDelay:1.0];
195201
}
202+
203+
#else
204+
[self performSelector:@selector(startRequestInterval) withObject:nil afterDelay:1.0];
205+
#endif
206+
196207
}
197208

198209
_updateCount++;

β€ŽCriticalMass/PLMapViewController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ - (void)initMap
6767
_map.mapType = MKMapTypeStandard;
6868
_map.showsPointsOfInterest = NO;
6969

70-
if(kDebug && kDebugEnableTestLocation){
70+
#ifdef DEBUG
71+
if(kDebugEnableTestLocation){
7172
_map.centerCoordinate = CLLocationCoordinate2DMake(kTestLocationLatitude, kTestLocationLongitude);
7273
}
74+
#endif
7375

7476
[self.view addSubview:_map];
7577
}

β€ŽCriticalMass/PLTabBarController.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ - (void)viewDidLoad
2020

2121
self.view.tintColor = [UIColor magicColor];
2222

23+
[[UITabBar appearance] setBarTintColor:[UIColor whiteColor]];
24+
[[UITabBar appearance] setTranslucent:NO];
25+
2326
UIViewController *viewController1 = [[PLMapViewController alloc] init];
2427
UIViewController *viewController2 = [[PLRulesViewController alloc] init];
2528
UIViewController *viewController3 = [[PLChatViewController alloc] init];
@@ -40,15 +43,15 @@ - (void)viewDidLoad
4043
[tabViewControllers addObject:viewController5];
4144

4245
viewController1.tabBarItem =
43-
[[UITabBarItem alloc] initWithTitle:@"Map" image:[UIImage imageNamed:@"Map"] tag:1];
46+
[[UITabBarItem alloc] initWithTitle:@"Map" image:[UIImage imageNamed:@"Map"] tag:0];
4447
viewController2.tabBarItem =
45-
[[UITabBarItem alloc] initWithTitle:@"Knigge" image:[UIImage imageNamed:@"List"] tag:2];
48+
[[UITabBarItem alloc] initWithTitle:@"Knigge" image:[UIImage imageNamed:@"List"] tag:1];
4649
viewController3.tabBarItem =
47-
[[UITabBarItem alloc] initWithTitle:@"Chat" image:[UIImage imageNamed:@"Bubble"] tag:3];
50+
[[UITabBarItem alloc] initWithTitle:@"Chat" image:[UIImage imageNamed:@"Bubble"] tag:2];
4851
viewController4.tabBarItem =
49-
[[UITabBarItem alloc] initWithTitle:@"Twitter" image:[UIImage imageNamed:@"Twitter"] tag:4];
52+
[[UITabBarItem alloc] initWithTitle:@"Twitter" image:[UIImage imageNamed:@"Twitter"] tag:3];
5053
viewController5.tabBarItem =
51-
[[UITabBarItem alloc] initWithTitle:@"Settings" image:[UIImage imageNamed:@"Settings"] tag:5];
54+
[[UITabBarItem alloc] initWithTitle:@"Settings" image:[UIImage imageNamed:@"Settings"] tag:4];
5255

5356
[self setViewControllers:tabViewControllers animated:NO];
5457
}

β€ŽCriticalMass/PLTwitterViewController.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ - (void)viewDidLoad {
3434

3535
_supportedLocalities = @[
3636
@"berlin",
37+
@"leipzig",
3738
@"wien",
3839
@"cambridge",
3940
@"hamburg",
4041
@"dresden",
4142
@"kΓΆln",
42-
@"potsdam"
43+
@"potsdam",
44+
@"stuttgart",
45+
@"mΓΌnchen",
46+
@"frankfurt"
4347
];
4448

4549
_data = [PLDataModel sharedManager];

β€ŽCriticalMass/UIColor+Helper.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@implementation UIColor (Helper)
1414

1515
+ (UIColor *)magicColor {
16-
return UIColorFromRGB(0x028a68);
16+
return UIColorFromRGB(0x51c9ec);
1717
}
1818

1919
@end

β€ŽGfx/Launch1.png

-72.1 KB
Binary file not shown.

β€ŽGfx/Launch2.png

-72.6 KB
Binary file not shown.

β€ŽGfx/appicon/Appicon29@2x.png

-4.15 KB
Binary file not shown.

β€ŽGfx/appicon/Appicon40@2x.png

-6.09 KB
Binary file not shown.

β€ŽGfx/appicon/Appicon60@2x.png

-10.1 KB
Binary file not shown.

β€ŽGfx/appicon/Appicon60@3x.png

-17.1 KB
Binary file not shown.

β€ŽPodfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pod 'NSString-Hashes'
99
pod 'AccordionView'
1010
pod 'TTTAttributedLabel'
1111
pod 'STTwitter'
12-
pod 'GoogleAnalytics-iOS-SDK', '3.0.3c'
1312
pod 'SAMLoadingView'
1413
pod 'SDWebImage'
1514
pod 'Appirater'

0 commit comments

Comments
Β (0)