ChartsOrg / ChartsOrg/Charts

MacCatalyst and iPad on ChartsDemo-iOS sample

Open
#4,453 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

I've updated both the Obj C and Swift projects to support iPad and MacOS (for Catalyst support)

I'm able to compile and run the app on iOS simulator

### **For Mac Catalyst:** - Not able to compile nor run
The Compile Sources and Copy Bundle Resources - platforms become iOS+ MacOS for each of the refences
- Note that Charts.framework is Platform: iOS
The error, I get on compile is:

**For the ChartsDemo-iOS-Swift Scheme:**
Build input file cannot be found: '/Users//Library/Developer/Xcode/DerivedData/Charts-/Build/Products/Debug-maccatalyst/ChartsDemo-iOS.app/Contents/MacOS/ChartsDemo-iOS'
/Users//Mobility/BVPro.iOS/Carthage/Checkouts/Charts/ChartsDemo-iOS/Swift/Demos/LineChartTimeViewController.swift:12:8: No such module 'Charts'

**For the ChartsDemo-iOS Scheme**
/Users//Mobility/BVPro.iOS/Carthage/Checkouts/Charts/ChartsDemo-iOS/Objective-C/Formatters/LargeValueFormatter.swift:8:8: No such module 'Charts'

**Using Platform of iOS, I get the following error:**
Build input file cannot be found: '/Users//Library/Developer/Xcode/DerivedData/Charts-crbhclseeqfgjogasjyonlgvvmms/Build/Products/Debug-maccatalyst/ChartsDemo-iOS-Swift.app/Contents/MacOS/ChartsDemo-iOS-Swift'

### **Alternative Attempt **

I create a basic app that just displays a graph.
iPad and Mac enabled with only iOS as the platform.
I'm able to compile and run the app with iOS simulator, but I get the following error for MacOS:
_Details_

_The file “cht” couldn’t be opened because you don’t have permission to view it.
Domain: NSCocoaErrorDomain
Code: 257
Failure Reason: You don’t have permission.
Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > Get Info.
User Info: {
NSFilePath = "/Users/10009308a/Library/Developer/Xcode/DerivedData/cht-haxolxrnhqdjtlgrvobrqtclkbme/Build/Products/Debug-maccatalyst/cht.app";
}
--
The operation couldn’t be completed. Permission denied
Domain: NSPOSIXErrorDomain
Code: 13
Failure Reason: Permission denied
--

System Information

macOS Version 10.15.6 (Build 19G2021)
Xcode 11.6 (16141)_

For an existing Objc app, I get the same error as above, there are no issues with execute permissions

## Demo Code for basic App:
**Create a new Objective C app with single view controller, replace the code on ViewController.cs with the following and also reference the iOS reference for the Charts.framework :**
_#import "ViewController.h"

@interface ViewController ()
{
BarChartView *chartView;


}
@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
chartView = [[BarChartView alloc] init];
[chartView setBackgroundColor:[UIColor systemBlueColor]];
[[self view] addSubview:chartView];
[chartView setCenter:[[self view] center]];

CGRect newFrame = self.view.frame;

//newFrame.size.width = 200;
newFrame.size.height = 200;
[chartView setFrame:newFrame];

//[chartView setWid]
[self setData];
}

- (void) setData
{
NSArray *yValues = [NSArray arrayWithObjects: [[BarChartDataEntry alloc] initWithX:0.0 y: 10.0],
[[BarChartDataEntry alloc] initWithX:1.0 y: 5.0], nil];

BarChartDataSet *set1 = [[BarChartDataSet alloc]initWithEntries:yValues label:@"Subscribers"];
chartView.data = [[BarChartData alloc]initWithDataSet:set1];
}_

Contributor guide

Open the contributing guide

Research direction

Reproduce the ChartsDemo-iOS Swift and Objective-C schemes in Xcode 11.6 on macOS 10.15.6, starting with the reported No such module: Charts errors in LineChartTimeViewController.swift and LargeValueFormatter.swift. Inspect the Charts.framework platform setting and the demo targets, then verify that the schemes and the basic Objective-C app build and run on both iOS and Mac Catalyst.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c, swift
Domain
build-system, desktop-dev, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.