Created
April 6, 2022 22:04
-
-
Save outrowender/7696e9aeebae73f742c84c37756ed6d0 to your computer and use it in GitHub Desktop.
New UIView screen
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
// | |
// 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