Skip to content

I want to use return NSStrings for any progress values using SwiftUI but i need help. Can someone complete the following implementation ? #18

Description

@steve111MV

`
import Foundation
import UIKit
import SwiftUI
import ASProgressPopUpView

struct CrowdProgressBar: UIViewRepresentable {
typealias UIViewType = UIView
var progress: Float = 1.40

func makeUIView(context: UIViewRepresentableContext<CrowdProgressBar>) -> UIView {
    
    let view = UIView(frame: .zero)
    
    let progressView = ASProgressPopUpView()

    progressView.tintColor = UIColor.init(named: "colorAccent")
    progressView.popUpViewCornerRadius = 16
    progressView.setProgress(self.progress, animated: true)
    progressView.show(animated: true)
    
    
    progressView.translatesAutoresizingMaskIntoConstraints = false
     
    view.addSubview(progressView)
    
     
    NSLayoutConstraint.activate([
        progressView.widthAnchor.constraint(equalTo: view.widthAnchor),
        progressView.heightAnchor.constraint(equalTo: view.heightAnchor)
    ])
    
    return view
}

func updateUIView(_ uiView: UIView, context: UIViewRepresentableContext<CrowdProgressBar>) {
    
}

}
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions