codelover
codelover

Reputation: 1139

Framework procedure to create private framework with internal Pods for different 3rd party library used

I am developing a private framework to source to our clients for their project so they can just drag and drop in their project and start using.

To avoid unwanted library imports references paths set and Add to build settings work, I referred that Building the framework to organise deliverables is much better solution which can cater for the Watch OS, IPods, Ipad,IPhones all in one.

I wanted to create a universal framework with pods used by the other 3rd party. Can any one please guide me through the process how I can achieve this with making it compact in size and delivered with no source code exposed except my interface files only.

Structure expected.

MYCustomFramework

Then I want to add this framework to My Test project which will have the Pods of its self

MyTestProject.xcworkspace MyTestProject.xcproj MYCustomFramework.framework -- This will have all the below bracket stuff compiled inside so no source exposed except interfaces. {

How to achieve this and make it with less size as possible.

Upvotes: 1

Views: 1573

Answers (2)

codelover
codelover

Reputation: 1139

After various trials I finally made this work in following manner.

1) Pods (Test Project released) cannot have Pods for the library with many third parties. 2 Workspace conflict and which one to use would be tedious.

2) Create a test project and implemented Pods for this test project and opened it using workspace.

3) Use the XMPP Framework library and extracted folders and headers without Pods.

4) Create a Cocoa-touch Framework and dragged this XMPPFramework folder without using Pods.

5) Similarly used manual process to integrate other libraries in My Cocoa-Touch Framework

6) Compiled My Framework and generated the mycustomframework.framework for (Device & Simulator)

7) Optionally I can use LIPO now to make the aggregated target to make sure all the XMPP and other 3rd party libraries headers are private inside my framework and only my exposed public header files are available for test project integration.

8) Worked out to run my test project either by just dragging the compiled '.framework' file or dragging library project inside my test project so can debug my library code as well.

Upvotes: 1

David Yang Liu
David Yang Liu

Reputation: 1170

try this guide, you have to add your spec repo to pods repos as well https://guides.cocoapods.org/making/private-cocoapods.html

EDITED:

We have a internally wrapped Fabric POD which just delivers the Fabric.framework we get from Fabric (this was before Fabric had a public pod) here is our pod spec. So in your repo you can build a .framework and deliver it the same way were wrapping Fabric

Hope this help

{
  "name": "InternalFabric",
  "version": "1.1.1",
  "summary": "Fabric is a 3rd party library that gives us crash analytics.",
  "homepage": "https://github.com/myNameHere",
  "authors": "myNameHere",
  "license": {
    "type": "Copyright",
    "text": "\n Copyright Acme Inc. 2014\n For internal Acme use only. \n"
     },  
  "platforms": {
    "ios": "7.0"
  },
  "source": {
    "git": "https://github.com/ios-yourLibs/Fabric.git"
  },
  "requires_arc": true,
  "default_subspecs": "Core",
  "subspecs": [
      {
        "name": "Core",
        "vendored_frameworks": ["Fabric.framework","Crashlytics.framework"]
      },
      {
        "name": "Crashlytics",
        "dependencies": {
          "Fabric/Core": [

          ]
        },
        "vendored_frameworks": "Crashlytics.framework"
      }
  ]
}

Upvotes: 0

Related Questions