Skip to content

Commit

Permalink
design updates #1
Browse files Browse the repository at this point in the history
  • Loading branch information
emreyanik committed Jun 12, 2016
1 parent 22bc826 commit a668665
Show file tree
Hide file tree
Showing 50 changed files with 1,216 additions and 3,527 deletions.
17 changes: 15 additions & 2 deletions Muhit/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#import "NavBar.h"
#import <Fabric/Fabric.h>
#import <Crashlytics/Crashlytics.h>
#import "FacebookManager.h"

#define ALERT_PUSH_NOTIFICATION 10

@interface AppDelegate (){
NSDictionary *pushNotification;
BOOL isRegisteredPush;
}

@end

@implementation AppDelegate
Expand All @@ -36,7 +36,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[[UITextView appearance] setTintColor:CLR_DARK_BLUE];

// [MT setServiceURL:@"http://muhit.co"];//Production
[MT setServiceURL:@"http://muhit.co"];//Sandbox
[MT setServiceURL:@"http://stage.muhit.co"];//Sandbox

if ([UD objectForKey:UD_ACCESS_TOKEN]) {
[UF isAccessTokenValid];
Expand All @@ -52,6 +52,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[self showPushNotificationPopup];
}

[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];

return YES;
}

Expand All @@ -64,7 +67,17 @@ - (void)applicationDidEnterBackground:(UIApplication *)application {
- (void)applicationWillEnterForeground:(UIApplication *)application {
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

//Facebook
if([url.absoluteString rangeOfString:@"fb"].location != NSNotFound) {
return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
return NO;
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBSDKAppEvents activateApp];
}

- (void)applicationWillTerminate:(UIApplication *)application {
Expand Down
4 changes: 2 additions & 2 deletions Muhit/Classes/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ static const CGFloat cornerRadius = 6;
#define isNotNull(variable) variable == [NSNull null] ? NO : (variable ? YES : NO)
#define nilOrJson(VAL) [VAL isKindOfClass:[NSNull class]] ? nil : VAL

#define CLR_LIGHT_BLUE [HXColor hx_colorWithHexRGBAString:@"44a2e0"]
#define CLR_DARK_BLUE [HXColor hx_colorWithHexRGBAString:@"245573"]
#define CLR_LIGHT_BLUE [HXColor hx_colorWithHexRGBAString:@"44A1E0"]
#define CLR_DARK_BLUE [HXColor hx_colorWithHexRGBAString:@"245672"]
#define CLR_DARK_PUPRPLE [HXColor hx_colorWithHexRGBAString:@"666677"]
#define CLR_WHITE [HXColor hx_colorWithHexRGBAString:@"FFFFFF"]

Expand Down
10 changes: 7 additions & 3 deletions Muhit/Classes/NavBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ - (id)initWithFrame:(CGRect)frame
}];
[self setTintColor:[UIColor whiteColor]];
[self setTintAdjustmentMode:UIViewTintAdjustmentModeAutomatic];
[self setBackIndicatorImage:[UIImage imageNamed:@"back"]];
[self setBackIndicatorTransitionMaskImage:[UIImage imageNamed:@"back"]];

[self setBackIndicatorImage:[UIImage imageNamed:@"navigation-back"]];
[self setBackIndicatorTransitionMaskImage:[UIImage imageNamed:@"navigation-back"]];
[[UINavigationBar appearance] setShadowImage:[UIImage new]];
[[UINavigationBar appearance] setBackgroundImage:[UIImage new]
forBarPosition:UIBarPositionAny
barMetrics:UIBarMetricsDefault];

}
return self;
}
Expand Down
4 changes: 3 additions & 1 deletion Muhit/Classes/UtilityFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ typedef enum{
surname:(NSString*)surname
email:(NSString*)email
password:(NSString*)password
rePassword:(NSString*)rePassword
isFacebookLogin:(BOOL)isFacebookLogin;

+ (BOOL)validateLoginWithEmail:(NSString*)email password:(NSString*)password;
Expand All @@ -98,4 +97,7 @@ typedef enum{

+(void)setUserDefaultsWithDetails:(NSDictionary*)details;

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

@end
59 changes: 41 additions & 18 deletions Muhit/Classes/UtilityFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ +(void)setViewToSupersBottom:(UIView*)view{
UIView *superview = [view superview];

[view setFrame:CGRectMake(0,
superview.frame.origin.y + superview.frame.size.height - view.frame.size.height,
view.frame.size.width,
view.frame.size.height)
superview.frame.origin.y + superview.frame.size.height - view.frame.size.height,
view.frame.size.width,
view.frame.size.height)
];
}

Expand Down Expand Up @@ -449,16 +449,16 @@ +(NSString*)getTimeFromDateTime:(NSString*)d{
}

+(NSString*)getMeanTime:(NSString*)d {

NSDateFormatter *f = [[NSDateFormatter alloc] init];
[f setDateFormat:@"yyyy-MM-dd HH:mm:ss"];

NSDate *date = [f dateFromString:d];

[f setLocale:[NSLocale localeWithLocaleIdentifier:@"tr"]];
[f setDateStyle:NSDateFormatterMediumStyle];
[f setTimeStyle:NSDateFormatterShortStyle];

return [f stringFromDate:date];
}

Expand Down Expand Up @@ -598,7 +598,7 @@ + (void)removeHud{
}

+ (void)removeHudAfterDelay{
[[MT HUD] removeFromSuperview];
[[MT HUD] removeFromSuperview];
}

+ (void)addHudTop{
Expand All @@ -609,18 +609,18 @@ + (void)showAlertWithMessageOnly:(NSString*)message {
[[[UIAlertView alloc] initWithTitle: @""
message: message
delegate: nil
cancelButtonTitle: LocalizedString(@"Tamam")
cancelButtonTitle: LocalizedString(@"ok")
otherButtonTitles: nil] show];
}

+ (void)showAlertWithMessage: (NSString*)message
tag: (int)tag
delegate: (id)delegate {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @""
message: message
delegate: delegate
cancelButtonTitle: LocalizedString(@"Tamam")
cancelButtonTitle: LocalizedString(@"ok")
otherButtonTitles: nil];
[alert setTag: tag];
[alert show];
Expand Down Expand Up @@ -701,7 +701,7 @@ + (NSDictionary*)parseURLParams:(NSString *)query {
}

+ (UIImage *)croppIngimageByImageName:(UIImage *)imageToCrop toRect:(CGRect)rect{

CGImageRef imageRef = CGImageCreateWithImageInRect([imageToCrop CGImage], rect);
UIImage *cropped = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
Expand Down Expand Up @@ -769,7 +769,6 @@ + (BOOL)validateSignUpInputWithName:(NSString*)name
surname:(NSString*)surname
email:(NSString*)email
password:(NSString*)password
rePassword:(NSString*)rePassword
isFacebookLogin:(BOOL)isFacebookLogin{

NSMutableArray *messages = [NSMutableArray array];
Expand All @@ -792,7 +791,7 @@ + (BOOL)validateSignUpInputWithName:(NSString*)name
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
message:[messages componentsJoinedByString:@"\n"]
delegate:nil
cancelButtonTitle:LocalizedString(@"Tamam")
cancelButtonTitle:LocalizedString(@"ok")
otherButtonTitles:nil];
[alert show];
return NO;
Expand All @@ -804,7 +803,7 @@ + (BOOL)validateSignUpInputWithName:(NSString*)name
+ (BOOL)validateLoginWithEmail:(NSString*)email password:(NSString*)password{

NSMutableArray *messages = [NSMutableArray array];

if (password && [password length] < 4) {
[messages addObject:LocalizedString(@"Şifreniz en az 4 haneli olmalıdır")];
}
Expand All @@ -819,7 +818,7 @@ + (BOOL)validateLoginWithEmail:(NSString*)email password:(NSString*)password{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
message:[messages componentsJoinedByString:@"\n"]
delegate:nil
cancelButtonTitle:LocalizedString(@"Tamam")
cancelButtonTitle:LocalizedString(@"ok")
otherButtonTitles:nil];
[alert show];
return NO;
Expand All @@ -844,7 +843,7 @@ + (NSDictionary *)parsePlaces:(GMSAutocompletePrediction *)address{

NSArray * arrTexts = [address.attributedFullText.string componentsSeparatedByString:@", "];
NSUInteger index = [address.types indexOfObject:@"administrative_area_level_4"];

NSString *detail=@"";
for (NSString *str in arrTexts) {
if (![str isEqualToString:arrTexts[index]]) {
Expand Down Expand Up @@ -875,10 +874,34 @@ +(void)setUserDefaultsWithDetails:(NSDictionary*)details{
[UD setObject:nil forKey:UD_HOOD_ID];
}
else{
[UD setObject:details[USER][@"active_hood"] forKey:UD_HOOD_ID];
[UD setObject:details[USER][@"active_hood"] forKey:UD_HOOD_ID];
}
}

+(NSString*)urlEscapeString:(NSString *)unencodedString
{
CFStringRef originalStringRef = (__bridge_retained CFStringRef)unencodedString;
NSString *s = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,originalStringRef, NULL, NULL,kCFStringEncodingUTF8);
CFRelease(originalStringRef);
return s;
}


+(NSString*)addQueryStringToUrlString:(NSString *)urlString withDictionary:(NSDictionary *)dictionary
{
NSMutableString *urlWithQuerystring = [[NSMutableString alloc] initWithString:urlString];

for (id key in dictionary) {
NSString *keyString = [key description];
NSString *valueString = [[dictionary objectForKey:key] description];

if ([urlWithQuerystring rangeOfString:@"?"].location == NSNotFound) {
[urlWithQuerystring appendFormat:@"?%@=%@", [self urlEscapeString:keyString], [self urlEscapeString:valueString]];
} else {
[urlWithQuerystring appendFormat:@"&%@=%@", [self urlEscapeString:keyString], [self urlEscapeString:valueString]];
}
}
return urlWithQuerystring;
}

@end
5 changes: 5 additions & 0 deletions Muhit/Images.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
"idiom" : "ipad",
"filename" : "app-icon-152x152.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
Expand Down
23 changes: 23 additions & 0 deletions Muhit/Images.xcassets/checkbox-off.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "checkbox-off.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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.
23 changes: 23 additions & 0 deletions Muhit/Images.xcassets/checkbox-on.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "checkbox-on.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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.
23 changes: 23 additions & 0 deletions Muhit/Images.xcassets/logo-medium.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "logo-medium.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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.
23 changes: 23 additions & 0 deletions Muhit/Images.xcassets/navigation-back.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "navigation-back.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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

0 comments on commit a668665

Please sign in to comment.