Skip to content
Snippets Groups Projects
Commit 5b00d0e7 authored by Oliver Wiese's avatar Oliver Wiese
Browse files

add new security indicators (padlocks)

parent ea24e970
Branches
No related tags found
No related merge requests found
......@@ -2,13 +2,12 @@
// IconsStyleKit.swift
// enzevalos
//
// Created by Joscha on 04.01.17.
// Copyright © 2017 FU Berlin. All rights reserved.
// Created by Oliver Wiese on 22.01.19.
// Copyright © 2019 FU Berlin. All rights reserved.
//
// Generated by PaintCode
// http://www.paintcodeapp.com
//
// This code was partly generated by Trial version of PaintCode, therefore cannot be used for commercial purposes.
//
......@@ -31,6 +30,12 @@ open class IconsStyleKit: NSObject {
static var postcardTargets: [AnyObject]?
static var imageOfLetterOpen: UIImage?
static var letterOpenTargets: [AnyObject]?
static var imageOfPadlockSecure: UIImage?
static var padlockSecureTargets: [AnyObject]?
static var imageOfPadlockInsecure: UIImage?
static var padlockInsecureTargets: [AnyObject]?
static var imageOfPadlockError: UIImage?
static var padlockErrorTargets: [AnyObject]?
}
//// Colors
......@@ -446,6 +451,182 @@ open class IconsStyleKit: NSObject {
context.restoreGState()
}
@objc dynamic public class func drawPadlockSecure(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 80, height: 100), resizing: ResizingBehavior = .aspectFit, color: UIColor = IconsStyleKit.strokeColor, fillBackground: Bool = false) {
//// General Declarations
let context = UIGraphicsGetCurrentContext()!
//// Resize to Target Frame
context.saveGState()
let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 80, height: 100), target: targetFrame)
context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY)
context.scaleBy(x: resizedFrame.width / 80, y: resizedFrame.height / 100)
//// Color Declarations
let fillColor2 = color
//// Bezier Drawing
let bezierPath = UIBezierPath()
bezierPath.move(to: CGPoint(x: 71, y: 55))
bezierPath.addLine(to: CGPoint(x: 69, y: 55))
bezierPath.addLine(to: CGPoint(x: 69, y: 70))
bezierPath.addCurve(to: CGPoint(x: 40, y: 100), controlPoint1: CGPoint(x: 68.9, y: 89.19), controlPoint2: CGPoint(x: 55.91, y: 100))
bezierPath.addCurve(to: CGPoint(x: 11, y: 70), controlPoint1: CGPoint(x: 24.09, y: 100), controlPoint2: CGPoint(x: 10.5, y: 88.7))
bezierPath.addLine(to: CGPoint(x: 11, y: 55))
bezierPath.addCurve(to: CGPoint(x: 10, y: 55), controlPoint1: CGPoint(x: 11, y: 55), controlPoint2: CGPoint(x: 11.2, y: 55))
bezierPath.addCurve(to: CGPoint(x: 0, y: 46), controlPoint1: CGPoint(x: 8.73, y: 55), controlPoint2: CGPoint(x: 0, y: 53.46))
bezierPath.addLine(to: CGPoint(x: 0, y: 10))
bezierPath.addCurve(to: CGPoint(x: 10, y: 0), controlPoint1: CGPoint(x: 0, y: 2.04), controlPoint2: CGPoint(x: 9.78, y: 0))
bezierPath.addLine(to: CGPoint(x: 71, y: 0))
bezierPath.addCurve(to: CGPoint(x: 80, y: 10), controlPoint1: CGPoint(x: 71.22, y: 0), controlPoint2: CGPoint(x: 80, y: 1.05))
bezierPath.addLine(to: CGPoint(x: 80, y: 45))
bezierPath.addCurve(to: CGPoint(x: 71, y: 55), controlPoint1: CGPoint(x: 80, y: 53.45), controlPoint2: CGPoint(x: 71.22, y: 55))
bezierPath.addLine(to: CGPoint(x: 71, y: 55))
bezierPath.close()
bezierPath.move(to: CGPoint(x: 49, y: 14))
bezierPath.addLine(to: CGPoint(x: 31, y: 14))
bezierPath.addLine(to: CGPoint(x: 36, y: 28))
bezierPath.addCurve(to: CGPoint(x: 32, y: 35), controlPoint1: CGPoint(x: 33.88, y: 29.41), controlPoint2: CGPoint(x: 32, y: 32.2))
bezierPath.addCurve(to: CGPoint(x: 40, y: 43), controlPoint1: CGPoint(x: 32, y: 39.38), controlPoint2: CGPoint(x: 35.76, y: 43))
bezierPath.addCurve(to: CGPoint(x: 48, y: 35), controlPoint1: CGPoint(x: 44.24, y: 43), controlPoint2: CGPoint(x: 48, y: 39.38))
bezierPath.addCurve(to: CGPoint(x: 44, y: 28), controlPoint1: CGPoint(x: 48, y: 32.2), controlPoint2: CGPoint(x: 46.12, y: 29.41))
bezierPath.addLine(to: CGPoint(x: 49, y: 14))
bezierPath.addLine(to: CGPoint(x: 49, y: 14))
bezierPath.close()
bezierPath.move(to: CGPoint(x: 24, y: 55))
bezierPath.addLine(to: CGPoint(x: 24, y: 70))
bezierPath.addCurve(to: CGPoint(x: 40, y: 88), controlPoint1: CGPoint(x: 24, y: 79.95), controlPoint2: CGPoint(x: 30.16, y: 88))
bezierPath.addCurve(to: CGPoint(x: 56, y: 70), controlPoint1: CGPoint(x: 49.74, y: 88), controlPoint2: CGPoint(x: 56, y: 80.95))
bezierPath.addLine(to: CGPoint(x: 56, y: 55))
bezierPath.addLine(to: CGPoint(x: 24, y: 55))
bezierPath.addLine(to: CGPoint(x: 24, y: 55))
bezierPath.close()
bezierPath.usesEvenOddFillRule = true
fillColor2.setFill()
bezierPath.fill()
context.restoreGState()
}
@objc dynamic public class func drawPadlockInsecure(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 80, height: 100), resizing: ResizingBehavior = .aspectFit, color: UIColor = IconsStyleKit.strokeColor, fillBackground: Bool = false) {
//// General Declarations
let context = UIGraphicsGetCurrentContext()!
//// Resize to Target Frame
context.saveGState()
let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 80, height: 100), target: targetFrame)
context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY)
context.scaleBy(x: resizedFrame.width / 80, y: resizedFrame.height / 100)
//// Color Declarations
let fillColor = color
//// Page-1
//// lock-open
//// Bezier Drawing
let bezierPath = UIBezierPath()
bezierPath.move(to: CGPoint(x: 69.58, y: 26.48))
bezierPath.addCurve(to: CGPoint(x: 40.48, y: -0.16), controlPoint1: CGPoint(x: 69.58, y: 10.83), controlPoint2: CGPoint(x: 56.39, y: -0.16))
bezierPath.addCurve(to: CGPoint(x: 10.8, y: 29.48), controlPoint1: CGPoint(x: 24.57, y: -0.16), controlPoint2: CGPoint(x: 10.3, y: 10.78))
bezierPath.addLine(to: CGPoint(x: 10.79, y: 45.11))
bezierPath.addCurve(to: CGPoint(x: 9.82, y: 45.13), controlPoint1: CGPoint(x: 10.79, y: 45.11), controlPoint2: CGPoint(x: 11.02, y: 45.13))
bezierPath.addCurve(to: CGPoint(x: 0.19, y: 54.07), controlPoint1: CGPoint(x: 8.55, y: 45.13), controlPoint2: CGPoint(x: 0.19, y: 46.61))
bezierPath.addLine(to: CGPoint(x: 0.19, y: 89.89))
bezierPath.addCurve(to: CGPoint(x: 9.82, y: 99.84), controlPoint1: CGPoint(x: 0.19, y: 97.85), controlPoint2: CGPoint(x: 9.61, y: 99.84))
bezierPath.addLine(to: CGPoint(x: 71.03, y: 99.84))
bezierPath.addCurve(to: CGPoint(x: 80.18, y: 89.89), controlPoint1: CGPoint(x: 71.25, y: 99.84), controlPoint2: CGPoint(x: 80.18, y: 98.84))
bezierPath.addLine(to: CGPoint(x: 80.18, y: 54.56))
bezierPath.addCurve(to: CGPoint(x: 71.5, y: 45.13), controlPoint1: CGPoint(x: 80.18, y: 46.11), controlPoint2: CGPoint(x: 71.73, y: 45.13))
bezierPath.addLine(to: CGPoint(x: 24.26, y: 45.13))
bezierPath.addLine(to: CGPoint(x: 24.27, y: 29.68))
bezierPath.addCurve(to: CGPoint(x: 40.18, y: 11.78), controlPoint1: CGPoint(x: 24.27, y: 19.73), controlPoint2: CGPoint(x: 30.35, y: 11.78))
bezierPath.addCurve(to: CGPoint(x: 56.66, y: 29.16), controlPoint1: CGPoint(x: 49.92, y: 11.78), controlPoint2: CGPoint(x: 56.66, y: 18.16))
bezierPath.addLine(to: CGPoint(x: 69.58, y: 26.48))
bezierPath.close()
bezierPath.move(to: CGPoint(x: 49.33, y: 86.06))
bezierPath.addLine(to: CGPoint(x: 31.06, y: 86.06))
bezierPath.addLine(to: CGPoint(x: 36.02, y: 71.49))
bezierPath.addCurve(to: CGPoint(x: 32.5, y: 64.83), controlPoint1: CGPoint(x: 33.9, y: 70.08), controlPoint2: CGPoint(x: 32.5, y: 67.62))
bezierPath.addCurve(to: CGPoint(x: 40.18, y: 56.89), controlPoint1: CGPoint(x: 32.5, y: 60.44), controlPoint2: CGPoint(x: 35.94, y: 56.89))
bezierPath.addCurve(to: CGPoint(x: 47.87, y: 64.83), controlPoint1: CGPoint(x: 44.43, y: 56.89), controlPoint2: CGPoint(x: 47.87, y: 60.45))
bezierPath.addCurve(to: CGPoint(x: 44.35, y: 71.48), controlPoint1: CGPoint(x: 47.87, y: 67.62), controlPoint2: CGPoint(x: 46.47, y: 70.08))
bezierPath.addLine(to: CGPoint(x: 49.33, y: 86.06))
bezierPath.addLine(to: CGPoint(x: 49.33, y: 86.06))
bezierPath.close()
bezierPath.usesEvenOddFillRule = true
fillColor.setFill()
bezierPath.fill()
context.restoreGState()
}
@objc dynamic public class func drawPadlockError(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 80, height: 100), resizing: ResizingBehavior = .aspectFit, color: UIColor = IconsStyleKit.strokeColor, fillBackground: Bool = false) {
//// General Declarations
let context = UIGraphicsGetCurrentContext()!
//// Resize to Target Frame
context.saveGState()
let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 80, height: 100), target: targetFrame)
context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY)
context.scaleBy(x: resizedFrame.width / 80, y: resizedFrame.height / 100)
//// Color Declarations
let fillColor = color
//// Page-1
//// lock-error
//// Bezier Drawing
let bezierPath = UIBezierPath()
bezierPath.move(to: CGPoint(x: 71.46, y: 45.47))
bezierPath.addLine(to: CGPoint(x: 69.53, y: 45.47))
bezierPath.addLine(to: CGPoint(x: 69.53, y: 29.83))
bezierPath.addCurve(to: CGPoint(x: 40.43, y: 0.18), controlPoint1: CGPoint(x: 69.44, y: 10.63), controlPoint2: CGPoint(x: 56.34, y: 0.18))
bezierPath.addCurve(to: CGPoint(x: 10.76, y: 29.83), controlPoint1: CGPoint(x: 24.53, y: 0.18), controlPoint2: CGPoint(x: 10.27, y: 11.13))
bezierPath.addLine(to: CGPoint(x: 10.75, y: 45.45))
bezierPath.addCurve(to: CGPoint(x: 9.78, y: 45.47), controlPoint1: CGPoint(x: 10.75, y: 45.45), controlPoint2: CGPoint(x: 10.98, y: 45.47))
bezierPath.addCurve(to: CGPoint(x: 0.14, y: 54.41), controlPoint1: CGPoint(x: 8.51, y: 45.47), controlPoint2: CGPoint(x: 0.14, y: 46.95))
bezierPath.addLine(to: CGPoint(x: 0.14, y: 90.23))
bezierPath.addCurve(to: CGPoint(x: 9.78, y: 100.17), controlPoint1: CGPoint(x: 0.14, y: 98.19), controlPoint2: CGPoint(x: 9.57, y: 100.17))
bezierPath.addLine(to: CGPoint(x: 70.98, y: 100.17))
bezierPath.addCurve(to: CGPoint(x: 80.14, y: 90.23), controlPoint1: CGPoint(x: 71.2, y: 100.17), controlPoint2: CGPoint(x: 80.14, y: 99.18))
bezierPath.addLine(to: CGPoint(x: 80.14, y: 54.9))
bezierPath.addCurve(to: CGPoint(x: 71.46, y: 45.47), controlPoint1: CGPoint(x: 80.14, y: 46.45), controlPoint2: CGPoint(x: 71.68, y: 45.47))
bezierPath.addLine(to: CGPoint(x: 71.46, y: 45.47))
bezierPath.close()
bezierPath.move(to: CGPoint(x: 24.23, y: 30.03))
bezierPath.addCurve(to: CGPoint(x: 40.14, y: 12.13), controlPoint1: CGPoint(x: 24.23, y: 20.08), controlPoint2: CGPoint(x: 30.3, y: 12.13))
bezierPath.addCurve(to: CGPoint(x: 56.05, y: 30.03), controlPoint1: CGPoint(x: 49.88, y: 12.13), controlPoint2: CGPoint(x: 56.05, y: 19.09))
bezierPath.addLine(to: CGPoint(x: 56.06, y: 45.47))
bezierPath.addLine(to: CGPoint(x: 24.22, y: 45.47))
bezierPath.addLine(to: CGPoint(x: 24.23, y: 30.03))
bezierPath.addLine(to: CGPoint(x: 24.23, y: 30.03))
bezierPath.close()
bezierPath.move(to: CGPoint(x: 50.4, y: 90.87))
bezierPath.addLine(to: CGPoint(x: 39.46, y: 79.93))
bezierPath.addLine(to: CGPoint(x: 29.23, y: 90.36))
bezierPath.addLine(to: CGPoint(x: 22.64, y: 83.76))
bezierPath.addLine(to: CGPoint(x: 33.58, y: 72.82))
bezierPath.addLine(to: CGPoint(x: 23.34, y: 62.59))
bezierPath.addLine(to: CGPoint(x: 29.75, y: 56.11))
bezierPath.addLine(to: CGPoint(x: 40.7, y: 67.05))
bezierPath.addLine(to: CGPoint(x: 51.12, y: 56.71))
bezierPath.addLine(to: CGPoint(x: 57.64, y: 63.22))
bezierPath.addLine(to: CGPoint(x: 46.69, y: 74.17))
bezierPath.addLine(to: CGPoint(x: 57.01, y: 84.48))
bezierPath.addLine(to: CGPoint(x: 50.4, y: 90.87))
bezierPath.close()
bezierPath.usesEvenOddFillRule = true
fillColor.setFill()
bezierPath.fill()
context.restoreGState()
}
//// Generated Images
@objc open dynamic class var imageOfLetter: UIImage {
......@@ -532,6 +713,48 @@ open class IconsStyleKit: NSObject {
return Cache.imageOfLetterOpen!
}
@objc dynamic public class var imageOfPadlockSecure: UIImage {
if Cache.imageOfPadlockSecure != nil {
return Cache.imageOfPadlockSecure!
}
UIGraphicsBeginImageContextWithOptions(CGSize(width: 80, height: 100), false, 0)
IconsStyleKit.drawPadlockSecure()
Cache.imageOfPadlockSecure = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return Cache.imageOfPadlockSecure!
}
@objc dynamic public class var imageOfPadlockInsecure: UIImage {
if Cache.imageOfPadlockInsecure != nil {
return Cache.imageOfPadlockInsecure!
}
UIGraphicsBeginImageContextWithOptions(CGSize(width: 64, height: 80), false, 0)
IconsStyleKit.drawPadlockInsecure()
Cache.imageOfPadlockInsecure = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return Cache.imageOfPadlockInsecure!
}
@objc dynamic public class var imageOfPadlockError: UIImage {
if Cache.imageOfPadlockError != nil {
return Cache.imageOfPadlockError!
}
UIGraphicsBeginImageContextWithOptions(CGSize(width: 65, height: 81), false, 0)
IconsStyleKit.drawPadlockError()
Cache.imageOfPadlockError = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return Cache.imageOfPadlockError!
}
//// Customization Infrastructure
@IBOutlet dynamic var letterTargets: [AnyObject]! {
......@@ -574,6 +797,36 @@ open class IconsStyleKit: NSObject {
}
}
@objc @IBOutlet dynamic var padlockSecureTargets: [AnyObject]! {
get { return Cache.padlockSecureTargets }
set {
Cache.padlockSecureTargets = newValue
for target: AnyObject in newValue {
let _ = target.perform(NSSelectorFromString("setImage:"), with: IconsStyleKit.imageOfPadlockSecure)
}
}
}
@objc @IBOutlet dynamic var padlockInsecureTargets: [AnyObject]! {
get { return Cache.padlockInsecureTargets }
set {
Cache.padlockInsecureTargets = newValue
for target: AnyObject in newValue {
let _ = target.perform(NSSelectorFromString("setImage:"), with: IconsStyleKit.imageOfPadlockInsecure)
}
}
}
@objc @IBOutlet dynamic var padlockErrorTargets: [AnyObject]! {
get { return Cache.padlockErrorTargets }
set {
Cache.padlockErrorTargets = newValue
for target: AnyObject in newValue {
let _ = target.perform(NSSelectorFromString("setImage:"), with: IconsStyleKit.imageOfPadlockError)
}
}
}
@objc public enum ResizingBehavior: Int {
case aspectFit /// The content is proportionally resized to fit into the target rectangle.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment