All Projects → JohnSundell → Cgoperators

JohnSundell / Cgoperators

Licence: mit
Easily manipulate CGPoints, CGSizes and CGVectors using math operators

Programming Languages

swift
15916 projects
operators
16 projects

Labels

Projects that are alternatives of or similar to Cgoperators

Uicircularprogressring
A circular progress bar for iOS written in Swift
Stars: ✭ 1,658 (+1165.65%)
Mutual labels:  xcode
Animate
Declarative UIView animations without nested closures
Stars: ✭ 124 (-5.34%)
Mutual labels:  xcode
Genericdatasource
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.
Stars: ✭ 127 (-3.05%)
Mutual labels:  xcode
Whats New In Swift 5 1
An Xcode playground that demonstrates the new features introduced in Swift 5.1.
Stars: ✭ 122 (-6.87%)
Mutual labels:  xcode
Nine41
Automate overriding the status bars for all running iOS simulators
Stars: ✭ 124 (-5.34%)
Mutual labels:  xcode
Luexpandabletableview
A subclass of UITableView with expandable and collapsible sections
Stars: ✭ 125 (-4.58%)
Mutual labels:  xcode
Xib2storyboard
A tool to convert Xcode .xib to .storyboard files
Stars: ✭ 121 (-7.63%)
Mutual labels:  xcode
Spperspective
Widgets iOS 14 animation with 3D and dynamic shadow. Customisable transform and duration.
Stars: ✭ 127 (-3.05%)
Mutual labels:  xcode
Croc
Swift emoji string parsing library
Stars: ✭ 124 (-5.34%)
Mutual labels:  xcode
Cloudkitgdpr
Framework for allowing users to manage data stored in iCloud
Stars: ✭ 126 (-3.82%)
Mutual labels:  xcode
Trainer Mac
Trains a model, then generates a complete Xcode project that uses it - no code necessary
Stars: ✭ 122 (-6.87%)
Mutual labels:  xcode
Tuist
🚀 Create, maintain, and interact with Xcode projects at scale
Stars: ✭ 2,234 (+1605.34%)
Mutual labels:  xcode
Ios Good Practices
Good ideas for iOS development, by Futurice developers.
Stars: ✭ 10,417 (+7851.91%)
Mutual labels:  xcode
Xcode Build Times
This BitBar/SwiftBar plugin shows the time you spend waiting for Xcode to do your builds
Stars: ✭ 122 (-6.87%)
Mutual labels:  xcode
Swiftdux
Predictable state management for SwiftUI applications.
Stars: ✭ 130 (-0.76%)
Mutual labels:  xcode
Wwdc Recap
A collection of session summaries in markdown format, from WWDC 20, 19 & 17
Stars: ✭ 121 (-7.63%)
Mutual labels:  xcode
Xcode developer disk images
Stars: ✭ 125 (-4.58%)
Mutual labels:  xcode
Xcode Time Tracker
Stars: ✭ 131 (+0%)
Mutual labels:  xcode
Testdrive
Quickly try out any Swift pod or framework in a playground
Stars: ✭ 1,612 (+1130.53%)
Mutual labels:  xcode
Timliu Ios
iOS开发常用三方库、插件、知名博客等等
Stars: ✭ 10,898 (+8219.08%)
Mutual labels:  xcode

CGOperators

CocoaPods Carthage Swift Package Manager Marathon Twitter: @johnsundell

Welcome to CGOperators, a small Swift framework that enables you to easily manipulate Core Graphics' vector types (CGPoint, CGSize and CGVector) using math operators. It can help you write compact, yet highly readable code when dealing with things like image sizes and frame-based layouts.

Examples

Add two vectors

let point = view.frame.origin + CGPoint(x: 10, y: 20)
let size = image.size + view.frame.size
let vector = physicsWorld.gravity + player.size

Subtract two vectors

let point = view.frame.origin - CGPoint(x: 10, y: 20)
let size = image.size - view.frame.size
let vector = physicsWorld.gravity - player.size

Multiply a vector with a constant

view.frame.size = image.size * 4
button.frame.origin = superview.bounds.size * 2
physicsWorld.gravity = player.position * 10

Divide a vector by a constant

view.frame.size = image.size / 4
button.frame.origin = superview.bounds.size / 2
physicsWorld.gravity = player.position / 10

Installation

Using CocoaPods

Add pod CGOperators to your Podfile

Using Carthage

Add git "JohnSundell/CGOperators" to your Cartfile

Using the Swift Package Manager

Add Package(url: "https://github.com/JohnSundell/CGOperators.git", majorVersion: 1) to your Package.swift file.

Using Marathon

Run marathon add https://github.com/JohnSundell/CGOperators.git on the command line.

Help, feedback or suggestions?

  • Open an issue if you need help, if you found a bug, or if you want to discuss a feature request.
  • Open a PR if you want to make some change to CGOperators.
  • Contact @johnsundell on Twitter for discussions, news & announcements about CGOperators and other open source projects.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].