AMSlideMenu creator suggest to add:
#define AMSlideMenuWithoutStoryboards
on project's pch.
I've tried this solution and definitely does not work.
As explained in this post, if you install AMSlideMenu with cocoapod, you have to define AMSlideMenuWithoutStoryboards
in .pch file of pod project.
This is a workaround is evil: each time you'll run pod update
you shall remember to manually add that line on AMSlideMenu .pch file.
My solution is add run script on project build phases that, in my case, is:
output=$(find .. -name "AMSlideMenu-prefix.pch")
source=${SRCROOT}/${PROJECT_NAME}/amSlideMenuConfig
log=${SRCROOT}/${PROJECT_NAME}/MyProject.log
echo -e "Configuring AMSlideMenu" > ${log}
echo -e "Reading configuration from: " "${source}" "\n" >> ${log}
echo "$(cat ${source})" > "${output}"
echo -e "Project configured. " >> ${log}
Where amSlideMenuConfig contains old definitions:
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
#define AMSlideMenuWithoutStoryboards
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
This script is executed each time you build project: in order to improve optimize the process, you can add any check you need inside script.