Skip to content

Commit

Permalink
增加图片
Browse files Browse the repository at this point in the history
  • Loading branch information
king committed Mar 21, 2018
1 parent b96461e commit 75ef420
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Example/JP_Pod_Lib/Images.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Example/JP_Pod_Lib/Images.xcassets/delete.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "delete.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion Example/JP_Pod_Lib/JPViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "JPViewController.h"
#import "JPLibObject.h"
#import "JPLib.h"

@interface JPViewController ()

Expand All @@ -21,6 +21,15 @@ - (void)viewDidLoad
// Do any additional setup after loading the view, typically from a nib.
JPLibObject *jp = [[JPLibObject alloc] init];
[jp testLib];

JPJPLibObject2 *obj2 = [[JPJPLibObject2 alloc] init];
UIImage *image = [obj2 image];

UIImageView *imageView = [[UIImageView alloc] initWithImage:image];

imageView.center = self.view.center;

[self.view addSubview:imageView];
}

- (void)didReceiveMemoryWarning
Expand Down
4 changes: 3 additions & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use_frameworks!

target 'JP_Pod_Lib_Example' do
pod 'JP_Pod_Lib', :path => '../'


pod 'JP_Pod_Lib'

target 'JP_Pod_Lib_Tests' do
inherit! :search_paths

Expand Down
2 changes: 1 addition & 1 deletion JP_Pod_Lib.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'JP_Pod_Lib'
s.version = '0.0.1'
s.version = '0.0.2'
s.summary = '测试组件库'

# This description is used to generate tags and improve search results.
Expand Down
2 changes: 2 additions & 0 deletions JP_Pod_Lib/Classes/JPJPLibObject2.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@

@interface JPJPLibObject2 : NSObject

- (UIImage *)image;

@end
5 changes: 5 additions & 0 deletions JP_Pod_Lib/Classes/JPJPLibObject2.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@

@implementation JPJPLibObject2

- (UIImage *)image {
UIImage *image = [UIImage imageNamed:@"delete"];
return image;
}

@end

0 comments on commit 75ef420

Please sign in to comment.