From d1c987ae38b8978c5b2a8a6e0176b718adff0759 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 30 Mar 2014 22:30:48 -0700 Subject: [PATCH] add a Readme and update copyright --- Marshmallows.xcodeproj/project.pbxproj | 2 +- Marshmallows/MMHTTPClient.h | 2 +- Marshmallows/MMHTTPClient.m | 2 +- Marshmallows/MMHTTPRequest.h | 2 +- Marshmallows/MMHTTPRequest.m | 2 +- Marshmallows/Marshmallows.h | 2 +- Marshmallows/NSString+marshmallows.h | 2 +- Marshmallows/NSString+marshmallows.m | 2 +- Marshmallows/UIAlertView+marshmallows.h | 2 +- Marshmallows/UIAlertView+marshmallows.m | 2 +- Marshmallows/UIAlertViewDelegate.h | 2 +- Marshmallows/UIAlertViewDelegate.m | 2 +- MarshmallowsTesting/NSDateTest.m | 2 +- MarshmallowsTesting/main.m | 2 +- Readme.md | 61 +++++++++++++++++++++++++ 15 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 Readme.md diff --git a/Marshmallows.xcodeproj/project.pbxproj b/Marshmallows.xcodeproj/project.pbxproj index c3f8aa2..63df188 100644 --- a/Marshmallows.xcodeproj/project.pbxproj +++ b/Marshmallows.xcodeproj/project.pbxproj @@ -237,7 +237,7 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 0430; - ORGANIZATIONNAME = "Guru Logic"; + ORGANIZATIONNAME = "Sami Samhuri"; }; buildConfigurationList = 7BE32D0014132EE3008F2DEA /* Build configuration list for PBXProject "Marshmallows" */; compatibilityVersion = "Xcode 3.2"; diff --git a/Marshmallows/MMHTTPClient.h b/Marshmallows/MMHTTPClient.h index 4489264..ff4d8a2 100644 --- a/Marshmallows/MMHTTPClient.h +++ b/Marshmallows/MMHTTPClient.h @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-03. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import diff --git a/Marshmallows/MMHTTPClient.m b/Marshmallows/MMHTTPClient.m index 8bcfcda..0685718 100644 --- a/Marshmallows/MMHTTPClient.m +++ b/Marshmallows/MMHTTPClient.m @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-03. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import "MMHTTPClient.h" diff --git a/Marshmallows/MMHTTPRequest.h b/Marshmallows/MMHTTPRequest.h index eb9e64d..9f24e26 100644 --- a/Marshmallows/MMHTTPRequest.h +++ b/Marshmallows/MMHTTPRequest.h @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-03. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import diff --git a/Marshmallows/MMHTTPRequest.m b/Marshmallows/MMHTTPRequest.m index 451ed36..ff7af77 100644 --- a/Marshmallows/MMHTTPRequest.m +++ b/Marshmallows/MMHTTPRequest.m @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-03. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import "MMHTTPRequest.h" diff --git a/Marshmallows/Marshmallows.h b/Marshmallows/Marshmallows.h index cc9f04e..d93198c 100644 --- a/Marshmallows/Marshmallows.h +++ b/Marshmallows/Marshmallows.h @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-03. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import diff --git a/Marshmallows/NSString+marshmallows.h b/Marshmallows/NSString+marshmallows.h index 57b2f10..cbf3438 100644 --- a/Marshmallows/NSString+marshmallows.h +++ b/Marshmallows/NSString+marshmallows.h @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-03. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import diff --git a/Marshmallows/NSString+marshmallows.m b/Marshmallows/NSString+marshmallows.m index 4f36208..871a42f 100644 --- a/Marshmallows/NSString+marshmallows.m +++ b/Marshmallows/NSString+marshmallows.m @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-03. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import "NSString+marshmallows.h" diff --git a/Marshmallows/UIAlertView+marshmallows.h b/Marshmallows/UIAlertView+marshmallows.h index 63e8afc..26590f9 100644 --- a/Marshmallows/UIAlertView+marshmallows.h +++ b/Marshmallows/UIAlertView+marshmallows.h @@ -3,7 +3,7 @@ // DatingX // // Created by Sami Samhuri on 11-08-24. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import diff --git a/Marshmallows/UIAlertView+marshmallows.m b/Marshmallows/UIAlertView+marshmallows.m index abe7aa3..f33fcc6 100644 --- a/Marshmallows/UIAlertView+marshmallows.m +++ b/Marshmallows/UIAlertView+marshmallows.m @@ -3,7 +3,7 @@ // DatingX // // Created by Sami Samhuri on 11-08-24. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import "UIAlertView+marshmallows.h" diff --git a/Marshmallows/UIAlertViewDelegate.h b/Marshmallows/UIAlertViewDelegate.h index 3c8620c..655bccd 100644 --- a/Marshmallows/UIAlertViewDelegate.h +++ b/Marshmallows/UIAlertViewDelegate.h @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-05. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import diff --git a/Marshmallows/UIAlertViewDelegate.m b/Marshmallows/UIAlertViewDelegate.m index 3b6c71a..4a46e26 100644 --- a/Marshmallows/UIAlertViewDelegate.m +++ b/Marshmallows/UIAlertViewDelegate.m @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-05. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import "UIAlertViewDelegate.h" diff --git a/MarshmallowsTesting/NSDateTest.m b/MarshmallowsTesting/NSDateTest.m index 8e77997..43a4ec6 100644 --- a/MarshmallowsTesting/NSDateTest.m +++ b/MarshmallowsTesting/NSDateTest.m @@ -3,7 +3,7 @@ // Marshmallows // // Created by Sami Samhuri on 11-09-04. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import diff --git a/MarshmallowsTesting/main.m b/MarshmallowsTesting/main.m index 22b9d6f..0bdae30 100644 --- a/MarshmallowsTesting/main.m +++ b/MarshmallowsTesting/main.m @@ -3,7 +3,7 @@ // MarshmallowsTesting // // Created by Sami Samhuri on 11-09-04. -// Copyright 2011 Guru Logic. All rights reserved. +// Copyright 2011 Sami Samhuri. All rights reserved. // #import diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..79c9d19 --- /dev/null +++ b/Readme.md @@ -0,0 +1,61 @@ +# Marshmallows + +Marshmallows sweeten up your Cocoa for iOS. + + +## Overview + +Sometimes the simple things are verbose with Cocoa. This project aims +to make the simple things less verbose. Mainly via categories, but this +may change. Or prefixes to each method name might be added. + + +## Installation + +Marshmallows is available on CocoaPods, add `pod 'Marshmallows', '~> 0.1'` to your Podfile. + +Alternatively you could clone this repo and add the files you want into your project directly. + + +## Categories + +### NSDate + +- Adds `+[NSDate dateWithYear:month:day:]` to construct a date +- Adds `-[NSDate relativeToNow]` to get a string describing the date, e.g. 1 minute ago + +### NSString + +- Adds `-[NSString firstMatch:]` to find the first substring matching the given regex string. +- Adds `-[NSString stringByReplacing:with:]` to replace all occurrences of the given regex string with something. +- Adds `-[NSString stringByReplacingFirst:with:]` to replace one occurrence of the given regex string with something. +- Adds `-[NSString stringByTrimmingWhitespace]` to trim strings. +- Adds `-[NSString stringByURLEncoding]` encodes a string for use in a URL, including ampersands (and others). + +### UIAlertView + +The last argument to the confirm methods is a block with the signature `^(int buttonClicked, BOOL canceled)`. + +- Adds `+[UIAlertView showAlertWithTitle:message:]`. +- Adds `+[UIAlertView confirmWithTitle:message:then:]`. +- Adds `+[UIAlertView confirmWithTitle:message:cancelTitle:okTitle:then:]`. + + +## Classes + +### MMHTTPClient + +Provides a simple HTTP client built on `MMHTTPRequest`. Makes it trivial to fetch some text or an image. +(JSON is coming!) + + +### MMHTTPRequest + +A simple HTTP request class that uses blocks. It can decode text and image responses. (JSON is coming!) + + +# License + +© 2011-2014 Sami Samhuri + +[MIT license](http://sjs.mit-license.org)