CEF from Swift

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF from Swift

Postby jjconti » Wed Feb 25, 2015 12:02 pm

Hi, how can I use CEF from Apple Swift programming language? Swift can use classes written in objective-C.
jjconti
Newbie
 
Posts: 4
Joined: Wed Feb 25, 2015 12:00 pm

Re: CEF from Swift

Postby daka1 » Thu Feb 26, 2015 4:17 am

I guess so... but why :?:
daka1
Techie
 
Posts: 42
Joined: Fri Feb 20, 2015 4:49 am

Re: CEF from Swift

Postby jjconti » Thu Feb 26, 2015 6:03 am

daka1 wrote:I guess so... but why :?:


I'm writing an app in Swift and need and embedded browser. That's why.
jjconti
Newbie
 
Posts: 4
Joined: Wed Feb 25, 2015 12:00 pm

Re: CEF from Swift

Postby ed123 » Thu Feb 26, 2015 6:50 am

jjconti wrote:I'm writing an app in Swift and need and embedded browser. That's why.

Why don't you use WebView instead? Unless you need features that only exist in Chrome?
ed123
Newbie
 
Posts: 7
Joined: Sat Jul 26, 2014 5:29 pm

Re: CEF from Swift

Postby jjconti » Thu Feb 26, 2015 11:23 am

I want to have cookies not shared by all the OS. I want to be able to save them to a file an retrieve them in future runs of the programa. WebView can't do this. CEF does.

Is anyone going to give a answered instead of question the question?
jjconti
Newbie
 
Posts: 4
Joined: Wed Feb 25, 2015 12:00 pm

Re: CEF from Swift

Postby magreenblatt » Thu Feb 26, 2015 11:40 pm

jjconti wrote:I want to have cookies not shared by all the OS. I want to be able to save them to a file an retrieve them in future runs of the programa. WebView can't do this. CEF does.

Is anyone going to give a answered instead of question the question?

I don't think anyone has tried it yet. You can be the trail blazer :).
magreenblatt
Site Admin
 
Posts: 12406
Joined: Fri May 29, 2009 6:57 pm

Re: CEF from Swift

Postby derektran » Tue Mar 10, 2015 1:27 pm

Hey jjconti,

Have you had success with this yet? I'm in the same exact situation and need to use non WebKit functionality (WebRTC video). Chromium's CEFClient app seems to work with it. However, I don't know how to import this into a new Swift project. If you've figured it out, I'd appreciate the tips!
derektran
Newbie
 
Posts: 5
Joined: Tue Mar 10, 2015 1:24 pm

Re: CEF from Swift

Postby jjconti » Wed Mar 18, 2015 12:41 pm

No yet.
jjconti
Newbie
 
Posts: 4
Joined: Wed Feb 25, 2015 12:00 pm

Re: CEF from Swift

Postby tml » Thu Aug 13, 2015 5:37 pm

You may want to take a look at my Swift wrapper of CEF3: https://github.com/lvsti/CEF.swift

It's still incomplete, untested, and most likely unstable, but it may already work for toy projects, and it is under active development. It follows a different approach than most of the answers I've read in this forum: instead of wrapping C++ in ObjC and that in Swift, my framework wraps the CEF CAPI directly (which in fact wraps the CEF C++ core). The reason I chose this path was that I wanted to avoid the proliferation of @objc attributes all over the place in the Swift host app.

In this first phase, the plan is to have most of the API wrapped somehow (=for now, manually and mechanically). Later on, I'll try to generate as much of the glue code as possible, and will also rewrite the interface in a more Swift-y style (closures instead of one-method handlers, conformance of value types to various standard library protocols, etc.)

Feel free to submit issues and suggestions on github.
tml
Techie
 
Posts: 11
Joined: Thu Jul 31, 2014 7:55 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 33 guests