d
Topic
mel Member
Posts:
1
11 months ago

Implement Shopify in iOS app written in Swift

I'm new to Shopify and am trying to add a feature to my iOS app (written in Swift) to sell products from a business partner's Shopify store. I've imported the framework into my app, but am now stuck as I know Swift but not Objective-C and all of the Shopify documentation is written in Objective-C... How to I get a basic store up and running?? Thanks in advance!

i
Replies
Brent Gulanowski Shopify Employee
Posts:
52
11 months ago

Hello,

There are some very good documents on the Apple developer site about interoperating between Swift and Objective-C.

Xcode automatically translates Objective-C interfaces into Swift syntax. If you option-command-click on the name of a Objective-C class in Swift code, it will show the Swift interface in the assistant pane.

All that said, you would be well-advised to learn to read Objective-C interfaces, since virtually all of iOS and macOS libraries are written in Objective-C.

In the mean time, the SDK includes a sample application written in Swift which should get you started. Have a look in the sample apps folder in the git repository.

nilanjan2306 Member
Posts:
2
10 days ago

Hello,

I  want to integrate shopify API into my project,which is written in objective c,Is there any usefull documents to integrate the API.

As I have downloaded your swift project,but getting error in the class graphQl.swift class.

Can you help me out,its urgent.

Thanks 
Nilanjan

Dima Bart Shopify Employee
Posts:
6
10 days ago

Nilanjan, v3.0 no longer support Objective-C. We recommend either migrating your application to Swift, or writing an Objective-C-compatible bridging layer in Swift.

nilanjan2306 Member
Posts:
2
8 days ago

Hi Dima,

I have downloaded the swift project from github,but getting error in graphql.swift class,is there any way to solve it.

another queries I have, by using which Api I will get my all catagories and sub-catagories.

Thanks,
Nilanjan

Dima Bart Shopify Employee
Posts:
6
8 days ago

The Buy SDK has a submodule dependency. Please follow the installation instructions to properly install and configure the SDK.

Please take a look at our case study for examples on how to use the SDK.