MarkupEditorView problem
mediakon opened this issue · comments
Hello,
I have a problem with run Yours MarkupEditor
- I added Package from GitHub link end add to my project
- add yours example code
import SwiftUI
import MarkupEditor
struct ContentView: View {
@State private var demoHtml: String = "<h1>Hello World</h1>"
var body: some View {
MarkupEditorView(html: $demoHtml)
}
}
and I get error
Cannot find 'MarkupEditorView' in scope
when I open I Package Dependencies tree with MarkupEditor 0.3.3 I does not see MarkupEditorView file. This is correct?
Thanks for help,
Piotr
Thanks for raising this issue. This is because the package references tagged versions, and the MarkupEditorView is only in main. You will need to clone the repo and build. Main should be in good shape except for some problems on touch devices I am still working on.
I didn't think about how the README, that now reflects content in main, would be incorrect for people using the package. I will push a new tag to fix the issue and will be more aware next time. Thanks.
Thank you for your reply,
Could You give me a hand and write how build your MarkupEditor as framework and add this to custom project? I try, but I have still problems, errors... etc... I always add packages via Dependency packages and it's work, but now I'm stuck ...
I just pushed a 0.4.0 release which should be through its tests and merged in another 10 minutes. Hopefully that will sort things out for you if you update the packages.
In the meantime, if you want to use the framework, what I do is work in an Xcode workspace that contains my project and the MarkupEditor project. Once you have both a workspace that contains your project and the MarkupEditor project, build the MarkupEditorFramework target in it. There is a MarkupEditorFramework target in the MarkupEditor project. You just need to select it and build, or if you run either of the demos, they will also build the framework. Then in your project's Target, you add the MarkupEditor.framework as a dependency in the Frameworks, Libraries, and EmbeddedContent section of the General tab in Xcode.
You can fix that locally by replacing the if #available(macCatalyst 15.0, *)
with if #available(iOS 15.0, macCatalyst 15.0, *)
. In case you haven't done that before this is a nice writeup about how to make package changes locally. I will fix it along with some other things at some point, but I'm hoping not to push a tag until Beta. I also need to add a test to make sure iOS builds from the package :)
Thanks for the tips.
Everything works fine ;)
This is fixed in #50