By clicking on the tab item the application closes

Asked

Viewed 32 times

0

I’m making an app that has a tab, in the first tab I put a webview, in the second a map, when I enter the app and click on the map item, the app closes, the error happens after I reference the map to Viewcontroller

log: 2018-09-11 17:21:54.849452-0300 Celebrate club[4169:1061368] Could not inset legal Attribution from corner 4 (lldb)

Viewcontroller:

import UIKit
import WebKit
import MapKit

class ViewController: UIViewController {
@IBOutlet weak var webview: WKWebView!

@IBOutlet weak var mapview: MKMapView!




override func viewDidLoad() {
    super.viewDidLoad()
    let url = URL(string: "http://google.com")
    let UrlRequest = URLRequest(url:url!)
    webview.load(UrlRequest) 

}




override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()

}

}

inserir a descrição da imagem aqui

  • use https://www.google.com instead of http or add the domain to the https://stackoverflow.com/questions/30731785/how-do-i-load-an-http-url-with-app-transport-security-enabled-in-ios-9 list and switch to low box let urlRequest = ...

1 answer

1

Maybe you haven’t connected the outlet in the Builder interface.

If you are going to use Locationmanager to pick up GPS positioning, you have to add permissions in the plist file as explained here at the beginning of the documentation: https://developer.apple.com/documentation/corelocation/choosing_the_authorization_level_for_location_services/requesting_always_authorization

Depending on what you want, you have to implement the delegate methods MKMapViewDelegate, start implementing class ViewController: UIViewController, MKMapViewDelegate {

Browser other questions tagged

You are not signed in. Login or sign up in order to post.