MWPhotoBrowser icon indicating copy to clipboard operation
MWPhotoBrowser copied to clipboard

Not using CocoaPods, how to install ?

Open loverde-co opened this issue 10 years ago • 9 comments

i dont whant to use cocoapods, i like to install manually. How to install ? Because it have MANY ERRORS to build a app.

loverde-co avatar Aug 05 '15 19:08 loverde-co

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

  1. Get the latest source from GitHub by either downloading as a zip file or by cloning the repository at git://github.com/mwaterfall/MWPhotoBrowser.git and store the code wherever you wish.
  2. Right-click on the your project in the navigator, click "Add Files to 'Your Project'", and browse to and select "MWPhotoBrowser.xcodeproj"
  3. In your project's target settings, go to "Build Phases" -> "Link Binary With Libraries" and add libMWPhotoBrowser.a.
  4. Still in "Build Phases", drop down "Copy Bundle Resources" and drag the file MWPhotoBrowser.bundle from the MWPhotoBrowser project into that list. This ensures your project will include the required graphics for the photo browser to work correctly.
  5. 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.
  6. Under "Build Phases / Link Binary With Libraries" add MessageUI.framework, QuartzCore.framework, AssetsLibrary.framework and ImageIO.framework to "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:

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.

jiangyancong avatar Aug 08 '15 10:08 jiangyancong

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.

loverde-co avatar Aug 10 '15 20:08 loverde-co

@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.

jiangyancong avatar Aug 12 '15 05:08 jiangyancong

Thanks! This version works very well for my app!

loverde-co avatar Aug 13 '15 17:08 loverde-co

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 avatar Sep 29 '15 14:09 tehilata

@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".

jiangyancong avatar Sep 30 '15 03:09 jiangyancong

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.

themightyoarfish avatar Mar 05 '16 19:03 themightyoarfish

I implemented both Methods 1 & 2 but not able to import the MWPhotoBrowser class in my code???

gagancdac avatar Nov 20 '18 05:11 gagancdac

@jiangyancong Thanks !

tehilata avatar Nov 20 '18 11:11 tehilata