A Swift library providing syntactic sugar and extensions for iOS and macOS Cocoa development.
Sugar is a Swift library that adds syntactic sugar and extensions to Cocoa frameworks for iOS and macOS development. It provides utilities for common tasks like accessing app info, handling keyboard events, simplifying date and frame manipulations, and offering testing environment checks, all aimed at reducing boilerplate code.
iOS and macOS developers working with Swift and Cocoa who want to write more concise and expressive code by leveraging utility extensions and helpers.
Developers choose Sugar for its comprehensive set of well-designed extensions that integrate seamlessly with Cocoa, eliminating repetitive code and offering intuitive APIs for everyday development tasks.
:coffee: Something sweet that goes great with your Cocoa
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides static properties like Application.name and Application.version for quick access to app info, eliminating verbose Bundle API calls as shown in the README examples.
Offers built-in handlers such as BasicKeyboardHandler and ConstraintKeyboardHandler to simplify UI adjustments during keyboard events, reducing boilerplate animation code.
Allows natural date manipulation with expressions like 5.day and 3.week, making date-related code more readable and concise, as demonstrated in the README.
Includes properties like Simulator.isRunning and UITesting.isRunning to conditionally exclude code during tests, aiding in clean test setups and simulator-specific operations.
Lacks support for SwiftUI, making it irrelevant for modern iOS/macOS projects adopting Apple's latest UI frameworks, as all extensions are Cocoa-specific.
Extensions like direct frame property access (e.g., view.width = 200) can encourage imperative UI programming, contradicting Auto Layout best practices and leading to fragile code.
Adds an external library for utilities that might be simple to implement manually, increasing project complexity and potential compatibility issues with future Swift versions.