Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Please update WKWebView instead of UIWebView #239

Open
maulik3107 opened this issue May 16, 2020 · 34 comments
Open

Please update WKWebView instead of UIWebView #239

maulik3107 opened this issue May 16, 2020 · 34 comments

Comments

@maulik3107
Copy link

WKWebView instead of UIWebView because apple reject app

Thanks,

Maulik Patel

@Borko4vp
Copy link

I have exact same problem with the UIWebView. Any info if this will be updated any time soon?

@maulik3107
Copy link
Author

My issue is solve remove pod in move below file in your project,
RichEditorView.zip

@gim-
Copy link

gim- commented May 21, 2020

This is a dead project. Is there an active fork for this or a library that can replace it easily?

@maulik3107
Copy link
Author

@gim- u right pod library is old but i update WKWebView code in this zip so it's working fine.

@gim-
Copy link

gim- commented May 21, 2020

@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

@ppamorim
Copy link

ppamorim commented May 25, 2020

@gim- https://github.com/T-Pro/RichEditorView

To use it:

pod 'RichEditorView', :git => 'https://github.com/T-Pro/RichEditorView.git', :branch => 'master'

@maulik3107
Copy link
Author

@ppamorim i have already used this library but in this pod UIWebView not updated so apple reject app

@ppamorim
Copy link

ppamorim commented May 27, 2020

@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.

@maulik3107
Copy link
Author

@ppamorim Thank u so much now it's working with above link.

@thiwankacs
Copy link

@ppamorim The toolbar not appearing. What is the reason.

@maulik3107
Copy link
Author

maulik3107 commented Jun 11, 2020

@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

@thiwankacs
Copy link

thiwankacs commented Jun 11, 2020

@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.

@maulik3107
Copy link
Author

@thiwankacs
Please firstly u update pod library from below link:

pod 'RichEditorView', :git => 'https://github.com/T-Pro/RichEditorView.git', :branch => 'master'

@thiwankacs
Copy link

@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.

@maulik3107
Copy link
Author

@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

@thiwankacs
Copy link

@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?.

@maulik3107
Copy link
Author

@thiwankacs
Your project open in xcode 11 then no issue
Please backup first & check

@thiwankacs
Copy link

thiwankacs commented Jun 12, 2020

@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.

IMG_0335

Here is the logs

Logs.pdf

@maulik3107
Copy link
Author

@thiwankacs
Screenshot 2020-06-12 at 10 49 34 AM

@thiwankacs
Copy link

@maulik3107
Class and Module also RichEditorView.

@thiwankacs
Copy link

thiwankacs commented Jun 12, 2020

@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.

IMG_0336

@maulik3107
Copy link
Author

@thiwankacs
Please check i uploaded demo
RichEditorview.zip

@thiwankacs
Copy link

@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.

RICHTEXT

sampleProject.zip

@maulik3107
Copy link
Author

@thiwankacs
i checked your code it's working fine!

Simulator Screen Shot - iPhone 11 Pro - 2020-06-12 at 16 45 58

@thiwankacs
Copy link

@maulik3107

Seriously. What is the iOS and Device You checked.

@maulik3107
Copy link
Author

@thiwankacs
i checked in simulator 13.3 os version

@thiwankacs
Copy link

@maulik3107

I checked devices with iOS 12.1 and 12.4. Is there any idea.

@agni601
Copy link

agni601 commented Jun 16, 2020

@maulik3107

I checked this thread and implemented also. working fine. but If I use this version, will apple approve my app?

@maulik3107
Copy link
Author

@agni601
Yes, sure apple will approved

@thiwankacs
Copy link

Any one have idea about networking toolbar in iOS 12.1 and 12.4.

@maulik3107
Copy link
Author

@thiwankacs
No

@agni601
Copy link

agni601 commented Jun 17, 2020

@maulik3107
is there any way to insert the image as a background image of the editor?

@maulik3107
Copy link
Author

@agni601 :
sorry, i don't know

@maulik3107
Copy link
Author

maulik3107 commented Jul 13, 2020

@gim- @ppamorim @Borko4vp @thiwankacs

any one have idea how send messages via Bluetooth using Swift. Please help

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

No branches or pull requests

6 participants