[아이폰 앱 개발] Creating A Simple Web View App For iOS

Introduction

 
Creating a web view mobile application is a basic and simple task for any developer who is doing it. The major motive of creating a web view the mobile application is because we already have a website with a perfect mobile view, but we need an application that helps us to view only the particular website, instead of a browser. This kind of application acts and works like a browser, but it displays only the particular website. In this article we will discuss creating a web view application for the IOS, using a swift programming language.
 

Xcode

 
For creating this application, I am going to use the Xcode IDE by Apple. Xcode helps you in different ways while creating an application. The basic and very important thing is it has a default simulator that helps you to simulate the app which you developed, without the help of any other software or any other device. By using that simulator, you can make a simulation of your application for many numbers of devices, which supports the operating system you have chosen. You can download the Xcode from apple’s app store which is available for free of cost. Apart from Xcode, you can also use different types of IDE’s which support swift programming language, but while doing like that the steps and execution procedure may vary, but there will be no changes in the code.
 

Creating an application

 
First, you need to open the Xcode IDE. In the appearing screen, you need to select Create a new Xcode project. 
 
Creating A Simple Web View App For iOS
 
On the next screen under the iOS tab select the app option and click next.
 
Creating A Simple Web View App For iOS
 
In the next screen you need to enter the name of the app you are developing and the team you are working with, then click Next.
 
Creating A Simple Web View App For iOS
 
Then you need to select the location where you are going to store the project then click create.
 
Creating A Simple Web View App For iOS
 
You can choose the version of iOS by clicking the drop-down box which is available under deployment info. Then you can type your code in ViewController.swift by clicking it. 
 
Creating A Simple Web View App For iOS
 
First we are going to import the UI kit and Web kit for the purpose of using the system UI and web configuration.
 
  1. import UIKit    
  2. import WebKit     
Creating A Simple Web View App For iOS
 
  1. import UIKit  
  2. import WebKit  
  3. class ViewController: UIViewController, WKUIDelegate {  
  4.     var webView: WKWebView!override func loadView() {  
  5.         let webConfiguration = WKWebViewConfiguration()  
  6.         webView = WKWebView(frame: .zero, configuration: webConfiguration)  
  7.         webView.uiDelegate = self  
  8.         view = webView  
  9.     }  
  10.     override func viewDidLoad() {  
  11.         super.viewDidLoad()  
  12.         let myURL = URL(string: "https://www.c-sharpcorner.com")  
  13.         let myRequest = URLRequest(url: myURL!)  
  14.         webView.load(myRequest)  
  15.     }  
  16. }   
After coding your project now, we are going to test the project. For that, we are going to use the default simulator. You can choose the device which you are going to simulate by clicking the drop-down box nearby the project name. Then you click the build button to start building the project.
 
Creating A Simple Web View App For iOS
 
Then the simulator opens automatically. Here I chose iPhone 11 and the screen of iPhone 11 is opening now. It displays the web content in the mobile application. 
 
Creating A Simple Web View App For iOS
 
Creating A Simple Web View App For iOS
 
You can also analyze the performance of the application by the given option in the Xcode. It displays the details of how much CPU the app is using and the memory used by the app and also the network used by the app. This gives you a clear idea of how your app is working.
 
Creating A Simple Web View App For iOS
 
There are a lot more options available in Xcode which I will explain in my upcoming articles.
 

Conclusion

 
This is one of the simplest ways of creating a mobile application. This may help some people to create their applications for their website. You may also create a web view app with customized buttons. I will explain those things in my upcoming articles. Thank You!

 

[출처] https://www.c-sharpcorner.com/article/creating-a-simple-web-view-app-for-ios/

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
16 [Etc IOS LIB] ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension file 졸리운_곰 2024.04.12 2
15 [아이폰 앱 개발] [iOS / Error] Failed to render and update auto layout... 에러 해결 file 졸리운_곰 2024.03.29 4
14 [mac c/c++] M1 맥북 vscode C/C++ 개발환경 세팅 file 졸리운_곰 2024.01.07 6
13 [apple IOS] 개발/iOS 기기없이 빌드 아카이브 생성하기 file 졸리운_곰 2023.10.01 2
12 [아이폰 앱 개발] [flutter 설치시] sudo gem install cocoapods 에러시 error 졸리운_곰 2023.04.09 7
11 [아이폰 앱 개발] [AppStore] 앱스토어에 앱 등록하는 방법을 모르겠다. file 졸리운_곰 2023.03.26 6
10 [아이폰 앱 개발] Swift) Localizing - 다국어 처리하기 file 졸리운_곰 2023.03.21 21
» [아이폰 앱 개발] Creating A Simple Web View App For iOS file 졸리운_곰 2023.03.21 3
8 [아이폰 앱 개발] Swift, Objective-C, C++ 같이 사용하기 file 졸리운_곰 2021.11.21 141
7 [swift ios] Inject JavaScript into WKWebView : webview에 javascript 삽입 졸리운_곰 2021.05.15 141
6 [SWIFT, IOS] [SWIFT] 웹뷰와 자바스크립트 연동 (Native <-> JavaScript 통신 방법) file 졸리운_곰 2021.05.14 35
5 [SWIFT, IOS] [SWIFT] WKWebview 쿠키, 세션, 로컬스토리지 등 웹 데이터 삭제 및 값 얻어오기 file 졸리운_곰 2021.05.14 289
4 Emscripten 가지고 놀기 1. (feat. CodeLite) file 졸리운_곰 2018.12.01 116
3 How To Make an App For Your Website In Less Than 30 Minutes file 졸리운_곰 2018.09.03 244
2 chartboost 란 : 앱의 광고 모듈으로써... file 졸리운_곰 2014.12.01 560
1 Objective - C 의 요약정리문서 - 박종암 저 file 졸리운_곰 2014.05.31 532
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED