Latest 1.0.0
Homepage https://github.com/v-braun/VBRProceduralStrings
License MIT
Platforms ios 10.0
Dependencies Macaw
Authors

UIImageView extension for procedural generation of beautiful svg shapes

By v-braun – viktor-braun.de.


Build Status
Cocoapods

Description

Installation

CocoaPods

VBRProceduralStrings is available on CocoaPods. Just add the following to your project Podfile:

pod 'VBRProceduralStrings'

Or from GitHub:

pod 'VBRProceduralStrings', :git => 'https://github.com/v-braun/VBRProceduralStrings.git'

VBRProceduralStrings use Macaw to parse the generated SVG content and render it on an CALayer. You should add it also to your Podfile

Manually

  1. Download and drop VBRProceduralStrings.swift in your project.
  2. Add Macaw to your project
  3. Congratulations!

Usage

Create an UIView


    let settings = ProcStringsSettings()
    // _svgView is a placeholder that was setup on the main view via interfacebuilder
    // see the example project for that
    // you should do that in viewDidAppear that guarantee that width and hight has correct values
    settings.width = Float(_svgView.bounds.width) 
    settings.height = Float(_svgView.bounds.height)
    settings.lines = 100
    settings.points = 8
    // horizontal gradients
    settings.gradients.append(GradientStep(offset: 0, color: "#03a9f4")) 
    settings.gradients.append(GradientStep(offset: 70, color: "#e91e63"))

    let subView = ProceduralStringGenerator.generateSVGUIView(settings: settings)
    self.addSubView(subView)

Create an UIImage


    let settings = ProcStringsSettings()
    settings.width = 420 
    settings.height = 240
    settings.lines = 100
    settings.points = 8
    // horizontal gradients
    settings.gradients.append(GradientStep(offset: 0, color: "#03a9f4")) 
    settings.gradients.append(GradientStep(offset: 70, color: "#e91e63"))

    let image = ProceduralStringGenerator.generateSVGImage(settings: settings)

Create a SVG String


    let settings = ProcStringsSettings()
    settings.width = 420 
    settings.height = 240
    settings.lines = 100
    settings.points = 8
    // horizontal gradients
    settings.gradients.append(GradientStep(offset: 0, color: "#03a9f4")) 
    settings.gradients.append(GradientStep(offset: 70, color: "#e91e63"))

    let svgString = ProceduralStringGenerator.generateSVGString(settings: settings)

Use UIImageView extension


    let settings = ProcStringsSettings()
    settings.width = 420 
    settings.height = 240
    settings.lines = 100
    settings.points = 8
    // horizontal gradients
    settings.gradients.append(GradientStep(offset: 0, color: "#03a9f4")) 
    settings.gradients.append(GradientStep(offset: 70, color: "#e91e63"))

    myUIImageView.generate(settings: settings)

Authors

image
v-braun

Contributing

Make sure to read these guides before getting started:

License

VBRProceduralStrings is available under the MIT License. See LICENSE for details.

Latest podspec

{
    "name": "VBRProceduralStrings",
    "version": "1.0.0",
    "summary": "Procedural generation of beautiful svg shapes",
    "description": "Procedural generation of beautiful svg shapesnn![image](https://github.com/v-braun/VBRProceduralStrings/raw/master/.assets/Screenshot.png)",
    "homepage": "https://github.com/v-braun/VBRProceduralStrings",
    "screenshots": "https://github.com/v-braun/VBRProceduralStrings/raw/master/.assets/Screenshot.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Viktor Braun (v_b)": "[email protected]"
    },
    "social_media_url": "https://twitter.com/v_braun",
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "4.2",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.2"
    },
    "source": {
        "git": "https://github.com/v-braun/VBRProceduralStrings.git",
        "tag": "1.0.0"
    },
    "source_files": "VBRProceduralStrings/*.swift",
    "exclude_files": "Pods/*",
    "dependencies": {
        "Macaw": [
            "0.9.3"
        ]
    }
}

Pin It on Pinterest

Share This