diff --git a/5by5Browser.xcodeproj/project.pbxproj b/5by5Browser.xcodeproj/project.pbxproj index c41458a..3d0b1d4 100644 --- a/5by5Browser.xcodeproj/project.pbxproj +++ b/5by5Browser.xcodeproj/project.pbxproj @@ -35,7 +35,6 @@ 7B81723E14B167BF003EC770 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 7B81723014B167BF003EC770 /* icon.png */; }; 7B81723F14B167BF003EC770 /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7B81723114B167BF003EC770 /* icon@2x.png */; }; 7B81724014B167BF003EC770 /* talkshow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B81723214B167BF003EC770 /* talkshow.jpg */; }; - 7B81724114B167BF003EC770 /* webahead.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B81723314B167BF003EC770 /* webahead.jpg */; }; 7B81725E14B1688D003EC770 /* MMHTTPClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B81724314B1688D003EC770 /* MMHTTPClient.h */; }; 7B81725F14B1688D003EC770 /* MMHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B81724414B1688D003EC770 /* MMHTTPClient.m */; }; 7B81726014B1688D003EC770 /* MMHTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B81724514B1688D003EC770 /* MMHTTPRequest.h */; }; @@ -65,6 +64,12 @@ 7B86894B149D5C1000F3A2C6 /* ShowViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B868949149D5C0F00F3A2C6 /* ShowViewController.m */; }; 7B868951149D5C6F00F3A2C6 /* ShowViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B86894D149D5C6F00F3A2C6 /* ShowViewController_iPad.xib */; }; 7B868952149D5C6F00F3A2C6 /* ShowViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B86894F149D5C6F00F3A2C6 /* ShowViewController_iPhone.xib */; }; + 7B9FFD66151E39210048A9C8 /* afterdark.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B9FFD62151E39210048A9C8 /* afterdark.jpg */; }; + 7B9FFD67151E39210048A9C8 /* bb.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B9FFD63151E39210048A9C8 /* bb.jpg */; }; + 7B9FFD68151E39210048A9C8 /* movies.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B9FFD64151E39210048A9C8 /* movies.jpg */; }; + 7B9FFD69151E39210048A9C8 /* specials.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B9FFD65151E39210048A9C8 /* specials.jpg */; }; + 7B9FFD76151E3D2F0048A9C8 /* NSDate+relative.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B9FFD74151E3D2F0048A9C8 /* NSDate+relative.h */; }; + 7B9FFD77151E3D2F0048A9C8 /* NSDate+relative.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B9FFD75151E3D2F0048A9C8 /* NSDate+relative.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -104,7 +109,6 @@ 7B81723014B167BF003EC770 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon.png; path = Images/icon.png; sourceTree = ""; }; 7B81723114B167BF003EC770 /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon@2x.png"; path = "Images/icon@2x.png"; sourceTree = ""; }; 7B81723214B167BF003EC770 /* talkshow.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = talkshow.jpg; path = Images/talkshow.jpg; sourceTree = ""; }; - 7B81723314B167BF003EC770 /* webahead.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = webahead.jpg; path = Images/webahead.jpg; sourceTree = ""; }; 7B81724314B1688D003EC770 /* MMHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHTTPClient.h; sourceTree = ""; }; 7B81724414B1688D003EC770 /* MMHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHTTPClient.m; sourceTree = ""; }; 7B81724514B1688D003EC770 /* MMHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHTTPRequest.h; sourceTree = ""; }; @@ -136,6 +140,12 @@ 7B868949149D5C0F00F3A2C6 /* ShowViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShowViewController.m; sourceTree = ""; }; 7B86894E149D5C6F00F3A2C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ShowViewController_iPad.xib; sourceTree = ""; }; 7B868950149D5C6F00F3A2C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ShowViewController_iPhone.xib; sourceTree = ""; }; + 7B9FFD62151E39210048A9C8 /* afterdark.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = afterdark.jpg; path = Images/afterdark.jpg; sourceTree = ""; }; + 7B9FFD63151E39210048A9C8 /* bb.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = bb.jpg; path = Images/bb.jpg; sourceTree = ""; }; + 7B9FFD64151E39210048A9C8 /* movies.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = movies.jpg; path = Images/movies.jpg; sourceTree = ""; }; + 7B9FFD65151E39210048A9C8 /* specials.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = specials.jpg; path = Images/specials.jpg; sourceTree = ""; }; + 7B9FFD74151E3D2F0048A9C8 /* NSDate+relative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+relative.h"; sourceTree = ""; }; + 7B9FFD75151E3D2F0048A9C8 /* NSDate+relative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+relative.m"; sourceTree = ""; }; 7BDCFA00149E688600DDF1B3 /* InstapaperCredentials.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InstapaperCredentials.h; sourceTree = ""; }; /* End PBXFileReference section */ @@ -158,6 +168,8 @@ 7B1A6EBF149D140600FC5105 = { isa = PBXGroup; children = ( + 7B9FFD74151E3D2F0048A9C8 /* NSDate+relative.h */, + 7B9FFD75151E3D2F0048A9C8 /* NSDate+relative.m */, 7B81724214B1688D003EC770 /* Marshmallows */, 7B81724D14B1688D003EC770 /* MWFeedParser */, 7B1A6ED4149D140600FC5105 /* 5by5Browser */, @@ -218,6 +230,10 @@ 7B1A6ED5149D140600FC5105 /* Supporting Files */ = { isa = PBXGroup; children = ( + 7B9FFD62151E39210048A9C8 /* afterdark.jpg */, + 7B9FFD63151E39210048A9C8 /* bb.jpg */, + 7B9FFD64151E39210048A9C8 /* movies.jpg */, + 7B9FFD65151E39210048A9C8 /* specials.jpg */, 7B81722714B167BF003EC770 /* b2w.jpg */, 7B81722814B167BF003EC770 /* back.png */, 7B81722914B167BF003EC770 /* back@2x.png */, @@ -230,7 +246,6 @@ 7B81723014B167BF003EC770 /* icon.png */, 7B81723114B167BF003EC770 /* icon@2x.png */, 7B81723214B167BF003EC770 /* talkshow.jpg */, - 7B81723314B167BF003EC770 /* webahead.jpg */, 7B1A6ED6149D140600FC5105 /* 5by5Browser-Info.plist */, 7B1A6ED7149D140600FC5105 /* InfoPlist.strings */, 7B1A6EDA149D140600FC5105 /* main.m */, @@ -306,6 +321,7 @@ 7B81727214B1688D003EC770 /* MWFeedItem.h in Headers */, 7B81727414B1688D003EC770 /* MWFeedParser.h in Headers */, 7B81727614B1688D003EC770 /* MWFeedParser_Private.h in Headers */, + 7B9FFD76151E3D2F0048A9C8 /* NSDate+relative.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -381,7 +397,10 @@ 7B81723E14B167BF003EC770 /* icon.png in Resources */, 7B81723F14B167BF003EC770 /* icon@2x.png in Resources */, 7B81724014B167BF003EC770 /* talkshow.jpg in Resources */, - 7B81724114B167BF003EC770 /* webahead.jpg in Resources */, + 7B9FFD66151E39210048A9C8 /* afterdark.jpg in Resources */, + 7B9FFD67151E39210048A9C8 /* bb.jpg in Resources */, + 7B9FFD68151E39210048A9C8 /* movies.jpg in Resources */, + 7B9FFD69151E39210048A9C8 /* specials.jpg in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -412,6 +431,7 @@ 7B81727114B1688D003EC770 /* MWFeedInfo.m in Sources */, 7B81727314B1688D003EC770 /* MWFeedItem.m in Sources */, 7B81727514B1688D003EC770 /* MWFeedParser.m in Sources */, + 7B9FFD77151E3D2F0048A9C8 /* NSDate+relative.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/5by5Browser.xcodeproj/project.xcworkspace/xcuserdata/sjs.xcuserdatad/UserInterfaceState.xcuserstate b/5by5Browser.xcodeproj/project.xcworkspace/xcuserdata/sjs.xcuserdatad/UserInterfaceState.xcuserstate index 5f15cab..d6bc15e 100644 Binary files a/5by5Browser.xcodeproj/project.xcworkspace/xcuserdata/sjs.xcuserdatad/UserInterfaceState.xcuserstate and b/5by5Browser.xcodeproj/project.xcworkspace/xcuserdata/sjs.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/5by5Browser/Images/b2w.jpg b/5by5Browser/Images/b2w.jpg index 8ab66ef..7af8460 100644 Binary files a/5by5Browser/Images/b2w.jpg and b/5by5Browser/Images/b2w.jpg differ diff --git a/5by5Browser/Images/b2w@2x.jpg b/5by5Browser/Images/b2w@2x.jpg new file mode 100644 index 0000000..542b39e Binary files /dev/null and b/5by5Browser/Images/b2w@2x.jpg differ diff --git a/5by5Browser/Images/buildanalyze.jpg b/5by5Browser/Images/buildanalyze.jpg index 4eeee80..466c600 100644 Binary files a/5by5Browser/Images/buildanalyze.jpg and b/5by5Browser/Images/buildanalyze.jpg differ diff --git a/5by5Browser/Images/buildanalyze@2x.jpg b/5by5Browser/Images/buildanalyze@2x.jpg new file mode 100644 index 0000000..d6830b9 Binary files /dev/null and b/5by5Browser/Images/buildanalyze@2x.jpg differ diff --git a/5by5Browser/Images/criticalpath.jpg b/5by5Browser/Images/criticalpath.jpg index d588200..2264e37 100644 Binary files a/5by5Browser/Images/criticalpath.jpg and b/5by5Browser/Images/criticalpath.jpg differ diff --git a/5by5Browser/Images/criticalpath@2x.jpg b/5by5Browser/Images/criticalpath@2x.jpg new file mode 100644 index 0000000..a2adc54 Binary files /dev/null and b/5by5Browser/Images/criticalpath@2x.jpg differ diff --git a/5by5Browser/Images/geekfriday.jpg b/5by5Browser/Images/geekfriday.jpg index 4e88861..2dfef67 100644 Binary files a/5by5Browser/Images/geekfriday.jpg and b/5by5Browser/Images/geekfriday.jpg differ diff --git a/5by5Browser/Images/geekfriday@2x.jpg b/5by5Browser/Images/geekfriday@2x.jpg new file mode 100644 index 0000000..a2384a8 Binary files /dev/null and b/5by5Browser/Images/geekfriday@2x.jpg differ diff --git a/5by5Browser/Images/hypercritical.jpg b/5by5Browser/Images/hypercritical.jpg index 34526ad..e656d10 100644 Binary files a/5by5Browser/Images/hypercritical.jpg and b/5by5Browser/Images/hypercritical.jpg differ diff --git a/5by5Browser/Images/hypercritical@2x.jpg b/5by5Browser/Images/hypercritical@2x.jpg new file mode 100644 index 0000000..437f63b Binary files /dev/null and b/5by5Browser/Images/hypercritical@2x.jpg differ diff --git a/5by5Browser/Images/talkshow.jpg b/5by5Browser/Images/talkshow.jpg index 150d8c3..3f4ebd4 100644 Binary files a/5by5Browser/Images/talkshow.jpg and b/5by5Browser/Images/talkshow.jpg differ diff --git a/5by5Browser/Images/talkshow@2x.jpg b/5by5Browser/Images/talkshow@2x.jpg new file mode 100644 index 0000000..24459de Binary files /dev/null and b/5by5Browser/Images/talkshow@2x.jpg differ diff --git a/NSDate+relative.h b/NSDate+relative.h new file mode 100644 index 0000000..156ffb8 --- /dev/null +++ b/NSDate+relative.h @@ -0,0 +1,15 @@ +// +// NSDate+relative.h +// DatingX +// +// Created by Sami Samhuri on 11-08-25. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface NSDate (NSDate_relative) + +- (NSString *) relativeToNow; + +@end diff --git a/NSDate+relative.m b/NSDate+relative.m new file mode 100644 index 0000000..87985c6 --- /dev/null +++ b/NSDate+relative.m @@ -0,0 +1,60 @@ +// +// NSDate+relative.m +// DatingX +// +// Created by Sami Samhuri on 11-08-25. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "NSDate+relative.h" + +#define MINUTE 60.0 +#define HOUR (60.0 * MINUTE) +#define DAY (24.0 * HOUR) +#define WEEK (7.0 * DAY) +#define MONTH (30.0 * DAY) + +@implementation NSDate (NSDate_relative) + +- (NSString *) relativeToNow +{ + double diff = [[NSDate date] timeIntervalSinceDate: self]; + if (diff < MINUTE) { + return @"right now"; + } + else if (diff < 2 * MINUTE) { + return @"a minute ago"; + } + else if (diff < HOUR) { + return [NSString stringWithFormat: @"%d minutes ago", (int)(diff / MINUTE)]; + } + else if (diff < 2 * HOUR) { + return @"an hour ago"; + } + else if (diff < DAY) { + return [NSString stringWithFormat: @"%d hours ago", (int)(diff / HOUR)]; + } + else if (diff < 2 * DAY) { + return @"yesterday"; + } + else if (diff < WEEK) { + return [NSString stringWithFormat: @"%d days ago", (int)(diff / DAY)]; + } + else if (diff < 2 * WEEK) { + return @"last week"; + } + else if (diff < 4 * WEEK) { + return [NSString stringWithFormat: @"%d weeks ago", (int)(diff / WEEK)]; + } + else if (diff < 8 * WEEK) { + return @"last month"; + } + else if (diff < 12 * MONTH) { + return [NSString stringWithFormat: @"%d months ago", (int)(diff / MONTH)]; + } + else { + return @"a long time ago"; + } +} + +@end