# How to easily embed a Store Locator in an Apple iOS app using Swift?

**URL:** <https://forum.woosmap.com/t/how-to-easily-embed-a-store-locator-in-an-apple-ios-app-using-swift/135>\
**Category:** Ask the community\
**Created:** [January 6, 2023, 2:38pm UTC](https://forum.woosmap.com/t/how-to-easily-embed-a-store-locator-in-an-apple-ios-app-using-swift/135 "2023-01-06T14:38:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Ruddock](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.woosmap.com/gary_ruddock/32/125_2.png) [@Gary\_Ruddock](https://forum.woosmap.com/u/Gary_Ruddock)\
**Post date:** [January 6, 2023, 2:38pm UTC](https://forum.woosmap.com/t/how-to-easily-embed-a-store-locator-in-an-apple-ios-app-using-swift/135/1 "2023-01-06T14:38:22Z")

</div>

I wanted to show how easy it is to use the Store Locator Widget, or any other webpage, from within a Swift app. It’s only a few lines of code to get the SLW up and running on iOS.

In the example below the app is loading the [Bose Store Locator Widget](https://developers.woosmap.com/products/widgets/store-locator-widget/sample-usage/#sample) from the documentation.

```auto
import SwiftUI
import WebKit

struct WebView: UIViewRepresentable{
    let url: URL?
    private let webView = WKWebView()
    
    func makeUIView(context: Context) -> some UIView {
        return webView
    }
    
    func updateUIView(_ uiView: UIViewType, context: Context) {
        guard let url = url else {
            return
        }
        webView.load(.init(url: url))
    }
}

struct ContentView: View {
    var body: some View {
        
        //Bose
        WebView(url: URL(string: "https://3icrvl.csb.app/"))
               
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

```

 ![Screenshot 2023-01-06 at 14.37.51](https://europe1.discourse-cdn.com/flex013/uploads/woosmap/original/1X/1415aab5b52b9d5adf7a9718ae9585e7bcc1f592.png)

---

<div class="post-metadata">

**Author:** ![Gary\_Ruddock](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.woosmap.com/gary_ruddock/32/125_2.png) [@Gary\_Ruddock](https://forum.woosmap.com/u/Gary_Ruddock)\
**Post date:** [January 6, 2023, 2:42pm UTC](https://forum.woosmap.com/t/how-to-easily-embed-a-store-locator-in-an-apple-ios-app-using-swift/135/2 "2023-01-06T14:42:37Z")

</div>

To get the SLW to fit properly within the iPhone I had to modify the meta tag in the html, thanks @gael

```auto
<meta
      name="viewport"
      content="width=device-width, 
      initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>

```
