Open maulik3107 opened 4 years ago
I have exact same problem with the UIWebView. Any info if this will be updated any time soon?
My issue is solve remove pod in move below file in your project, RichEditorView.zip
This is a dead project. Is there an active fork for this or a library that can replace it easily?
@gim- u right pod library is old but i update WKWebView code in this zip so it's working fine.
@gim- u right pod library is old but i update WKWebView code in this zip so it's working fine.
It's ok as a temporary solution, but in a long term it's better to migrate to more up-to-date library that's being maintained properly
@gim- https://github.com/T-Pro/RichEditorView
To use it:
pod 'RichEditorView', :git => 'https://github.com/T-Pro/RichEditorView.git', :branch => 'master'
@ppamorim i have already used this library but in this pod UIWebView not updated so apple reject app
@maulik3107 How come this is possible? Please check this class: https://github.com/T-Pro/RichEditorView/blob/master/RichEditorView/Classes/RichEditorWebView.swift
I am using this very same library and Apple never rejected my app. Please check your app first.
@ppamorim Thank u so much now it's working with above link.
@ppamorim The toolbar not appearing. What is the reason.
@thiwankacs //Outlet @IBOutlet weak var viewEditor: RichEditorView! lazy var toolbar: RichEditorToolbar = { let toolbar = RichEditorToolbar(frame: CGRect(x: 0, y: 0, width: self.view.bounds.width, height: 44)) toolbar.options = RichEditorDefaultOption.all return toolbar }()
// Do In viewDidLoad
viewEditor.delegate = self
viewEditor.inputAccessoryView = toolbar
viewEditor.placeholder = "Type some text..."
toolbar.delegate = self
toolbar.editor = viewEditor
// We will create a custom action that clears all the input text when it is pressed
let item = RichEditorOptionItem(image: nil, title: "Clear") { toolbar in
toolbar.editor?.html = ""
}
var options = toolbar.options
options.append(item)
toolbar.options = options
@maulik3107
Here is the code I written
import UIKit import RichEditorView
class ViewController: UIViewController {
@IBOutlet weak var editorView: RichEditorView!
override func viewDidLoad() {
super.viewDidLoad()
let toolbar: RichEditorToolbar = {
let toolbar = RichEditorToolbar(frame: CGRect(x: 0, y: 0, width: self.view.bounds.width, height: 44))
toolbar.options = [RichEditorDefaultOption.undo, RichEditorDefaultOption.redo, RichEditorDefaultOption.bold, RichEditorDefaultOption.underline, RichEditorDefaultOption.italic, RichEditorDefaultOption.strike, RichEditorDefaultOption.orderedList, RichEditorDefaultOption.unorderedList, RichEditorDefaultOption.header(1), RichEditorDefaultOption.header(2), RichEditorDefaultOption.outdent, RichEditorDefaultOption.indent, RichEditorDefaultOption.link]
return toolbar
}()
editorView.delegate = self
editorView.inputAccessoryView = toolbar
editorView.placeholder = "placeholderText"
editorView.html = SimplifyaManager.shared.workingQuestion.note
toolbar.delegate = self
toolbar.editor = editorView
toolbar.editor?.layer.backgroundColor = UIColor.clear.cgColor
editorView.clipsToBounds = true
editorView.layer.masksToBounds = true
}
}
extension ViewController: RichEditorToolbarDelegate, RichEditorDelegate { func richEditorDidLoad(_ editor: RichEditorView) { editor.setEditorBackgroundColor(.white) editor.setEditorFontColor(.black) editor.setFontSize(14) }
func richEditorToolbarInsertLink(_ toolbar: RichEditorToolbar) {
/// some code
}
}
That code shows toolbar on UIWebView but not showing toolbar with WKWebView.
@thiwankacs Please firstly u update pod library from below link:
pod 'RichEditorView', :git => 'https://github.com/T-Pro/RichEditorView.git', :branch => 'master'
@maulik3107 Yep I updated pod to that link. First I removed the original RichEditorView and add T-Pro/RichEditorView. pod 'RichEditorView', :git => 'https://github.com/T-Pro/RichEditorView.git', :branch => 'master'
Actually toolbar not showing with WKWebView. Is There any new configs or some thing to do.
@thiwankacs There is no new configs, project target set minimum 11.0 & up can u plz check & Please remove all pod first & install new pod
@maulik3107 Yep I removed old pod and add T-Pro/RichEditorView. My minimum iOS version is 10.0. Is it a problem for new pod?.
@thiwankacs Your project open in xcode 11 then no issue Please backup first & check
@maulik3107
I changed my minimum iOS version to 11.0. And run on iPad which runs iOS 12.14. And my Xcode version is 11.3. But I'm unable to see toolbar.
Here is the logs
@thiwankacs
@maulik3107 Class and Module also RichEditorView.
@maulik3107
I created new project add freshly installed pod 'RichEditorView', :git => 'https://github.com/T-Pro/RichEditorView.git', :branch => 'master' and that is only pod I used in this. Target iOS version is 11.0
Then I added view to storyboard and add @IBOutlet weak var editorView: RichEditorView! Also the view class and module is RichEditorView
and here is the viewController
`import UIKit import RichEditorView
class ViewController: UIViewController, RichEditorToolbarDelegate, RichEditorDelegate {
@IBOutlet weak var editorView: RichEditorView!
lazy var toolbar: RichEditorToolbar = {
let toolbar = RichEditorToolbar(frame: CGRect(x: 0, y: 0, width: self.view.bounds.width, height: 44))
toolbar.options = RichEditorDefaultOption.all
return toolbar
}()
override func viewDidLoad() {
super.viewDidLoad()
editorView.delegate = self
editorView.inputAccessoryView = toolbar
editorView.placeholder = "Type some text..."
toolbar.delegate = self
toolbar.editor = editorView
}
func richEditorDidLoad(_ editor: RichEditorView) {
editor.setEditorBackgroundColor(.white)
editor.setEditorFontColor(.black)
editor.setFontSize(14)
}
func richEditorToolbarInsertLink(_ toolbar: RichEditorToolbar) {
}
}`
Here is the result still toolbar is missing. Please give me any idea.
@thiwankacs Please check i uploaded demo RichEditorview.zip
@maulik3107
First of all thanks for your valuable support. I run your code and still the same. And I'll attach my code. I'm asking about the section above the keyboard.
@thiwankacs i checked your code it's working fine!
@maulik3107
Seriously. What is the iOS and Device You checked.
@thiwankacs i checked in simulator 13.3 os version
@maulik3107
I checked devices with iOS 12.1 and 12.4. Is there any idea.
@maulik3107
I checked this thread and implemented also. working fine. but If I use this version, will apple approve my app?
@agni601 Yes, sure apple will approved
Any one have idea about networking toolbar in iOS 12.1 and 12.4.
@thiwankacs No
@maulik3107 is there any way to insert the image as a background image of the editor?
@agni601 : sorry, i don't know
@gim- @ppamorim @Borko4vp @thiwankacs
any one have idea how send messages via Bluetooth using Swift. Please help
WKWebView instead of UIWebView because apple reject app
Thanks,
Maulik Patel