2016-12-15 3 views
0

저는 iOS에서 새롭고 내 프로젝트에 PNChart라는 프레임 워크 호출을 구현하려고합니다. 원 차트를 하나씩 증분하고 싶지만 UI가 업데이트되지 않습니다. 도와주세요. 함수의 increaseCircle에서버튼을 누를 때마다 PNCircle 차트가 업데이트되지 않습니다.

import UIKit 
import PNChart 

class ViewController: UIViewController { 

    //global var 
    let number = NSNumber(value: 70) 

    //obj outlet 
    @IBOutlet weak var circleChart: PNCircleChart! 

    override func viewDidLoad() { 
     super.viewDidLoad() 
    } 

    override func viewWillAppear(_ animated: Bool) { 

     let myCgrect = CGRect(
      x: self.view.bounds.width/2 - 40, 
      y: self.view.bounds.height/2 - 40, 
      width: 100, height: 100) 

     let circleChart = PNCircleChart(
      frame: myCgrect, total: Int(100) as NSNumber!, 
      current: number, clockwise: false, 
      shadow: false, shadowColor: UIColor.red) 

     circleChart?.backgroundColor = UIColor.clear 
     circleChart?.strokeColor = UIColor.blue 
     circleChart?.stroke() 

     self.view.addSubview(circleChart!) 
    } 

    @IBAction func increaseCircle(_ sender: Any) { 
     _ = NSNumber(value: number.intValue + 1) 
     print("btnpressed") 
    } 
}// end uiviewcontroller 

답변

0

Circle chart screenshot

당신은 정보와 아무것도하지 않습니다. 이 증가 된 숫자를 circleChart에 입력하고 다시 그려야합니다. 당신이 Gindi의 라이브러리를 커스터마이징하기 때문에 당신은 아마도 이것을하기위한 당신 자신의 함수를 가질 것입니다.

+0

정말 고마워요. 이제 말이 되네요. –

관련 문제