MWPhotoBrowser
MWPhotoBrowser copied to clipboard
Not using CocoaPods, how to install ?
i dont whant to use cocoapods, i like to install manually. How to install ? Because it have MANY ERRORS to build a app.
In the README.md, you could find two methods to install MWPhotoBrowser manually. Download the SDK then you will find it.
Adding to your project
Method 1: Use CocoaPods
CocoaPods is great. If you are using CocoaPods (and here's how to get started), simply add pod 'MWPhotoBrowser' to your podfile and run pod install. You're good to go! Here's an example podfile:
platform :ios, '7'
pod 'MWPhotoBrowser'
Method 2: Static Library
- Get the latest source from GitHub by either downloading as a zip file or by cloning the repository at
git://github.com/mwaterfall/MWPhotoBrowser.gitand store the code wherever you wish. - Right-click on the your project in the navigator, click "Add Files to 'Your Project'", and browse to and select "MWPhotoBrowser.xcodeproj"
- In your project's target settings, go to "Build Phases" -> "Link Binary With Libraries" and add
libMWPhotoBrowser.a. - Still in "Build Phases", drop down "Copy Bundle Resources" and drag the file
MWPhotoBrowser.bundlefrom the MWPhotoBrowser project into that list. This ensures your project will include the required graphics for the photo browser to work correctly. - In the target, select the "Build Settings" tab and ensure "Always Search User Paths" is set to YES, and "User Header Search Paths" is set to the recursive absolute or relative path that points to a directory under which the MWPhotoBrowser code is stored. In the file layout of the MWPhotoBrowser project, a simple ../** works as the demo project folder and MWPhotoBrowser project folder are adjacent to one another. Please let me know if you encounter any issue with this.
- Under "Build Phases / Link Binary With Libraries" add
MessageUI.framework,QuartzCore.framework,AssetsLibrary.frameworkandImageIO.frameworkto "Linked Frameworks and Libraries".
You should now be able to include MWPhotoBrowser.h into your project and start using it.
Setting these things up in Xcode can be a bit tricky so if you run into any problems you may wish to read through a few bits of information:
- Developing a Static Library and Incorporating It in Your Application
- Using Open Source Static Libraries in Xcode 4
- How to embed static library into Xcode 4 project
Method 3: Including Source Directly Into Your Project
Another method is to simply add the files to your Xcode project, copying them to your project's directory if required. Ensure that all the code within MWPhotoBrowser/Classes, MWPhotoBrowser/Libraries and the MWPhotoBrowser.bundle is included in your project.
Sorry, but this document doesnt exists, i look ALL downloadable file and nothing in README.md mention that steps. But, in your METHOD 3, i cant locate /libraries and .bundle. Very confuse this information in relation with the zip files...
I dont like pods methods of installation.
@jackloverde I'm sorry that I am using v1.41, not the latest one. The Readme.md was updated after v2.0.0. If you don't need any new feature, you could download v1.41 and install it following the above instruction. It's always working very well in my App. I have some key fix in my private branch, you could refer to it if you like.(It's under v1.41) https://github.com/jiangyancong/MWPhotoBrowser.git
If you want to use the latest one, what I suggest is manually installing first, then merge the latest source code. And you may need to update/install some library if the new version needed.
Thanks! This version works very well for my app!
Hi @jiangyancong , Can you please help me? I want to put the whole project in my project. How can I know what version do I have (I did some changes in the MWPhotoBrowser)? I addition I didn't understand par. 5 . Thanks !
@tehilata I am not sure how to check the version. But since you did some changes in MWPhotoBrowser, it's better to use the v1.41 which you can manually install. part 5 means you need to specify the project path in the "User Header Search Path".
To make method 2 of @jiangyancong's guide work, I also had to link with the MediaPlayer.framework and the libDACircularProgress.a, libMBProgressHUD.a, libSDWebImage.a libs. Also add either -all_load or -ObjC (either seems to work) to Other Linker Flags. The reason is outlined here.
I implemented both Methods 1 & 2 but not able to import the MWPhotoBrowser class in my code???
@jiangyancong Thanks !