Posts

Showing posts with the label iphone

Swift charts - x axis values not aligned with bars in Group bar chart

Swift charts - x axis values not aligned with bars in Group bar chart i have created the simple bar chart with the library from https://github.com/danielgindi/ios-charts still can't figure out how to aligned x axis values with grouped bars. I am using a separate class for value formatting and i have a general function for draw n number of grouped bar charts. func createGroupedBarChart(with data: ChartDataCollection) { let grpBarChartView = BarChartView() self.addSubview(grpBarChartView) self.addConstraintsWithFormat(format: "H:|-5-[v0]-5-|", views: grpBarChartView) self.addConstraintsWithFormat(format: "V:|-5-[v0]-5-|", views: grpBarChartView) grpBarChartView.noDataText = "You need to provide data for the chart." grpBarChartView.chartDescription?.text = data.chartDescription if let barGrpChartData = data.chartData as? [BarChartGrouped] { //legend let legend = grpBarChartView.legend legend.enabled...

Is there a way to ask user for Camera access after they have already denied it on iOS?

Is there a way to ask user for Camera access after they have already denied it on iOS? I am using this code, but unfortunately it doesn't work. After a user has denied camera access, I want to ask them for permission to use the camera again the next time they try to load it (in this case it's a barcode scanner using the camera view). I always get AVAuthorizationStatusDenied and then granted always automatically returns NO even though I ask for it again in code. AVAuthorizationStatusDenied granted NO Many of my users are e-mailing me saying "my screen is black when I try to barcode scan" and it's because they have denied camera access for some reason. I want to be able to prompt them again because most likely the denial was a mistake. Is there a possible way to do this? AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; if(authStatus == AVAuthorizationStatusAuthorized) { NSLog(@"%@...