Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Commit

Permalink
ZXingObjC now works as a framework, and has a framework header
Browse files Browse the repository at this point in the history
ZXingObjC.h
  • Loading branch information
cwalcott committed Dec 2, 2012
1 parent f06a72f commit 54903db
Show file tree
Hide file tree
Showing 23 changed files with 4,613 additions and 4,157 deletions.
4 changes: 2 additions & 2 deletions .gitignore 100644 → 100755
Expand Up @@ -13,7 +13,7 @@ xcuserdata

# Build products
build/
*.[oa]
*.o
*.LinkFileList
*.hmap

Expand All @@ -22,4 +22,4 @@ build/
*.swp
*~
*.dat
*.dep
*.dep
34 changes: 24 additions & 10 deletions README.md
Expand Up @@ -88,17 +88,31 @@ To add ZXingObjC to your project:

1. [Download ZXingObjC](https://github.com/TheLevelUp/ZXingObjC/tarball/master) or clone it from git: `git clone git://github.com/TheLevelUp/ZXingObjC.git`.

2. There are two ways to add ZXingObjC to your project, either as a static library dependency, or adding the files directly to the project.
* As a static library:
1. First drag the ZXingObjC.xcodeproj file into Xcode. Make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project" before clicking "Add".
2. Next, you must add the static library itself as a dependency. You can do this by selecting your project in the left sidebar, select your target, and choose the "Build Phases" tab. Under "Target Dependencies", click the plus button, and then choose either ZXingObjC-iOS for an iOS app, or ZXingObjC-osx for a Mac app.
3. Now we need to tell XCode where to find the header files for ZXingObjC. While your target is still selected, choose the "Build Settings" tab. Look for "Header Search Paths" under "Search Paths", and add the relative path from your project's directory to the ZXingObjC folder.
* To add the files directly, just drag the ZXingObjC folder into Xcode. You may choose to copy the files into your project folder, or reference them from the downloaded location.

3. In the "Build Phases" tab, we need to add the following frameworks under "Link Binary With Libraries":
* ImageIO.framework
2. Drag the ZXingObjC.xcodeproj file into Xcode. Make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project" before clicking "Add".

3. Selecting your project in the left sidebar, select your target, and choose the "Build Phases" tab. Under "Target Dependencies", click the plus button, and then choose either ZXingObjC-iOS for an iOS app, or ZXingObjC-osx for a Mac app.

4. In the "Link Binary with Libraries" section, click the plus button and choose libZXingObjC-iOS.a for an iOS app, or libZXingObjC-osx.a for a Mac app.

5. Add the following frameworks under "Link Binary With Libraries":

For an iOS app:
* AVFoundation.framework
* CoreGraphics.framework
* If you added ZXingObjC as a static library, also add libZXingObjC-iOS.a (for iOS apps) or libZXingObjC-osx.a (for Mac apps)
* CoreVideo.framework
* ImageIO.framework

For a Mac app:
* ApplicationServices.framework
* CoreVideo.framework
* QuartzCore.framework
* QTKit.framework

6. Import the ZXingObjC framework header:

```obj-c
#import <ZXingObjC/ZXingObjC.h>
```

License
-------
Expand Down
8,099 changes: 4,198 additions & 3,901 deletions ZXingObjC.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions ZXingObjC/ZXBinarizer.h
Expand Up @@ -14,6 +14,12 @@
* limitations under the License.
*/

#if TARGET_OS_EMBEDDED || TARGET_IPHONE_SIMULATOR
#include <ImageIO/ImageIO.h>
#else
#import <QuartzCore/QuartzCore.h>
#endif

#import "ZXBitArray.h"
#import "ZXBitMatrix.h"
#import "ZXLuminanceSource.h"
Expand Down
1 change: 1 addition & 0 deletions ZXingObjC/ZXBinarizer.m
Expand Up @@ -17,6 +17,7 @@
#import "ZXBinarizer.h"

#if TARGET_OS_EMBEDDED || TARGET_IPHONE_SIMULATOR
#import <UIKit/UIKit.h>
#define ZXBlack [[UIColor blackColor] CGColor]
#define ZXWhite [[UIColor whiteColor] CGColor]
#else
Expand Down

0 comments on commit 54903db

Please sign in to comment.