What's New

DLCoreGraphics v1.0.0



A cross-platform framework which brings easy to use convenience properties, functions and overloaded operators.


You can import this module using:

import DLCoreGraphics

A common operation is to round/ceil/floor a number while computing the layout of view. To simplify the work, these functions have been overloaded for CGPoint, CGSize and CGRect. Since we're doing layout for devices with different scales, it is helpful to the rounding operations based on the device's scale. Therefore, there are available 3 new functions: screenRound, screenCeil and screenFloor.

Few examples of operators:

var point = CGPoint(x: 10.0, y: 20.0)
let otherPoint = CGPoint(x: 40.0, y: 30.0)
point += otherPoint
// point == CGPoint(x: 50.0, y: 50.0)
let size = CGSize(width: 100, height: 100.0)
let newSize = size * 3 
// newSize == CGSize(width: 300, height: 300.0)

Finding the middle of right side of a rectangle

let rectangle = CGRect(x: 10.0, y: 20.0, width: 100, height: 100.0)
let middle = rectanle.middle(forSide: .right)
// middle == CGPoint(x: 110.0, y: 70.0)

And much more are available; check the framework for full details.


Supported Operating Systems

  • macOS 10.12 and later
  • iOS 10.0 and later
  • watchOS 3.0 and later
  • tvOS 10.0 and later

1. Carthage

github "davidlivadaru/DLCoreGraphics"

If you need the framework only for a single OS, then I propose to use --platform [iOS|macOS|watchOS|tvOS] specifier when your perform carthage update.

2. CocoaPods

Add the dependency in your Podfile.

pod 'DLCoreGraphics'

Note: Currently watchOS is not supported using CocoaPods, please use Carthage instead.

3. Swift Package Manager

Add the the following dependecy in your Package.swift:

dependencies: [
    .package(url: "https://github.com/davidlivadaru/DLCoreGraphics.git", .upToNextMajor(from: "1.0.0"))

and update your target's dependencies:

targets: [
            name: "YourTargetName",
            dependencies: ["DLCoreGraphics"])),


Module is covered by unit tests, however, bugs always slip through. If you find a bug in the module create an issue.

If you want to contribute on fixing bugs or implementing new features then create a pull request.


DLCoreGraphics is released under MIT license. See LICENSE for details.


  • Swift Tools 4.0.0
View More Packages from this Author


Last updated: Wed Nov 09 2022 17:29:52 GMT-0500 (GMT-05:00)