More Related Content Similar to Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!) Similar to Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!) (20) Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)3. AFNetworking
https://github.com/AFNetworking/AFNetworking
NSURL
*url
=
[NSURL
URLWithString:@"https://alpha-‐api.app.net/stream/0/posts/stream/global"];
NSURLRequest
*request
=
[NSURLRequest
requestWithURL:url];
AFJSONRequestOperation
*operation
=
[AFJSONRequestOperation
JSONRequestOperationWithRequest:request
success:^(NSURLRequest
*request,
NSHTTPURLResponse
*response,
id
JSON)
{
NSLog(@"App.net
Global
Stream:
%@",
JSON);
}
failure:nil];
[operation
start];
4. FSNetworking
https://github.com/foursquare/FSNetworking
NSURL
*url
=
...;
//
required
NSDictionary
*headers
=
...;
//
optional
NSDictionary
*parameters
=
...;
//
optional
FSNConnection
*connection
=
[FSNConnection
withUrl:url
method:FSNRequestMethodGET
headers:headers
parameters:parameters
parseBlock:^id(FSNConnection
*c,
NSError
**error)
{
return
[c.responseData
dictionaryFromJSONWithError:error];
}
completionBlock:^(FSNConnection
*c)
{
NSLog(@"complete:
%@n
error:
%@n
parseResult:
%@n",
c,
c.error,
c.parseResult);
}
progressBlock:^(FSNConnection
*c)
{
NSLog(@"progress:
%@:
%.2f/%.2f",
c,
c.uploadProgress,
c.downloadProgress);
}];
[connection
start];
5. RestKIT
https://github.com/RestKit/RestKit
@interface
Tweet
:
NSObject
@property
(nonatomic,
copy)
NSNumber
*userID;
@property
(nonatomic,
copy)
NSString
*username;
@property
(nonatomic,
copy)
NSString
*text;
@end
RKObjectMapping
*mapping
=
[RKObjectMapping
mappingForClass:[RKTweet
class]];
[mapping
addAttributeMappingsFromDictionary:@{
@"user.name":
@"username",
@"user.id":
@"userID",
@"text":
@"text"
}];
RKResponseDescriptor
*responseDescriptor
=
[RKResponseDescriptor
responseDescriptorWithMapping:mapping
pathPattern:nil
keyPath:nil
statusCodes:nil];
NSURL
*url
=
[NSURL
URLWithString:@"http://api.twitter.com/1/statuses/public_timeline.json"];
NSURLRequest
*request
=
[NSURLRequest
requestWithURL:url];
RKObjectRequestOperation
*operation
=
[[RKObjectRequestOperation
alloc]
initWithRequest:request
responseDescriptors:@[responseDescriptor]];
[operation
setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation,
RKMappingResult
*result)
{
NSLog(@"The
public
timeline
Tweets:
%@",
[result
array]);
}
failure:nil];
[operation
start];
6. MBProgressHUD
https://github.com/jdg/MBProgressHUD
MBProgressHUD
*hud
=
[MBProgressHUD
showHUDAddedTo:self.view
animated:YES];
hud.mode
=
MBProgressHUDModeAnnularDeterminate;
hud.labelText
=
@"Loading";
[self
doSomethingInBackgroundWithProgressCallback:^(float
progress)
{
hud.progress
=
progress;
}
completionCallback:^{
[MBProgressHUD
hideHUDForView:self.view
animated:YES];
}];
10. NUI
@primaryFontName:
HelveticaNeue;
@secondaryFontName:
HelveticaNeue-‐Light;
@primaryFontColor:
#333333;
@primaryBackgroundColor:
#E6E6E6;
Button
{
background-‐color:
@primaryBackgroundColor;
border-‐color:
#A2A2A2;
border-‐width:
@primaryBorderWidth;
font-‐color:
@primaryFontColor;
font-‐color-‐highlighted:
#999999;
font-‐name:
@primaryFontName;
font-‐size:
18;
corner-‐radius:
7;
}
NavigationBar
{
background-‐tint-‐color:
@primaryBackgroundColor;
font-‐name:
@secondaryFontName;
font-‐size:
20;
font-‐color:
@primaryFontColor;
11. PSTCollectionView
https://github.com/steipete/PSTCollectionView
Open Source, 100% API compatible replacement of UICollectionView for iOS4.3+
UICollectionViewFlowLayout
*flowLayout
=
[UICollectionViewFlowLayout
new];
PSTCollectionView
*collectionView
=
[PSTCollectionView
alloc]
initWithFrame:self.view.bounds
collectionViewLayout:
(PSTCollectionViewFlowLayout
*)flowLayout];
13. BlockAlerts
https://github.com/gpambrozio/BlockAlertsAnd-
ActionSheets
BlockAlertView
*alert
=
[BlockAlertView
alertWithTitle:@"Alert
Title"
message:@"This
is
a
very
long
message,
designed
just
to
show
you
how
smart
this
class
is"];
[alert
addButtonWithTitle:@"Do
something
cool"
block:^{
//
Do
something
cool
when
this
button
is
pressed
}];
[alert
setCancelButtonWithTitle:@"Please,
don't
do
this"
block:^{
//
Do
something
or
nothing....
This
block
can
even
be
nil!
}];
[alert
setDestructiveButtonWithTitle:@"Kill,
Kill"
block:^{
//
Do
something
nasty
when
this
button
is
pressed
}];
14. SEHumanizedTimeDiff
https://github.com/sarperdag/SEHumanizedTimeDiff
//1
minute
myLabel.text
=
[[NSDate
dateWithTimeIntervalSinceNow:-‐360]
stringWithHumanizedTimeDifference:NSDateHumanizedSuffixNone
withFullString:NO];
//This
will
return
@"1m"
//2
days
myLabel.text
=
[[NSDate
dateWithTimeIntervalSinceNow:-‐3600*24*2]
stringWithHumanizedTimeDifference:NSDateHumanizedSuffixAgo
withFullString:YES];
//This
will
return
@"2
days
ago"
16. STTweetLabel
https://github.com/
SebastienThiebaud/STTweetLabel/
STTweetLabel
*tweetLabel
=
[[STTweetLabel
alloc]
initWithFrame:CGRectMake(20.0,
60.0,
280.0,
200.0)];
[tweetLabel
setFont:[UIFont
fontWithName:@"HelveticaNeue"
size:17.0]];
[tweetLabel
setTextColor:[UIColor
blackColor]];
[tweetLabel
setDelegate:self];
[tweetLabel
setText:@"Hi.
This
is
a
new
tool
for
@you!
Developed
by-‐
>@SebThiebaud
for
#iPhone
#ObjC...
;-‐)
My
GitHub
page:
https://t.co/pQXDoiYA"];
[self.view
addSubview:tweetLabel];
18. iRate
https://github.com/nicklockwood/iRate
iRate is a library to help you promote your iPhone and
Mac App Store apps by prompting users to rate the
app after using it for a few days. This approach is one
of the best ways to get positive app reviews by
targeting only regular users (who presumably like the
app or they wouldn't keep using it!).