mdznr / MTZRadialMenu

A radial menu for iOS, like the one introduced in Messages for iOS 8.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash On iOS 7

ahmedOmran opened this issue · comments

just you have to replace this method "+ (UIImage *)resourceNamed:(NSString *)name" with the following one in the "MTZRadialMenu.m" file

  • (UIImage *)resourceNamed:(NSString *)name
    {
    NSBundle *MTZRadialMenuBundle = [NSBundle bundleForClass:[MTZRadialMenu class]];

    if (SYSTEM_VERSION_LESS_THAN(@"8.0")) {
    NSString *filePath = [MTZRadialMenuBundle pathForResource:name ofType:@"png"];
    UIImage *image = [UIImage imageWithContentsOfFile:filePath];
    return image;
    }

    return [UIImage imageNamed:name inBundle:MTZRadialMenuBundle compatibleWithTraitCollection:nil];
    }

also add this macro

#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)

Thanks for the recommendation. Feel free to fork the project and create a pull request.
Note that this project does not currently officially support iOS 7.
However, I'll update this method so that it can be called pre-iOS 8. The best way to work around using this method in iOS 8 is not to explicitly checking the version number, but checking if the class responds to the selector (which just so happens to first be implemented in iOS 8).

Can you verify this has been resolved in this commit?:
74a7459