Skip to content

Commit

Permalink
design updates #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Emre YANIK committed Jun 15, 2016
1 parent 8e5b594 commit 389d3cc
Show file tree
Hide file tree
Showing 22 changed files with 614 additions and 506 deletions.
30 changes: 16 additions & 14 deletions Muhit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@
4B21696C1B21D5C500DEBA01 /* SearchVC.m */,
4B21696D1B21D5C500DEBA01 /* SearchVC.xib */,
);
path = Search;
name = Search;
path = ../Search;
sourceTree = "<group>";
};
4B21695F1B21D55B00DEBA01 /* Issue */ = {
Expand Down Expand Up @@ -453,8 +454,8 @@
4BC5837E1B1C4D4800180B3D /* Supporting Files */ = {
isa = PBXGroup;
children = (
4B9F04F01B1D9415009CB713 /* lang-en.plist */,
4B9F04F11B1D9415009CB713 /* lang-tr.plist */,
4B9F04F01B1D9415009CB713 /* lang-en.plist */,
4B9F04F21B1D9415009CB713 /* Prefix-Header.pch */,
4B9F04EE1B1D8A6C009CB713 /* Podfile */,
4BC5837F1B1C4D4800180B3D /* Info.plist */,
Expand Down Expand Up @@ -483,6 +484,8 @@
4BC9BF191D1044B400707A4D /* Commons */ = {
isa = PBXGroup;
children = (
4B21695E1B21D55400DEBA01 /* Search */,
4BD654DB1B32032900343C16 /* PlacesView */,
4BC9BF1A1D1044CE00707A4D /* IssueCell */,
);
path = Commons;
Expand Down Expand Up @@ -540,7 +543,8 @@
4BD654E21B32043700343C16 /* PlacesCell.m */,
4BD654E31B32043700343C16 /* PlacesCell.xib */,
);
path = PlacesView;
name = PlacesView;
path = ../PlacesView;
sourceTree = "<group>";
};
4BDE9F0F1D0E8F00005431BA /* Assets */ = {
Expand All @@ -565,24 +569,22 @@
4BF7F8FB1B1CF31100A35FD1 /* ViewControllers */ = {
isa = PBXGroup;
children = (
4BC9BF191D1044B400707A4D /* Commons */,
4B70C8EF1B4BE001009BC526 /* PickFromMap */,
4B6FF5A51B3F0CBA00F3ED8A /* TagSelector */,
4BD654DB1B32032900343C16 /* PlacesView */,
4B2169601B21D56300DEBA01 /* AddEditIssue */,
4B21695F1B21D55B00DEBA01 /* Issue */,
4B21695E1B21D55400DEBA01 /* Search */,
4B21694E1B21D46300DEBA01 /* EditProfile */,
4B21694D1B21D45D00DEBA01 /* Profile */,
4B21694C1B21D45600DEBA01 /* Headman */,
4B2169351B218DCD00DEBA01 /* Supporteds */,
4B2169341B218DBF00DEBA01 /* Announcements */,
4BC9EE941B1EF3FB00441353 /* Signup */,
4BC9BF191D1044B400707A4D /* Commons */,
4B21694E1B21D46300DEBA01 /* EditProfile */,
4BC9EE931B1EF3F400441353 /* ForgotPassword */,
4B21694C1B21D45600DEBA01 /* Headman */,
4B21695F1B21D55B00DEBA01 /* Issue */,
4B9F05311B1DDA24009CB713 /* Login */,
4B9F052B1B1DBFAB009CB713 /* Main */,
4B9F052A1B1DBE1F009CB713 /* Menu */,
4B70C8EF1B4BE001009BC526 /* PickFromMap */,
4B21694D1B21D45D00DEBA01 /* Profile */,
4B9F05121B1D96E1009CB713 /* Root */,
4BC9EE941B1EF3FB00441353 /* Signup */,
4B2169351B218DCD00DEBA01 /* Supporteds */,
4B6FF5A51B3F0CBA00F3ED8A /* TagSelector */,
);
path = ViewControllers;
sourceTree = "<group>";
Expand Down
1 change: 1 addition & 0 deletions Muhit/Classes/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static const CGFloat cornerRadius = 6;
#define UD_ACCESS_TOKEN_TAKEN_DATE @"UD_ACCESS_TOKEN_TAKEN_DATE"
#define UD_HOOD_ID @"UD_HOOD_ID"
#define UD_USER_ID @"UD_USER_ID"
#define UD_USERNAME @"UD_USERNAME"
#define UD_USER_PICTURE @"UD_USER_PICTURE"

#define FONT_BLACK @"SourceSansPro-Black"
Expand Down
3 changes: 2 additions & 1 deletion Muhit/Classes/UtilityFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ typedef enum{

+(NSString*)urlEscapeString:(NSString *)unencodedString;
+(NSString*)addQueryStringToUrlString:(NSString *)urlString withDictionary:(NSDictionary *)dictionary;

+(NSString*)getDistrictFromAddress:(NSString *)address;
+(NSString*)getHoodFromAddress:(NSString *)address;
@end
70 changes: 52 additions & 18 deletions Muhit/Classes/UtilityFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -501,20 +501,20 @@ +(NSString*)getDetailedDateString:(NSString*)d{
return @"2 gün önce";
}
else{
NSInteger year = [[[NSCalendar currentCalendar] components:NSCalendarUnitYear fromDate:date] year];
NSInteger currentYear = [[[NSCalendar currentCalendar] components:NSCalendarUnitYear fromDate:now] year];

// NSInteger year = [[[NSCalendar currentCalendar] components:NSCalendarUnitYear fromDate:date] year];
// NSInteger currentYear = [[[NSCalendar currentCalendar] components:NSCalendarUnitYear fromDate:now] year];
//
[f setLocale:[NSLocale localeWithLocaleIdentifier:@"tr"]];
[f setDateStyle:NSDateFormatterMediumStyle];
[f setDateStyle:NSDateFormatterLongStyle];
[f setTimeStyle:NSDateFormatterNoStyle];

if (year == currentYear) {
NSString *str = [f stringFromDate:date];
return [str substringToIndex:[str length] - 5];
}
else{
return [f stringFromDate:date];
}
// if (year == currentYear) {
// NSString *str = [f stringFromDate:date];
// return [str substringToIndex:[str length] - 5];
// }
// else{
return [f stringFromDate:date];
// }
}
}

Expand Down Expand Up @@ -861,20 +861,22 @@ + (NSDictionary *)parsePlaces:(GMSAutocompletePrediction *)address{
}

+(void)setUserDefaultsWithDetails:(NSDictionary*)details{
[UD setObject:[NSDate date] forKey:UD_ACCESS_TOKEN_TAKEN_DATE];
[UD setObject:details[AUTH][@"access_token"] forKey:UD_ACCESS_TOKEN];
[UD setObject:details[AUTH][@"refresh_token"] forKey:UD_REFRESH_TOKEN];
[UD setObject:details[AUTH][@"expires_in"] forKey:UD_ACCESS_TOKEN_LIFETIME];
// [UD setObject:[NSDate date] forKey:UD_ACCESS_TOKEN_TAKEN_DATE];
// [UD setObject:details[AUTH][@"access_token"] forKey:UD_ACCESS_TOKEN];
// [UD setObject:details[AUTH][@"refresh_token"] forKey:UD_REFRESH_TOKEN];
// [UD setObject:details[AUTH][@"expires_in"] forKey:UD_ACCESS_TOKEN_LIFETIME];
[UD setObject:details[USER][@"first_name"] forKey:UD_FIRSTNAME];
[UD setObject:details[USER][@"last_name"] forKey:UD_SURNAME];
[UD setObject:details[USER][@"id"] forKey:UD_USER_ID];
[UD setObject:details[USER][@"picture"] forKey:UD_USER_PICTURE];
[UD setObject:details[USER][@"username"] forKey:UD_USERNAME];

if (details[USER][@"active_hood"] == [NSNull null]) {
[UD setObject:nil forKey:UD_HOOD_ID];
if (isNotNull(details[USER][@"hood_id"])) {
[UD setObject:details[USER][@"hood_id"] forKey:UD_HOOD_ID];
}
else{
[UD setObject:details[USER][@"active_hood"] forKey:UD_HOOD_ID];
[UD setObject:nil forKey:UD_HOOD_ID];

}
}

Expand Down Expand Up @@ -904,4 +906,36 @@ +(NSString*)addQueryStringToUrlString:(NSString *)urlString withDictionary:(NSDi
return urlWithQuerystring;
}

+(NSString*)getDistrictFromAddress:(NSString *)address{
if ([address rangeOfString:@","].location != NSNotFound){
NSScanner *scanner = [NSScanner scannerWithString:address];
[scanner scanUpToString:@"," intoString:nil];
NSString *postMatch;

if(address.length == scanner.scanLocation){
postMatch = [address substringFromIndex:scanner.scanLocation];
}
else{
postMatch = [address substringFromIndex:scanner.scanLocation + @",".length];
}
return postMatch;
}
else{
return address;
}
}

+(NSString*)getHoodFromAddress:(NSString *)address{
if ([address rangeOfString:@","].location != NSNotFound){
NSString *preMatch;

NSScanner *scanner = [NSScanner scannerWithString:address];
[scanner scanUpToString:@"," intoString:&preMatch];
return preMatch;
}
else{
return address;
}
}

@end
16 changes: 8 additions & 8 deletions Muhit/Networking/ServiceHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (void)getRequest:(NSString*)url backgroundCall:(BOOL)backgroundCall repeatCall

DLog(@"url: %@ : %@",[url lastPathComponent], responseObject);
NSDictionary *responseDict = (NSDictionary*)responseObject;
responseHandler(responseDict[@"data"],nil);
responseHandler(responseDict[@"content"],nil);
}
failure: ^(NSURLSessionDataTask *operation, NSError *error){
NSLog(@"errorDesc:%@",error.description);
Expand All @@ -73,10 +73,10 @@ - (void)getRequest:(NSString*)url backgroundCall:(BOOL)backgroundCall repeatCall
if(error && (error.code == -1001 || error.code == -1009 || error.code == -1004)){
if (!backgroundCall && !alertActive) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
message:LocalizedString(@"İnternet bağlantınızı kontrol ediniz")
message:LocalizedString(@"check-connection")
delegate:self
cancelButtonTitle:LocalizedString(@"İptal")
otherButtonTitles:LocalizedString(@"Yeniden Dene"),nil];
cancelButtonTitle:LocalizedString(@"cancel")
otherButtonTitles:LocalizedString(@"try-again"),nil];
alert.tag = ALERT_TRY_GET_TAG;
lastRequestURL = url;
lastRequestBackgroundCall = backgroundCall;
Expand Down Expand Up @@ -115,7 +115,7 @@ - (void)postRequest:(NSString*)url requestDict:(NSDictionary*)requestDict backgr

DLog(@"url: %@ : %@",[url lastPathComponent], responseObject);
NSDictionary *responseDict = (NSDictionary*)responseObject;
responseHandler(responseDict[@"data"],nil);
responseHandler(responseDict[@"content"],nil);
}
failure: ^(NSURLSessionDataTask *operation, NSError *error){

Expand All @@ -126,10 +126,10 @@ - (void)postRequest:(NSString*)url requestDict:(NSDictionary*)requestDict backgr
if(error && (error.code == -1001 || error.code == -1009 || error.code == -1004)){
if (!backgroundCall && !alertActive) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
message:@"İnternet bağlantınızı kontrol ediniz"
message:@"check-connection"
delegate:self
cancelButtonTitle:@"İptal"
otherButtonTitles:@"Yeniden Dene",nil];
cancelButtonTitle:@"cancel"
otherButtonTitles:@"try-again",nil];
alert.tag = ALERT_TRY_POST_TAG;
lastRequestURL = url;
lastRequestDict = requestDict;
Expand Down
66 changes: 37 additions & 29 deletions Muhit/Supporting Files/lang-tr.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Tümü</key>
<string>TÜMÜ</string>
<key>Desteklediklerim</key>
<key>all</key>
<string>Tümü</string>
<key>my-supporteds</key>
<string>Desteklediklerim</string>
<key>Fikirlerim</key>
<key>my-ideas</key>
<string>Fikirlerim</string>
<key>Duyurular</key>
<key>announcements</key>
<string>Duyurular</string>
<key>Muhtarım</key>
<key>my-headman</key>
<string>Muhtarım</string>
<key>Muhtar</key>
<key>headman</key>
<string>Muhtar</string>
<key>signup</key>
<string>Kayıt Ol</string>
Expand All @@ -22,9 +22,9 @@
<string>Facebook ile Bağlan</string>
<key>or</key>
<string>veya</string>
<key>Profilim</key>
<key>my-profile</key>
<string>Profilim</string>
<key>Profil</key>
<key>profile</key>
<string>Profil</string>
<key>logout</key>
<string>Çıkış Yap</string>
Expand Down Expand Up @@ -60,55 +60,63 @@
<string>Yarattığı Fikirler</string>
<key>supported-issues</key>
<string>Desteklediği Fikirler</string>
<key>Profili Düzenle</key>
<key>edit-profile</key>
<string>Profili Düzenle</string>
<key>Güncelle</key>
<key>update</key>
<string>Güncelle</string>
<key>Arama Sonuçları</key>
<string>Arama Sonuçları</string>
<key>Başvuruldu</key>
<key>status-start</key>
<string>Başvuruldu</string>
<key>Gelişmekte</key>
<key>status-developing</key>
<string>Gelişmekte</string>
<key>Çözüldü</key>
<key>status-resolved</key>
<string>Çözüldü</string>
<key>Yorumlar</key>
<key>comments</key>
<string>Yorumlar</string>
<key>Destekçi</key>
<key>supporter</key>
<string>Destekçi</string>
<key>Düzenle</key>
<key>edit</key>
<string>Düzenle</string>
<key>Ekle</key>
<key>add</key>
<string>Ekle</string>
<key>Başlık</key>
<key>title</key>
<string>Başlık</string>
<key>Açıklama</key>
<key>description</key>
<string>Açıklama</string>
<key>Etiketler (max 3)</key>
<string>Etiketler (max 3)</string>
<key>Resimler (max 3)</key>
<string>Resimler (max 3)</string>
<key>Anonim olarak başvuru yap</key>
<string>Anonim olarak başvuru yap</string>
<key>Kaydet</key>
<key>save</key>
<string>Kaydet</string>
<key>Fotoğraf Çek</key>
<key>take-photo</key>
<string>Fotoğraf Çek</string>
<key>İptal</key>
<key>cancel</key>
<string>İptal</string>
<key>İnternet bağlantınızı kontrol ediniz</key>
<key>check-connection</key>
<string>İnternet bağlantınızı kontrol ediniz</string>
<key>ok</key>
<string>Tamam</string>
<key>idea</key>
<string>Fikir</string>
<key>Değiştir</key>
<key>change</key>
<string>Değiştir</string>
<key>fbPermissionMessage</key>
<key>facebook-permission</key>
<string>Facebook ile giriş yapabilmek için ayarlardan BiTaksi uygulamasına izin vermelisiniz.</string>
<key>Yeniden Dene</key>
<key>try-again</key>
<string>Yeniden Dene</string>
<key>choose-hood</key>
<string>Mahalleni seç...</string>
<key>profile-photo</key>
<string>Profil resmi</string>
<key>support</key>
<string>Destekle</string>
<key>unsupport</key>
<string>Destekledim</string>
<key>problem</key>
<string>Sorun</string>
<key>solution</key>
<string>Çözüm</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.xib
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="0.93333333333333335" green="0.93333333333333335" blue="0.93333333333333335" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="a9y-67-xYJ" secondAttribute="trailing" constant="20" id="0PD-ZB-Gh7"/>
<constraint firstItem="zMa-Eq-NcE" firstAttribute="leading" secondItem="LyT-en-oH6" secondAttribute="leading" constant="20" id="21T-f9-yA7"/>
Expand Down
2 changes: 1 addition & 1 deletion Muhit/ViewControllers/Announcements/AnnouncementsVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ - (void)didReceiveMemoryWarning {
}

- (void)setLocalizedStrings{
[self setTitle:LocalizedString(@"Duyurular")];
[self setTitle:LocalizedString(@"announcements")];
}

@end
Loading

0 comments on commit 389d3cc

Please sign in to comment.