Self.layer =[Cashapelayer layer]; Self.layer.frame= CGRectMake (0,0, -, -); Self.layer.position=Self.view.center; Self.layer.lineWidth=10.0; Self.layer.fillColor=[Uicolor Clearcolor]. Cgcolor; Self.layer.strokeColor=[Uicolor Lightgraycolor]. Cgcolor; Self.layer.lineCap=Kcalinecapsquare; /*ca_extern nsstring *const kcalinecapbutt __osx_available_starting (__mac_10_6, __iphone_3_0); Ca_extern nsstring *const kcalinecapround __osx_available_starting (__mac_10_6, __iphone_3_0); Ca_extern nsstring *const Kcalinecapsquare*/Uibezierpath*path = [Uibezierpath bezierpathwithovalinrect:cgrectmake (0,0, -, -)]; Self.layer.path=path. Cgpath; [Self.view.layer AddSublayer:self.layer]; Self.layer.strokeEnd=0.0; _progress=0; Self.timer= [Nstimer scheduledtimerwithtimeinterval:0.1target:self selector: @selector (updateprogress) Userinfo:nil Repeats:yes];//Update download Progress_progress + =0.01; if(Self.layer.strokeEnd >=1) {self.timer.fireDate=[NSDate distantfuture]; } Else{self.layer.strokeEnd=_progress; }
iOS Hollow Circle Download Progress indicator control