OpinionatedC alternatives and similar libraries
Based on the "Utility" category.
Alternatively, view OpinionatedC alternatives based on common mentions on social networks and blogs.
-
SwifterSwift
A handy collection of more than 500 native Swift 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. -
Reusable
A Swift mixin for reusing views easily and in a type-safe way (UITableViewCells, UICollectionViewCells, custom UIViews, ViewControllers, Storyboards…) -
SwiftLinkPreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images. -
BFKit-Swift
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster. -
VTAcknowledgementsViewController
Acknowledgements screen displaying a list of licenses, for example from CocoaPods dependencies. -
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. Please ⭐️ this repo on the top right corner to make this repo popular. -
ZamzamKit
A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of OpinionatedC or a related project?
README
OpinionatedC
Sometimes, Objective-C is just overly verbose. Life is too short to enumerateObjectsUsingBlock
and who has the time to create sub-arrays with filteredArrayUsingPredicate
anyway?
OpinionatedC is here to fix that. It offers a ton of Smalltalk-style convenience extension methods that make writing concise, easily readable Objective-C code a pleasure.
Usage
The easiest way to include OpinionatedC into your project is through CocoaPods:
pod 'OpinionatedC'
Import the umbrella header everywhere you want to taste the sweetness of OpinionatedC:
#import <OpinionatedC/OpinionatedC.h>
A Note About Method Prefixes
There is no doubt that the best practice for extension methods in categories is to include a vendor prefix
in the selector. Currently, OpinionatedC does not conform to that best practice, since having to write (and read)
stuff like oc_each:
instead of a plain each:
does not really seem to contribute to readability.
However, I'm currently looking for a method to allow optional, configurable method prefixes for users that want (or need) them. Feel free to add to the discussion in #1 if you have any ideas about this topic.
Features
The complete list of features is available on the official OpinionatedC website.
Here is a small potpourri of what is possible with OpinionatedC:
[@[@"hello", @"world!"] average:^NSNumber*(id each) {
return @([each length]);
}]
// => @5.5
NSSet *set = [NSSet setWithObjects:@"foo", @"bar", @"hello", @"world!", nil];
[set groupedBy:^id(id each) {
return @([each length]);
}]
// => @{
// @3 : a NSSet(@"foo", @"bar"),
// @5 : a NSSet(@"hello"),
// @6 : a NSSet(@"world!")
// }
[@[@"foo", @"bar"] each:^(NSString *each) {
NSLog(@"%@", each);
}]
// => foo
// => bar
[@"abc" eachWithIndex:^(NSString *each, NSUInteger idx) {
NSLog(@"%@ - %@", each, @(idx));
}]
// => a - 0
// => b - 1
// => c - 2
[@[@"a", @"b", @"c"] isEmpty]
// => NO
[@[@1, @2, @3] map:^id(NSNumber *each) {
return @([each integerValue] * 2);
}]
// => @[@2, @4, @6]
[@[@1, @2, @3] inject:@0 into:^id(NSNumber *running, NSNumber *each) {
return @([running integerValue] + [each integerValue]);
}]
// => @6
[@[@1, @2, @3, @4] allSatisfy:^BOOL(NSNumber *each) {
return [each integerValue] % 2 == 0;
}]
// => NO
[@"abcdef" first:3]
// => @"abc"
[@{ @1 : @"foo", @2 : @"bar"} detect:^BOOL(OCAssociation *each) {
return [each.key isEqualToNumber:@2];
}]
// => an OCAssociation(@2, @"bar")
[@{ @1 : @"foo", @2 : @"bar"} select:^BOOL(OCAssociation *each) {
return [each.key isEqualToNumber:@2];
}]
// => @{ @2 : @"bar" }
[@{ @1 : @"foo", @2 : @"bar"} reject:^BOOL(OCAssociation *each) {
return [each.key isEqualToNumber:@2];
}]
// => @{ @1 : @"foo" }
[@100 atRandom]
// => 77
[@3 timesRepeat:^{
NSLog(@"hooray!");
}]
// => hooray
// => hooray
// => hooray
[[@1 to:@10] select:^id(NSNumber *each) {
return [each integerValue] % 2 == 0;
}]
// => @[@2, @4, @6, @8, @10]
Contributing
If you have any questions, remarks, ideas or suggestions for improvement, don't hesitate to open an issue. If you are about to create a pull request, there are only a few things to consider:
- open an issue first if you are not sure if your idea will be appreciated
- indent with tabs, not spaces
- write unit tests, aim for 100% coverage
Contributors
License
The MIT License (MIT)
Copyright (c) 2015 Leo Schweizer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*Note that all licence references and agreements mentioned in the OpinionatedC README section above
are relevant to that project's source code only.