cocoapods-aomi-bin 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72a18bc0c3ba9a0e31de6af984a1d07c7def7f70249941dd6a925dfe71d1fe6d
4
- data.tar.gz: f1fea909529eab507e62af72b609d2d583f553d4d10983868a98e9e1c1b98b12
3
+ metadata.gz: 61ce22dc3e41408e8777e312780ce5a0a313acd15344f6026371e119d4af87f4
4
+ data.tar.gz: c0d34b7525c2ada3970d6d758a5082c67f8bbe00826f459571be509ea42de8eb
5
5
  SHA512:
6
- metadata.gz: 3dd64cd26ca405e69ab574db311279bf03f1790459ee585345cc562caddce8c2f0d0b8cd237891bc79475cb4d8c9377f5c13672c25eab71539c7661cd9d91672
7
- data.tar.gz: 83cd6c1b564ceb748ec102d23c981bf941dada6bc47c3e3ef955a7eb2c84e271ec4a36f484ea153b1dae213b3c11a55028b56f68a45c6d5f73af3d36cf0427fd
6
+ metadata.gz: aacb0bf501176001a01146859b4a460c7d3be79c907d2d9f4e9d15f00aaf40a11d06569587d8845bdbfe8c4a2b7f83ede9633a79bf3a864ecfa979cb574df52b
7
+ data.tar.gz: 9fc30ba67b383560b301bbd41e637904dade14a4f6afb451f45419830d514b08551b4db053e0715cf9f6b80a76c0ac27180ad71fe6d7a295d0294e58cfd8634c
@@ -14,6 +14,28 @@ module Pod
14
14
  @name.split(",").map(&:strip)
15
15
  end
16
16
 
17
+ def type
18
+ @ele_type ||= begin
19
+ if @type =~ /image/i
20
+ 'UIImageView'
21
+ elsif @type =~ /stack/i
22
+ 'UIStackView'
23
+ elsif @type =~ /label/i
24
+ 'UILabel'
25
+ elsif @type =~ /table/i
26
+ 'UITableView'
27
+ elsif @type =~ /text/i
28
+ 'UITextField'
29
+ elsif @type =~ /button/i
30
+ 'UIButton'
31
+ elsif @type =~ /view/i
32
+ 'UIView'
33
+ else
34
+ @type
35
+ end
36
+ end
37
+ end
38
+
17
39
  def run
18
40
  print_declare
19
41
  puts "\n\n"
@@ -27,13 +49,13 @@ module Pod
27
49
  def print_declare
28
50
  names.each do |name|
29
51
  puts "///"
30
- puts "@property (nonatomic, strong) #{@type} *#{name};"
52
+ puts "@property (nonatomic, strong) #{type} *#{name};"
31
53
  end
32
54
  end
33
55
 
34
56
  def print_instance
35
57
  names.each do |name|
36
- puts "-(#{@type} *)#{name}"
58
+ puts "-(#{type} *)#{name}"
37
59
  puts "{"
38
60
  puts " if(!_#{name}){"
39
61
  print_alloc(name)
@@ -47,46 +69,50 @@ module Pod
47
69
  end
48
70
 
49
71
  def print_alloc(name)
50
- if @type.eql?('UIImageView')
72
+ if type.eql?('UIImageView')
51
73
  puts " _#{name} = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@\"xxxx\"]];"
52
- elsif @type.eql?('UIButton')
74
+ elsif type.eql?('UIButton')
53
75
  puts " _#{name} = [UIButton buttonWithType:UIButtonTypeCustom];"
54
- elsif @type.eql?('UITableView')
76
+ elsif type.eql?('UITableView')
55
77
  puts " _#{name} = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];"
56
78
  else
57
- puts " _#{name} = [[#{@type} alloc] init];"
79
+ puts " _#{name} = [[#{type} alloc] init];"
58
80
  end
59
81
  end
60
82
 
61
83
  def print_property(name)
62
- if @type.eql?('UILabel')
84
+ if type.eql?('UILabel')
63
85
  puts " _#{name}.textColor = kSetCOLOR(0x333333);"
64
86
  puts " _#{name}.text = @\"xxxxxxxx\";"
65
87
  puts " _#{name}.font = [UIFont systemFontOfSize:12.0 weight:UIFontWeightRegular];"
66
88
  puts " _#{name}.textAlignment = NSTextAlignmentCenter;"
67
- elsif @type.eql?('UIImageView')
89
+ elsif type.eql?('UIImageView')
68
90
  puts " _#{name}.backgroundColor = kBackgroundColor;"
69
91
  puts " _#{name}.contentMode = UIViewContentModeScaleAspectFit;"
70
92
  puts " _#{name}.clipsToBounds = YES;"
71
93
  puts " _#{name}.layer.cornerRadius = 6.0f;"
72
94
  puts " _#{name}.layer.borderColor = kLineColor.CGColor;"
73
95
  puts " _#{name}.layer.borderWidth = 0.5;"
74
- elsif @type.eql?('UITextField')
96
+ elsif type.eql?('UITextField')
75
97
  puts " _#{name}.textColor = kSetCOLOR(0x333333);"
76
98
  puts " _#{name}.font = [UIFont systemFontOfSize:12.0 weight:UIFontWeightRegular];"
77
- elsif @type.eql?('UIView')
99
+ elsif type.eql?('UIView')
78
100
  puts " _#{name}.backgroundColor = kBackgroundColor;"
79
- elsif @type.eql?('UITableView')
101
+ elsif type.eql?('UIStackView')
102
+ puts " _#{name}.axis = UILayoutConstraintAxisHorizontal;"
103
+ puts " _#{name}.distribution = UIStackViewDistributionFillEqually;"
104
+ elsif type.eql?('UITableView')
80
105
  puts " _#{name}.backgroundColor = kBackgroundColor;"
81
106
  puts " _#{name}.delegate = self;"
82
107
  puts " _#{name}.delegate = self;"
83
108
  puts " _#{name}.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];"
84
109
  puts " _#{name}.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];"
85
110
  puts " _#{name}.separatorStyle = UITableViewCellSeparatorStyleNone;"
86
- elsif @type.eql?('UIButton')
111
+ elsif type.eql?('UIButton')
87
112
  puts " _#{name}.backgroundColor = kBackgroundColor;"
88
113
  puts " [_#{name} setTitle:@\"xxx\" forState:UIControlStateNormal];"
89
114
  puts " [_#{name} setTitleColor:kSetCOLOR(0x999999) forState:UIControlStateNormal];"
115
+ puts " _#{name}.titleLabel.font = [UIFont systemFontOfSize:14.0 weight:UIFontWeightRegular];"
90
116
  puts " [_#{name} setImage:[UIImage imageNamed:@\"xx\"] forState:UIControlStateNormal];"
91
117
  puts " [_#{name} setImage:[UIImage imageNamed:@\"xx\"] forState:UIControlStateSelected];"
92
118
  puts " [_#{name} addTarget:self action:@selector(actionHandler:) forControlEvents:UIControlEventTouchUpInside];"
@@ -100,13 +126,15 @@ module Pod
100
126
  puts "[self.#{name}.trailingAnchor constraintEqualToAnchor:contentView.trailingAnchor constant:0].active = YES;"
101
127
  puts "[self.#{name}.topAnchor constraintEqualToAnchor:contentView.topAnchor].active = YES;"
102
128
  puts "[self.#{name}.bottomAnchor constraintEqualToAnchor:contentView.bottomAnchor].active = YES;"
129
+ puts "[self.#{name}.widthAnchor constraintEqualToConstant:80].active = YES;"
130
+ puts "[self.#{name}.heightAnchor constraintEqualToAnchor:80].active = YES;"
103
131
  puts "\n\n"
104
132
  end
105
133
  end
106
134
 
107
135
  def print_value
108
136
  names.each do |name|
109
- if @type.eql?('UILabel')
137
+ if type.eql?('UILabel')
110
138
  puts "self.#{name}.text = @\"xxxxx\";"
111
139
  end
112
140
  end
@@ -1,5 +1,5 @@
1
1
  module CBin
2
- VERSION = '0.1.25'
2
+ VERSION = '0.1.26'
3
3
  end
4
4
 
5
5
  module Pod
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-aomi-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-03 00:00:00.000000000 Z
11
+ date: 2021-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods