meismyles / SwiftWebVC

A drop-in inline browser for your Swift iOS app.
MIT License
330 stars 117 forks source link

Crash on iOS11 #30

Closed igorkulman closed 6 years ago

igorkulman commented 6 years ago

On iOS11 showing the browser crashes in SwiftWebVC.swift in method updateToolbarItems() on

let refreshStopBarButtonItem: UIBarButtonItem = webView.isLoading ? stopBarButtonItem : refreshBarButtonItem

with Thread 1: EXC_BAD_ACCESS (code=2, address=0x604000286f90) when the browser is first opened.

meismyles commented 6 years ago

Thanks. Will take a look at this urgently this evening.

igorkulman commented 6 years ago

So it may not be a problem in your code. I tried your sample and it does not crash there, just in my app where I use the library as code. The problem started when upgrading the project to Swift 4 and XCode 9.

meismyles commented 6 years ago

Ah ok, so do you believe this is a Swift 4 issue with this library, or a Swift 4 issue related to your project individually?

igorkulman commented 6 years ago

I made a fork of your project, changed what I needed (ability to disable the share button sometimes) and added my fork to the project using Carthage, it works. It is kind of strange and probably related to the fact that my whole project is Swift 4.

meismyles commented 6 years ago

Ok thanks. I'll review this later and test on Swift 4 myself and see what the best option is.

bchrobot commented 6 years ago

I have been getting crash reports for this as well, but have not been able to reproduce locally. I am seeing it on iOS 9 and 10 in addition to the originally reported iOS 11.

Stack trace: SwiftWebVC.updateToolbarItems.txt