This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shadow Layer | |
let shadowShape = CAShapeLayer() | |
shadowShape.path = bubblePath.cgPath | |
shadowShape.fillColor = fillColor.cgColor | |
shadowShape.shadowColor = shadowColor.cgColor | |
shadowShape.shadowOffset = CGSize(width: CGFloat(shadowOffsetX), height: CGFloat(shadowOffsetY)) | |
shadowShape.shadowRadius = CGFloat(shadowBlur) | |
shadowShape.shadowOpacity = 0.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define Bubble Shape | |
let bubblePath = UIBezierPath() | |
// Top left corner | |
bubblePath.move(to: topLeft(0, borderRadius)) | |
bubblePath.addCurve(to: topLeft(borderRadius, 0), controlPoint1: topLeft(0, borderRadius / 2), controlPoint2: topLeft(borderRadius / 2, 0)) | |
// Top right corner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBInspectable var arrowTopLeft: Bool = false | |
@IBInspectable var arrowTopCenter: Bool = true | |
@IBInspectable var arrowTopRight: Bool = false | |
@IBInspectable var arrowBottomLeft: Bool = false | |
@IBInspectable var arrowBottomCenter: Bool = false | |
@IBInspectable var arrowBottomRight: Bool = false | |
@IBInspectable var fillColor: UIColor = UIColor.white | |
@IBInspectable var borderColor: UIColor = UIColor(red:0, green:0, blue:0, alpha:0.05) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TooltipView.swift | |
// Customizable Tooltips | |
// | |
// Copyright © 2017 Simon Wuyts | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
NewerOlder