nicklockwood / Expression

A cross-platform Swift library for evaluating mathematical expressions at runtime
MIT License
829 stars 51 forks source link

Usage for macOS Apps (Swift 5.1/Xcode 11.2.1) #26

Closed AegerBorder closed 4 years ago

AegerBorder commented 4 years ago

Hi there,

this might be kinda awkward but I'm totally stuck here.

I wanted to try Expression for a little macOS App written in Swift 5 and Xcode 11. I have tried both just copying Expression.swift or installing as a framework by using cocoapods.

What am I doing wrong when Xcode keeps displaying

No such module 'Expression' ?

I have a totally naked project so no complex stuff in here - just a new project.

I saw in the Example folder that these were made for iOS (import UIKit, import Expression) and it works fine but there must be a(n awkward) thing I'm missing.

Sorry for this one. Just a beginner trying his best :-/

nicklockwood commented 4 years ago

If you're using CocoaPods that ought to work, and I'm not sure why it doesn't.

If you import it by just copying the file into your project then you don't need the import Expression statement because Expression will just be a class inside your project, and you can use it directly.

AegerBorder commented 4 years ago

Oh well... let's just say this is a beginner issue. I just tried to ignore the import thing and just type my desired code. Worked perfectly. So no "import Expression" needed here I guess.

AegerBorder commented 4 years ago

If you're using CocoaPods that ought to work, and I'm not sure why it doesn't.

If you import it by just copying the file into your project then you don't need the import Expression statement because Expression will just be a class inside your project, and you can use it directly.

Yep... found out just the second before. I'm closing this now. Thank you for your reply!