stevengharris / MarkupEditor

WYSIWYG editing for SwiftUI and UIKit apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MarkupEditorView problem

mediakon opened this issue · comments

Hello,

I have a problem with run Yours MarkupEditor

  1. I added Package from GitHub link end add to my project
  2. 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?

Zrzut ekranu 2022-08-31 o 13 44 10

Zrzut ekranu 2022-08-31 o 13 46 46

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.

Ok. I'm installed Yours framework to my custom project and build, but only built as on Mac catalyst (on iOS not working), after that when I run my project on iOS I got error (screen shot). Work fine on Mac.

Zrzut ekranu 2022-08-31 o 18 41 29

I check package dependencies in 2-3 hours..

once again thanks a lot for Yours work!

with package dependencies on iOS that same error look

Zrzut ekranu 2022-08-31 o 18 46 54

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