简体   繁体   中英

Use UIKit with Vapor or Kitura

I have developed an iOS App and would like to create a web API with some parts of my code. This API will send an UIImage generated from a UIView. The problem I have with Vapor is that I only managed to use AppKit, not UIKit. Certainly because the Xcode project with Vapor is a MacOS project. Is there a way to use UIKit or iOS Swift code with Vapor or any other solutions like Kitura ???

Thanks for your help :)

Regards,

If you want your Backend API Server (Vapor or Kitura) to run in a hosted environment, it will need to be able to run on Linux - where only Foundation is supported.

You can still transfer UIImages between iOS app and server, but you'll need to convert the UIImage to Data first (using something like UIImage.jpegData() )

You can see an example of this in the "FoodTrackerBackend" tutorial for Kitura here: https://github.com/IBM/FoodTrackerBackend

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM