/SimpleCAGraphics

Easy access to Core Animation graphics

Primary LanguageSwiftMIT LicenseMIT

SimpleCAGraphics

Easy access to Core Animation grahpics

screenshot

Features

  • Method chaining for Layer's properties and methods
  • Call methods with Double or Float type arguments. Library also supports CGFloat type

Requirements

  • iOS 10.0+
  • Xcode 10.1+
  • Swift 4.2+

Installation

Carthage

Cartfile

github "KinkumaDesign/SimpleCAGraphics"

Install Command

carthage update --platform iOS
  1. Drag and Drop Carthage/Build/iOS/SimpleCAGraphics.framework to Linked Frameworks and Libraries
  2. In Build Phases, add Run Script
  3. In script area
/usr/local/bin/carthage copy-frameworks
  1. Set Input Files
$(SRCROOT)/Carthage/Build/iOS/SimpleCAGraphics.framework
  1. Set Output Files
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SimpleCAGraphics.framework

CocoaPods

Podfile

pod 'SimpleCAGraphics', :git => 'https://github.com/KinkumaDesign/SimpleCAGraphics.git'

Getting Started

import SimpleCAGraphics
let layerController = LayerController()
layerController.setFrame(x: 0, y: 0, width: 100, height: 70)
    .translate(x: 100, y: 100)
    .setBackgroundColor(.red)
    .setOpacity(0.5)
view.layer.addSublayer(layerController.layer)

Usage

You can read example code in iOSExample project

Practical Example

Utility

License

MIT license