LYWebImageSwitch 0.1.0

LYWebImageSwitch 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2017

Maintained by liyang.



 
Depends on:
SDWebImage~> 3.7.3
Reachability~> 3.2
 

  • By
  • liyang

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

First, this step is necessary.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    [LYWebImageSwitch registeWebImageSwitch];
    return YES;
}

It's helpful to reset the download setting.

then, you can use

+ (void)setWebImageSwitch:(BOOL)webImageSwitch;

and

+ (BOOL)webImageSwitch;

to set or get the state of switch.

Note: only in WWAN. It's always allowed to download web image in WLAN.

Note: SDWebImage have caches. It will cause web image can appear again.

Note: If you want images disappear after clearing caches, you must reload the views.

Example

Because the simulator have only WLAN, for better to see the result, I make it can work in WLAN in the IPHONE_SIMULATOR.

Requirements

Same to SDWebImage.

Installation

LYWebImageSwitch is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "LYWebImageSwitch"

Author

liyang, [email protected]

License

LYWebImageSwitch is available under the MIT license. See the LICENSE file for more info.