Some hello, world! code to call your Swift functions.Product module name you found above – this has nothing to do with the #import (or replace Quicksilver with the.Functions to be called from ObjC should be marked with Back in Code-App, add to main.m:.Select yes regarding automatic generation of the header bridge file.Create a new Swift File (name doesn’t seem to matter).Open the Code-App folder in the file navigator.Note that the Product Module Name is Quicksilver in the project settings.Under a more modern version of Swift (5.4). There were a fewīumps along the way, especially since I’m not proficient with Xcode or ObjC, soĪgain, note that this is almost exactly as documented here, and I’veĬopied the example code from there with minimal changes, just enough to run It ended up not being terribly difficult, mostly thanks to thisīlog post and the StackOverflow thread it links to. Today I decided to see if I could get a Swift “hello world” working in So far I don’t care for it as muchĪs Rust, but I’ve read that it can be integrated into existing ObjC projects, Lately, I’ve been picking up a little Swift. Know any Objective C, and honestly I’m not terribly interested in learning I’ve often wished that I could contribute to Quicksilver, probably myĪll-time favorite app, but unfortunately it’s written in Objective C. Bottom Line: This is a quick example of calling Swift from an Objective C
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |