2015-03-23 20:28:42 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
2015-02-20 04:10:52 +00:00
|
|
|
|
|
|
|
#import "RCTNetworkImageViewManager.h"
|
|
|
|
|
|
|
|
#import "RCTNetworkImageView.h"
|
|
|
|
|
|
|
|
#import "RCTConvert.h"
|
|
|
|
#import "RCTUtils.h"
|
|
|
|
|
|
|
|
#import "RCTImageDownloader.h"
|
|
|
|
|
|
|
|
@implementation RCTNetworkImageViewManager
|
|
|
|
|
2015-04-08 12:42:43 +00:00
|
|
|
RCT_EXPORT_MODULE()
|
|
|
|
|
2015-02-20 04:10:52 +00:00
|
|
|
- (UIView *)view
|
|
|
|
{
|
|
|
|
RCTNetworkImageView *view = [[RCTNetworkImageView alloc] initWithFrame:CGRectZero imageDownloader:[RCTImageDownloader sharedInstance]];
|
|
|
|
view.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
return view;
|
|
|
|
}
|
|
|
|
|
2015-03-26 04:29:28 +00:00
|
|
|
RCT_REMAP_VIEW_PROPERTY(defaultImageSrc, defaultImage, UIImage)
|
|
|
|
RCT_REMAP_VIEW_PROPERTY(src, imageURL, NSURL)
|
2015-04-17 01:17:19 +00:00
|
|
|
RCT_EXPORT_VIEW_PROPERTY(contentMode, UIViewContentMode)
|
2015-02-20 04:10:52 +00:00
|
|
|
|
|
|
|
@end
|