Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions LGHelper/LGHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
#define kDeviceIsPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define kDeviceIsPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

#define kiPhone5ScreenWidth 320
#define kiPhone5ScreenHeight 568
#define kiPhone6ScreenWidth 375
#define kiPhone6ScreenHeight 667
#define kiPhone6PlusScreenWidth 414
#define kiPhone6PlusScreenHeight 736

#define kDeviceIsPhoneSmallerOrEqual35 (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && MAX(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height) <= 480.0)
#define kDeviceIsPhoneSmallerOrEqual40 (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && MAX(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height) <= 568.0)
#define kDeviceIsPhoneSmallerOrEqual47 (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && MAX(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height) <= 667.0)
Expand Down Expand Up @@ -183,7 +190,7 @@ else { dispatch_async(dispatch_get_main_queue(), block); }\
#define kNavBarHeight 44.f //self.navigationController.navigationBar.frame.size.height
#define kStatusBarHeight 20.f //[UIApplication sharedApplication].statusBarFrame.size.height
#define kStatusAndNavBarsHeight 64.f //([UIApplication sharedApplication].statusBarFrame.size.height+self.navigationController.navigationBar.frame.size.height)

#define kTabBarHeight kSystemVersion >= 8.0 ? 49 : kSystemVersion >= 7.0 ? 56 : kSystemVersion >= 6.0 ? 49 : 0
// --------------------------------------------------

#pragma mark - Aspects
Expand Down Expand Up @@ -373,10 +380,12 @@ else { dispatch_async(dispatch_get_main_queue(), block); }\
#import <UIKit/UIKit.h>

/** Need to send email and sms */
@import MessageUI;
//@import MessageUI;
#import <MessageUI/MessageUI.h>

/** Need to open addresses and coorinates on map */
@import MapKit;
//@import MapKit;
#import <MapKit/MapKit.h>

typedef NS_ENUM(NSUInteger, LGImageScalingMode)
{
Expand Down
8 changes: 8 additions & 0 deletions LGHelper/LGHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -2649,6 +2649,14 @@ - (BOOL)imagePickerControllerShowWithSourceType:(UIImagePickerControllerSourceTy

if (setupHandler) setupHandler(_imagePickerController);


//必须加上这一句,否则可能会导致在关闭弹出窗口的时候状态栏出现黑色(原因可能是修改了全局导航栏背景色)
if ([[[UIDevice currentDevice] systemVersion] floatValue]>=8.0) {
_imagePickerController.modalPresentationStyle=UIModalPresentationOverCurrentContext;
}else{
_imagePickerController.modalPresentationStyle=UIModalPresentationCurrentContext;
}

[viewController presentViewController:_imagePickerController animated:animated completion:presentCompletionHandler];
}

Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
本项目由 Friend-LGA/LGHelper fork 而来,又根据自己的需求增加了一些宏定义,并且没有合并到 Friend-LGA/LGHelper的项目当中。

# LGHelper

iOS helper contains a lot of useful macrosses, methods and hints for every day.
iOS helper 包含了很多有用的宏和方法

## Installation
## 安装

### With source code

[Download repository](https://github.com/Friend-LGA/LGHelper/archive/master.zip), then add [LGHelper directory](https://github.com/Friend-LGA/LGHelper/blob/master/LGHelper/) to your project.
[Download repository](https://github.com/smartdj/LGHelper/archive/master.zip), then add [LGHelper directory](https://github.com/smartdj/LGHelper/blob/master/LGHelper/) to your project.

### With CocoaPods

Expand All @@ -15,7 +17,7 @@ CocoaPods is a dependency manager for Objective-C, which automates and simplifie
#### Podfile
```ruby
platform :ios, '6.0'
pod 'LGHelper', '~> 1.1.0'
pod 'LGHelper', :git => 'https://github.com/smartdj/LGHelper.git'
```

### With Carthage
Expand All @@ -24,7 +26,7 @@ Carthage is a lightweight dependency manager for Swift and Objective-C. It lever

#### Cartfile
```
github "Friend-LGA/LGHelper" ~> 1.1.0
github "smartdj/LGHelper" ~> 1.1.0
```

## Usage
Expand All @@ -37,8 +39,8 @@ In the source files where you need to use the library, import the header file:

### More

For more details see [LGHelper.h](https://github.com/Friend-LGA/LGHelper/blob/master/LGHelper/LGHelper.h)
For more details see [LGHelper.h](https://github.com/smartdj/LGHelper/blob/master/LGHelper/LGHelper.h)

## License

LGHelper is released under the MIT license. See [LICENSE](https://raw.githubusercontent.com/Friend-LGA/LGHelper/master/LICENSE) for details.
LGHelper is released under the MIT license. See [LICENSE](https://raw.githubusercontent.com/smartdj/LGHelper/master/LICENSE) for details.