Skip to content

Instantly share code, notes, and snippets.

@outrowender
Created April 6, 2022 22:04
Show Gist options
  • Save outrowender/7696e9aeebae73f742c84c37756ed6d0 to your computer and use it in GitHub Desktop.
Save outrowender/7696e9aeebae73f742c84c37756ed6d0 to your computer and use it in GitHub Desktop.
New UIView screen
//
// RatingStarsUIView.swift
// ShoeStore Swift ViewCode
//
// Created by Wender Patrick on 06/04/22.
//
import UIKit
protocol RatingStarsUIViewProtocol: AnyObject {
func starTappedAction()
}
class RatingStarsUIView: UIView {
private weak var delegate: RatingStarsUIViewProtocol?
func delegate(with delegate: RatingStarsUIViewProtocol?){
self.delegate = delegate
}
init(frame: CGRect, rating: Int){
super.init(frame: frame)
configSuperView()
configConstraints()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func configSuperView(){
self.backgroundColor = .systemBackground
//self.addSubview(backButton)
}
func configConstraints(){
NSLayoutConstraint.activate([
])
}
}
import SwiftUI
import UIViewCanvas
struct RatingStarsUIView_Preview: PreviewProvider {
static var previews: some View {
Group {
ViewCanvas(for: RatingStarsUIView(frame: .zero, rating: 4))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment