Customizing the IOS Framework-ios Universal framework

Source: Internet
Author: User

Github:https://github.com/kstenerud/ios-universal-framework/blob/master/readme.md

Installation:
    1. Download the zip file first.
    2. Make sure you're in one place and easy to use later on. B/C project template, every time you update Xcode, you will need to reinstall the project template (Don't worry, the installation process is very fast).
    3. Make sure Xcode is completely off
    4. Unzip the zip file and go to the folder: Real framework/install.sh
    5. If you are familiar with the command terminal, just run install.sh. If you are unfamiliar, simply rename it to Install.sh.command and double-click to run it.
    6. When it starts running, it will ask you: where Xcode is installed. If you have not modified the default Xcode installation path, just enter confirm.
    7. Then it will ask you where it needs to be installed. Just hit Y and enter.
    8. Input password, enter
    9. Wait for installation to finish
Create an IOS Framework Project
  1. Start a new project. New Xcode Project

  2. selection in the Framework & library Static iOS framework (or Fake static iOS framework)

  3. It's best to check unit tests

  4. Add the auto-generated header file to the public sections of the Copy Headers Build phase (workaround for Xcode bug).

  5. Turn off Show environment variables in build log for both Run Script Build Phases (workaround for Xcode Bug).

  6. Add your classes, resources, etc with your framework as the target.

  7. header files that need to be used by other projects must be defined as public. In Build phases , expand Copy Headersand drag the desired header file to public.

  8. Any static libraries or static frameworks this you ' d like to has linked into your framework must is included in the L Ink Binary with Libraries build phase. Be careful doing this, however, as it can cause linker issues if the users of your framework also try to include the same Library in their project for other purposes.

Build the IOS Framework
    1. Select your framework ' s scheme, IOS Device target.

    2. Select Product -- Archive.

    3. When done, the Finder opens with two files *.framework and *.embeddedframework (probably not).

If the framework has no resources (such as images, scripts, xibs, core data momd files, etc.), you can use *.framework directly. If other resources are included, you need to use *.embeddedframework.

using the iOS Framework

IOS frameworks is basically the same as regular dynamic Mac OS X frameworks, except they is statically linked.

Use the same framework as your own, except that they are statically linked

Drag the *.framework or *.embeddedframework file to the project. Refer to the header file in the project using <>, do not use "".

For example, with framework "myframework":

#import <MyFramework/MyClass.h>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.