Skip to content

Instantly share code, notes, and snippets.

@SocialKitLtd
Created August 10, 2019 18:01
Show Gist options
  • Save SocialKitLtd/96c655bb326e614db98a7b3be762f3d7 to your computer and use it in GitHub Desktop.
Save SocialKitLtd/96c655bb326e614db98a7b3be762f3d7 to your computer and use it in GitHub Desktop.
protocol CanvasItem: Codable
{
var scale: CGFloat { get set }
}
class StickerItem: CanvasItem
{
var scale: CGFloat = 0.0
var stickerName : String = ""
}
class ShapeItem: CanvasItem
{
var scale: CGFloat = 0.0
var colorHex = ""
}
class CanvasShapeView: UIView {
let shapeItem: ShapeItem
init(shapeItem: ShapeItem) {
self.shapeItem = shapeItem
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
class CanvasStickerView: UIView {
let stickerItem: StickerItem
init(stickerItem: StickerItem) {
self.stickerItem = stickerItem
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment