Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

placement of native iOS code in your ionic project & Code Error #48

Open
SWajahatAli opened this issue Mar 9, 2021 · 2 comments
Open

Comments

@SWajahatAli
Copy link

I need to as about the code structure. What is not mentioned in the example is that where to put your native iOS project.
Second when I have implemented the code in class I am getting this error
image

And more over my implementation at TS level in ionic is as follows:
image

@SWajahatAli
Copy link
Author

Kindly reply me asap. A Sample example with the code would be great. Note that I am not aware of Objective-C syntax.

@mfdeveloper
Copy link
Owner

mfdeveloper commented Mar 11, 2021

Hello @SWajahatAli, how are you doing?

First fo all, BE PATIENT. I understand that you probably have schedules in your job, and needs solves something like this fast, but sadly I'm not working with cordova projects anymore. I'm in others kind of jobs to implement new features and a master's degree to write a thesis. Thus, unfortunatelly I don't have time now to implement a full-documented example, sorry 😞
I've started an IONIC example on ionic-example, but I couldn't finish it because I had others things to do like a said.

About your problem, to try clarify what is happening for you, I would like suggest the subjects below:

Understand how a cordova projects works

I think that you are using IONIC (it's a great framework, I now), but to use and solve some problems in plugins like this here, is almost mandatory to you have a better comprenhension about how is the cordova projects structure.

How IOS/Android implements architectures

Is not required that you know anything about Objective-C, like you said, but is heavily important that you learn how is the "navigation" among native views. In this case, what is and how works a Storyboard => NavigationController => ViewController. For example, in your case the error: "Storyboard (null) was not found" is just because your Storyboard/ViewController called FixedImageCropViewController was not found in native generated project.

Where put your native views files?

For this, you can follow the similar guidelines to place cordova resources, like mentioned in ionic-example/resources. You could create a folder like native-views or anything else, and create a js cordova event script to intercept the build and copy your native screens to generated native IOS project. This project could have an generic implementation for this? Off course, but it's just because of this repository is open source!! Do that, and submit a pull request to me :)

Pay attention that: The folder platforms/ios is always generated when you execute commands like: ionic platform add/remove. Because of that, the approach mentioned above to copy the native view files everytime that you build/run your cordova project, is better. If you try mantain the patforms/ios in your git repository, you will have a lot of others problems

I hope that these explanations help you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants