Popularity
7.9
Stable
Activity
0.0
Stable
1,494
49
105
Code Quality Rank:
L4
Programming language: Objective-C
License: MIT License
Tags:
Utility
Latest version: v0.3.0
Underscore.m alternatives and similar libraries
Based on the "Utility" category.
Alternatively, view Underscore.m alternatives based on common mentions on social networks and blogs.
-
SwifterSwift
A handy collection of more than 290 native Swift 3 extensions to boost your productivity. -
InAppSettingsKit
This iOS framework allows settings to be in-app in addition to or instead of being in the Settings app. -
SwiftLinkPreview
It makes a preview from an url, grabbing all the information such as title, relevant texts and images. -
VTAcknowledgementsViewController
Ready to use “Acknowledgements”/“Licenses”/“Credits” view controller for CocoaPods. -
SwiftFoundation
Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. (Pure Swift, Supports Linux) -
AssistantKit
Easy way to detect iOS device properties, OS versions and work with screen sizes. Powered by Swift. -
DeviceGuru
DeviceGuru is a simple lib (Swift) to know the exact type of the device, e.g. iPhone 6 or iPhone 6s. -
ZamzamKit
A collection of micro utilities and extensions for Standard Library, Foundation and UIKit.
Get performance insights in less than 4 minutes
Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Sponsored
scoutapm.com
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of Underscore.m or a related project?
README
Underscore.m
About Underscore.m
Underscore.m is a small utility library to facilitate working with common data structures in Objective-C.
It tries to encourage chaining by eschewing the square bracket]]]]]].
It is inspired by the awesome underscore.js.
Real world example
// First, let's compose a twitter search request
NSURL *twitterSearch = [NSURL URLWithString:@"http://search.twitter.com/[email protected]&rpp=100"];
// ... then we fetch us some json ...
NSData *data = [NSData dataWithContentsOfURL:twitterSearch];
// ... and parse it.
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:NULL];
// This is where the fun starts!
NSArray *tweets = [json valueForKey:@"results"];
NSArray *processed = _array(tweets)
// Let's make sure that we only operate on NSDictionaries, you never
// know with these APIs ;-)
.filter(Underscore.isDictionary)
// Remove all tweets that are in English
.reject(^BOOL (NSDictionary *tweet) {
return [[tweet valueForKey:@"iso_language_code"] isEqualToString:@"en"];
})
// Create a simple string representation for every tweet
.map(^NSString *(NSDictionary *tweet) {
NSString *name = [tweet valueForKey:@"from_user_name"];
NSString *text = [tweet valueForKey:@"text"];
return [NSString stringWithFormat:@"%@: %@", name, text];
})
.unwrap;
Documentation
Documentation for Underscore.m can be found on the website.