Latest 0.1.0
Homepage https://github.com/LiuXingQiPan/LYWebImageSwitch
License MIT
Platforms ios 7.0, requires ARC
Dependencies SDWebImage, Reachability
Authors

CI Status
Version
License
Platform

A switch for SDWebImageDownloader in WWAN. You can decide whether to forbid to download web image in WWAN.

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', '~> 0.1.0'

Author

liyang, [email protected]

License

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

Latest podspec

{
    "name": "LYWebImageSwitch",
    "version": "0.1.0",
    "summary": "A switch for SDWebImageDownloader in WWAN. You can decide that if forbidding download webimage in WWAN.",
    "description": "A switch for SDWebImageDownloader in WWAN. You can decide that if forbidding to download webimage in WWAN",
    "homepage": "https://github.com/LiuXingQiPan/LYWebImageSwitch",
    "license": "MIT",
    "authors": {
        "liyang": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LiuXingQiPan/LYWebImageSwitch.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "LYWebImageSwitch": [
            "Pod/Assets/*.png"
        ]
    },
    "dependencies": {
        "SDWebImage": [
            "~> 3.7.3"
        ],
        "Reachability": [
            "~> 3.2"
        ]
    }
}

Pin It on Pinterest

Share This