Cordova
-
Swift를 사용해서 Cordova Custom Plugin 만들기 (2)iOS 2023. 5. 25. 17:39
Swift를 사용해서 Cordova Custom Plugin 만들기 (1)에 이어서 clobbers 요소에 대해서 알아보고, iOS 플랫폼의 native view를 띄워보겠습니다. 플러그인 프로젝트의 Swift 코드 @objc(presentModalView:) func presentModalView(_ command: CDVInvokedUrlCommand) { print("presentModalView: called.") let viewController = UIViewController() let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.text = "Hello world!" label.font = ...
-
Swift를 사용해서 Cordova Custom Plugin 만들기 (1)iOS 2023. 5. 25. 03:13
Cordova 프로젝트에서 iOS 플랫폼의 메서드를 호출하고, 문자열을 수신하여 출력하기 위해서 간단한 Cordova Custom Plugin을 만들어보겠습니다. 플러그인 컴포넌트를 만들어내기 위해서, plugman을 설치해야 합니다. plugman은 플러그인 생성과 구성 및 관리를 도와주는 command line tool입니다. $ npm install -g plugman Create plugin using plugman $ plugman create --name CordovaSamplePluginSwift --plugin_id com.yeolmok.samplepluginswift --plugin_version 0.0.1 create 메서드는 플러그인의 뼈대를 만들어주는 메서드입니다. plugin.xm..