Use UIKit with Vapor or Kitura - swift

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

Related

Upload multiple images to FTP server in iOS

I'm developing an application in swift 4. In it, I want to upload multiple images to FTP server. I have tried to do with https://github.com/Constantine-Fry/rebekka but could not build getting error saying
Xcode 9 does not support building or migrating Swift 2.x targets.
Also tried with https://gist.github.com/Nirma/fb9991be776107d17fdcd6ed2aa02876 . But some of the APIs are deprecated. Apple sample project is in objective C. Can anybody please help me to go forward in this case?
I've implemented FilesProvider library to abstract FTP/FTPS, WebDAV, Dropbox and OneDrive and providing a high level, FileManager like API to deal with these.
You can use FilesProvider library to deal with FTP. It doesn't use deprecated CFWriteStreamCreateWithFTPURL API and implements FTP protocol from scratch.
Please read Readme before using. You can see a sample implementation for iOS here.

Use Swift vapor inside a macOS app

I am not quite sure if this work - so that why I am asking this question:
I have a macOS app based on Swift that is used as a specialized CRM application.
My client wants to use the app on different machines but the data should be fetched from one Mac.
My consideration was to use one app as "server" and the other apps as clients connecting to this server.
Can I use vapor inside an app for macOS for such a scenario?
Can it be used as a library?
I have seen that vapor comes with its own stack of environment - is it compatible to be used inside a macOS app?
Cheers
Sas
Yes. Vapor runs correctly on macOS. There is nothing to stop you 'embedding' Vapor inside another Mac app.
Possible points of concern:
you will need to use the Swift package manager to install Vapor and its packages.
there are other, existing, light weight HTTP servers such as Swifter that may better fit your needs.
But yes, you can use Vapor if you want.

PHP REST Service Consumption in iOS 8 Swift

I've seen RESTKit and Mantle in Github. They are designed in Objective-C. Objective-C is OK with the Swift. But I like to know about a framework provided by Apple or any third-party written in Swift itself for REST Service(GET/POST/PUT/DELETE) consumption.
Take a look into Agent -- Minimalistic Swift HTTP request agent for iOS and OS X https://github.com/hallas/agent
Inside there is a Agent.swift https://github.com/hallas/agent/blob/master/Agent/Agent.swift where you can find how GET/POST/PUT/DELETE works
Also take a look on Alamofire from creators of AFNetwork https://github.com/Alamofire/Alamofire

Implementing Cocoa XML-RPC framework for iphone

I have my drupal xml-rpc service setup, and now I want to retrieve content for my iphone app.
I'm attempting to use https://github.com/eczarny/xmlrpc, however I dont know where to begin. How do I add the project to my own project for use? I've added a static library before; is it the same process? Just drag the proj file to my project and add the xml-rpc library?
Any tips would be appreciated.
Try dragging the project file for xmlrpc framework into the code list in XCode for starters. Next make the framework target in the xmlrpc framework a build dependency. Finally add the xmlrpc.framework to your linked frameworks. Exactly how you do this depends on whether you are using XCode 3 or 4

error when AppKit framework added in iphone application

i want to import in my iphone application, but i know this framework is not available in iphone sdk,but i need to use NSfileWrapper class in this framework, is this class also available in UIKit or others framework available in iphone sdk, thanks
No, NSFileWrapper is not available on the iPhone. Simply adding a framework that doesn't exist on the iPhone also won't get you anything. Your application is very limited on the iPhone with regards to accessing files and you basically have to use the classes and methods provided by the Foundation framework for the iPhone.