1

I am trying to import the DDMathParser framework into my Swift app. I tried following the installation instructions from the DDMathParser wiki, though it did not work:

DDMathParser is packaged as a Swift framework.

Add DDMathParser.xcodeproj to your workspace and link MathParser.framework into your app.

(Link: https://github.com/davedelong/DDMathParser/wiki/Installing)

Here's what I did:

  1. I dragged in the .xcodeproj file into my project (from Finder to Xcode), and the file shows up under my project in the sidebar.
  2. I went to my project settings and clicked the '+' under "Linked Frameworks and Libraries" and neither "MathParser.framework" or "DDMathParser.framework" are showing up in the list of available frameworks.
  3. I tried building my application after adding the xcodeproj, but the framework files are still not showing up.

What am I doing wrong, or how do I correctly install this framework?

(Using Xcode 7.2.1)

Community
  • 1
  • 1
autobahn
  • 115
  • 1
  • 10
  • Ensure you create an Xcode workspace for your project. – CouchDeveloper Mar 08 '16 at 18:46
  • I believe I have a workspace for my project, [does this look right](http://i.imgur.com/2J1dWkj.png)? – autobahn Mar 08 '16 at 18:56
  • It might. If you have a workspace, and there is a framework project within it, you should be able to add it via: in the target editor, select your app target, click Tab "Build Phases", open section "Link Binary With Libraries" and click the (+) button ("Add Items"). Then a sheet should roll down with a file selection dialog, also showing a "Workspace" virtual folder. In this "Workspace" folder, there should be your third party framework. – CouchDeveloper Mar 08 '16 at 19:03
  • Thanks for the help. I followed your steps [and I got to this point](http://i.imgur.com/2zXNyZW.png), where the action sheet rolls down, but there is no "Workspace folder", just the standard OS X folder and the Developer Frameworks folder. I am wondering whether the issue might be the fact that the downloaded source files (from DDMathParser) do not contain any ".framework" files.. perhaps I must build them first somehow in order to generate the .framework file? – autobahn Mar 08 '16 at 19:18
  • It seems, you don't have a workspace yet. A workspace bundle has the extension `. xcworkspace`. The workspace bundle is oftentimes located in the same folder where the main projects file (`.xcodeproj`) resides. – CouchDeveloper Mar 08 '16 at 20:46
  • Hmm, I am able to build my app and interact with it (without the 3rd-party framework), so I would assume all the necessary "built-in" files and folders should all be there. Am I supposed to add a .xcworkspace bundle manually somehow? [Here is the contents of my project folder.](http://i.imgur.com/xp0lE4I.png) – autobahn Mar 08 '16 at 21:01

3 Answers3

0

Navigate to your project using the "Terminal app" once at the root folder type pod init a Podfile will be created you can open it with nano Podfile and add these changes with updated paths to your specific project.

source 'https://github.com/CocoaPods/Specs.git'
xcodeproj 'YOURPROJECT.xcodeproj'
platform :ios, '9.0'
use_frameworks!

pod 'DDMathParser'

Then save your file.

type pod install and hit enter.

Now open your new .xcworkspace that was created. In any file that you want to use the DDMathParser framework just add import DDMathParser to the top of your file.

Dan Leonard
  • 3,325
  • 1
  • 20
  • 32
0

1) $ sudo gem install cocoapods (gem will get installed in Ruby inside System library)

2) create a xcode project

3) Open terminal

4) cd "path to your project root directory"

5) pod init

6) open -e podfile (podfile will get open in text mode. Initially it will be emppty put the follwoing line of code.)

7) pod 'DDMathParser' (Cocoapods Podfile name ) // This is example

8) pod install

CocoaPods 0.36 and above will support for swift

bAthi
  • 341
  • 4
  • 20
0

Try the following as it helped me a lot of times:

  1. Create a workspace eg. I named it Beacon
  2. Create a project in it e.g. I create a project named BeaconDemo
  3. Create a Podfile in the folder where you created the workspace
  4. The contents of Podfile :

    workspace 'Beacon'

    xcodeproj 'BeaconDemo/BeaconDemo.xcodeproj'

    platform :ios, '8.0'

    use_frameworks!

    pod 'NearbyMessages', '~> 0.9'

    pod 'EstimoteSDK', '~> 3.8'

    pod 'Charts', '~> 2.2'

    pod 'GoogleMobileAds', '~> 7.6'

  5. Open terminal and go to your workspace

  6. Hit pod install
  7. Then open the workspace that you have created e.g. over here as in step 1
Bhagyalaxmi Poojary
  • 1,213
  • 1
  • 12
  • 17