Coder Social home page Coder Social logo

wtrequestcenter's Introduction

WTKit

Build Status CocoaPods Compatible Carthage compatible Platform

WTKit is my Code accumulation

中文Readme(Zh_cn)

Features

  • Convenient Request / Response Methods
  • Debug print
  • Convenient thread Switch
  • network status observe
  • Convenient UIColor create
  • UIButton and UIImageVie image download,cache
  • UITableView pull to refresh
  • UIView screenshot image
  • HudView
  • launch time count for build
  • auto create Model from json,Model instance auto set value from json data,auto write to json
  • More

Requirements

  • iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 8.0+
  • Swift 3.0

Installation

Copy sources from WTKit

Communication

  • if you  found a bug, open an issue.
  • if you  have a feature request, open an issue.
  • if you  want to contribute, submit a pull request.

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate WTKit into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'WTKit', '~> 0.3.3'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Alamofire into your Xcode project using Carthage, specify it in your Cartfile:

github "swtlovewtt/WTRequestCenter" ~> 0.3.3

Run carthage update to build the framework and drag the built WTKit.framework into your Xcode project.

Manually

copy sources from WTKit

wtrequestcenter's People

Contributors

songwentong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wtrequestcenter's Issues

动态图片,请求标识

求大神加入动态图片的上传下载,缓存,还有和asi一样的请求时候状态栏会有菊花转动

使用过程中发现的问题,

demo是正常的,放到自己的程序里面,缓存gif图片,有缓存,但是缓存位置和demo不一样,而且有网络的情况下,读取缓存文件很慢,又好像是需要重新下载似的,不是读取的缓存,没网络的情况下才会读取,缓存文件,。。清除缓存也不能用。

discussion

1、shareQueue方法里面没必要再使用if (!shareQueue),dispatch_once完全可以保证只有一个shareQueue对象
2、sharedCache方法里面,对于sharedCache的配置,不必每次都调用,可以写到dispatch_once里面

切换图片

  • (void)setBackgroundImage:(UIControlState)state withURL:(NSString *)url placeholderImage:(UIImage *)placeholderImage 用这个方法请求按钮图片的时候 再切换的时候会先显示placeholderImage图片。然后再显示请求的图片。影响用户体验。

使用过程中遇到的问题,

imageView.image = [UIImage animatedImageWithAnimatedGIFURL:[NSURL URLWithString:@"http://img3.imgtn.bdimg.com/it/u=2766409058,1021741885&fm=23&gp=0.jpg"]];这个时候图片地址不对了会崩溃,(这个地址本身就是错误的不是一个正确的图片地址)

对图片的缓存测试的时候只有setimage这个方法有缓存,其他没有,(我没测试完)

加载动态图片的方法animatedImage没有对图片缓存,下载图片的时候请求是放在主线程的会卡,其他不知道会不会卡主线程了

对于 https 支持不好

WTRequestCenterCachePolicyCacheAndWeb 如果使用这个在某些情况下会出现重复数据的,使用WTRequestCenterCachePolicyCacheAndRefresh一般情况下是正常的,但是对于https的接口请求,这个缓存是有,但是永远不会去更新数据了

imageview缓存异步加载问题

新的缓存只是btn的做了缓存,btn也是异步加载。但是imageview没有缓存,也不是异步加载,加载的时候会卡屏

WTRequestCenterCachePolicyCacheAndRefresh问题

我发现使用WTRequestCenterCachePolicyCacheAndRefresh缓存策略时,有时候无网络会从本地取缓存;有时候确不会从本地取缓存,直接报error。请问这是什么原因?(确定本地已有缓存)

关于WTCycleScrollView.h

您好!我看了您的代码,想问两个问题。
第一个问题是用UIScrollView的回滚第一副View,用以下代理方法:

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView

用这种原理实现的这个无限循环滚动大概会滚动得过快而最后一幅会有卡顿。
请问这个问题怎么解决呢?

第二个问题是给View添加Button的做法为何不用Tap手势代替?

for (int i=0; i< count; i++) {
            UIView *view = [self.dataSource cycleScrollView:self
                                               viewForIndex:i];
            CGRect frame = CGRectMake((i+1)*width, 0, width, height);
            [viewToShow addObject:view];
            view.frame = frame;
            [myScrollView addSubview:view];



            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = view.bounds;
            [view addSubview:button];
            view.userInteractionEnabled = YES;
            button.userInteractionEnabled = YES;
            [button addTarget:self
                       action:@selector(buttonPressed:)
             forControlEvents:UIControlEventTouchUpInside];
        }

没有put请求

建议在库里添加一个put请求。有些第三方服务器上传图片会使用put功能。

thinak u

This tool is just what I want

发现一个小问题

如果A控制器push一个控制器B,B里面有收藏按钮是个post请求,如果点一下收藏,立马点返回到A控制器,那么是收藏失败,请求没有结束已经不请求了,试了ASI,ASI就算B直接退到A 那么还是会执行完这个请求的

请求网络图片地址过长无法显示

UIImageView+WTRequestCenter.h里面 如果URL地址过长请求时图片无法显示出来

  • (void)setImageWithURL:(NSString *)url
    {
    [self setImageWithURL:url placeholderImage:nil];
    }

post的数据格式

可以再发送post数据的时候加一个post数据的类型。有些服务器会要求post json格式的数据。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.