A set of functional additions for Foundation that bring Ruby-style syntax and convenience to Objective-C.
ObjectiveSugar is a library that extends Apple's Foundation framework with Ruby-inspired methods, bringing functional programming patterns and syntactic sugar to Objective-C. It simplifies common tasks like collection manipulation, date arithmetic, and string handling, making code more concise and readable. The project addresses the verbosity of Objective-C by providing expressive alternatives to traditional Foundation APIs.
iOS and macOS developers working with Objective-C who want to write more expressive, functional-style code with less boilerplate. It's particularly useful for those familiar with Ruby or modern languages seeking similar conveniences in Objective-C.
Developers choose ObjectiveSugar because it dramatically reduces verbosity while staying within the Objective-C ecosystem, offering a curated set of utilities that feel native. Unlike larger frameworks, it's lightweight, focused on Foundation extensions, and maintains full compatibility with existing Cocoa code.
ObjectiveC additions for humans. Ruby style.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Adds Ruby-inspired iterators like map, select, and reject to NSArray and NSSet, reducing boilerplate. The README shows how [cars map:...] easily transforms collections with functional clarity.
Provides natural syntax for date manipulations, such as @3.days.ago, making calculations more readable than standard NSDate APIs. Examples demonstrate quick date shifts without verbose method calls.
Offers convenient methods like split and match for string handling, simplifying common tasks. The README illustrates splitting sentences and matching patterns with concise, chainable calls.
Promotes immutability by default, as most array methods return modified copies, reducing side effects. This is evident in examples where transformations leave original arrays unchanged.
Extending Foundation classes with categories risks method clashes with other libraries or future Apple updates, which can lead to subtle bugs in complex codebases.
It's irrelevant for Swift projects, where modern syntax and libraries like Swift Collections offer similar functionality, making it a niche choice in today's ecosystem.
The library appears less actively maintained as Swift dominates iOS development, raising concerns about long-term support and compatibility with newer OS versions.