swift-boiler 1.0.9 → 1.0.10

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
  SHA1:
3
- metadata.gz: 765c76975b8f6b9706bd3f23606169459401616f
4
- data.tar.gz: 1cc95f7349785cbaf9e6014671e40bf669da68ff
3
+ metadata.gz: 6e83cfe5c70277211ffd1ace476b211ff0cb4179
4
+ data.tar.gz: e6fd30e58441266afa46d42f57d953f05cc97cef
5
5
  SHA512:
6
- metadata.gz: 9f37560fdf420ffbfe426d1a1be5505a78b46c91496ebfa3ed1d77c5dddaf90fae0d266071d8e5262d563c94c069b49c76841eeafd54d2a74d017c0a3e53111f
7
- data.tar.gz: 060b16020116d5b8b67bbc18ccb9218d01c76ef1e4a22e134c9dcc594e140318629eba049a32d5a511b79d61eb08b35788ec4ac82dd336ddd49e60bba29fac96
6
+ metadata.gz: c242a057677e0f9509246675cdbebcfd12132a130ab267aa1d54202d63a94c335007ee3b4bd9c2ca43e7a656532640e42761e4695e9043b4b08305cf1c385779
7
+ data.tar.gz: f63d09b174972fa700712923e72423e172567d07f1023b1a6edf8359bc4b597fb51104c5e11ea3acc154547872a79ccca2ed3fd0fd45c214305b5f773baf0b78
@@ -126,7 +126,9 @@ module Swift
126
126
  end
127
127
 
128
128
  def capitalize_name(name)
129
- name.split.map(&:capitalize).join(' ')
129
+ place_holder = name.dup
130
+ first_letter = place_holder.slice!(0).capitalize
131
+ first_letter + place_holder
130
132
  end
131
133
 
132
134
  def downcase_name(name)
@@ -21,35 +21,21 @@ class {{class_name}}: UITableViewCell {
21
21
  {{#options.protocol}}
22
22
  weak private var delegate: {{class_name}}Delegate?
23
23
  weak private var datasource: {{class_name}}DataSource?
24
- {{/options.protocol}}
24
+ {{/options.protocol}}
25
25
  {{#properties.ui_label}}
26
-
27
- private let {{name}}:UILabel = {
28
- let {{name}} = UILabel()
29
- {{name}}.textColor = <# UIColor #>
30
- {{name}}.font = <# UIFont #>
31
- return {{name}}
32
- }()
26
+ private let {{name}} = UILabel()
33
27
  {{/properties.ui_label}}
34
28
  {{#properties.ui_view}}
35
-
36
- private let {{name}}:UIView = {
37
- let {{name}} = UIView()
38
- {{name}}.backgroundColor = <# UIColor #>
39
- {{name}}.clipBounds = <# true or false #>
40
- return {{name}}
41
- }()
29
+ private let {{name}} = UIView()
42
30
  {{/properties.ui_view}}
43
31
  {{#properties.unknow_type}}
44
-
45
- private let {{name}}:{{type}} = {
46
- return {{type}}()
47
- }()
32
+ private let {{name}} = {{type}}()
48
33
  {{/properties.unknow_type}}
49
34
 
50
35
  override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
51
36
  super.init(style: .subtitle, reuseIdentifier: reuseIdentifier)
52
37
  setupView()
38
+ setupConstraints()
53
39
  }
54
40
 
55
41
  required public init?(coder aDecoder: NSCoder) {
@@ -72,22 +58,40 @@ class {{class_name}}: UITableViewCell {
72
58
  // MARK: - Setup
73
59
 
74
60
  private func setupView() {
75
- addViewComponents()
76
- setupConstraints()
61
+ {{#properties.ui_label}}
62
+ setup{{capitalized_name}}()
63
+ {{/properties.ui_label}}
64
+ {{#properties.ui_view}}
65
+ setup{{capitalized_name}}()
66
+ {{/properties.ui_view}}
67
+ {{#properties.unknow_type}}
68
+ setup{{capitalized_name}}()
69
+ {{/properties.unknow_type}}
77
70
  }
78
71
 
79
- private func addViewComponents() {
80
72
  {{#properties.ui_label}}
81
- contentView.addSubview({{name}})
73
+ private func setup{{capitalized_name}}() {
74
+ {{name}}.textColor = <# UIColor #>
75
+ {{name}}.font = <# UIFont #>
76
+ addSubview({{name}})
77
+ }
78
+
82
79
  {{/properties.ui_label}}
83
80
  {{#properties.ui_view}}
84
- contentView.addSubview({{name}})
81
+ private func setup{{capitalized_name}}() {
82
+ {{name}}.backgroundColor = <# UIColor #>
83
+ {{name}}.clipBounds = <# true or false #>
84
+ addSubview({{name}})
85
+ }
86
+
85
87
  {{/properties.ui_view}}
86
88
  {{#properties.unknow_type}}
87
- contentView.addSubview({{name}})
88
- {{/properties.unknow_type}}
89
+ private func setup{{capitalized_name}}() {
90
+ addSubview({{name}})
89
91
  }
90
92
 
93
+ {{/properties.unknow_type}}
94
+
91
95
  // MARK: - Constraints
92
96
 
93
97
  private func setupConstraints() {
@@ -23,37 +23,19 @@ class {{class_name}}: UIView {
23
23
  weak private var datasource: {{class_name}}DataSource?
24
24
  {{/options.protocol}}
25
25
  {{#properties.ui_label}}
26
-
27
- private let {{name}}:UILabel = {
28
- let {{name}} = UILabel()
29
- {{name}}.textColor = <# UIColor #>
30
- {{name}}.font = <# UIFont #>
31
- return {{name}}
32
- }()
26
+ private let {{name}} = UILabel()
33
27
  {{/properties.ui_label}}
34
28
  {{#properties.ui_view}}
35
-
36
- private let {{name}}:UIView = {
37
- let {{name}} = UIView()
38
- {{name}}.backgroundColor = <# UIColor #>
39
- {{name}}.clipBounds = <# true or false #>
40
- return {{name}}
41
- }()
29
+ private let {{name}} = UIView()
42
30
  {{/properties.ui_view}}
43
31
  {{#properties.unknow_type}}
44
-
45
- private let {{name}}:{{type}} = {
46
- return {{type}}()
47
- }()
32
+ private let {{name}} = {{type}}()
48
33
  {{/properties.unknow_type}}
49
34
 
50
35
  override init(frame: CGRect) {
51
36
  super.init(frame: frame)
52
- self.setupView()
53
- }
54
-
55
- convenience init() {
56
- self.init(frame: CGRect.zero)
37
+ setupView()
38
+ setupConstraints()
57
39
  }
58
40
 
59
41
  required init?(coder aDecoder: NSCoder) {
@@ -63,22 +45,40 @@ class {{class_name}}: UIView {
63
45
  // MARK: - Setup
64
46
 
65
47
  private func setupView() {
66
- addViewComponents()
67
- setupConstraints()
48
+ {{#properties.ui_label}}
49
+ setup{{capitalized_name}}()
50
+ {{/properties.ui_label}}
51
+ {{#properties.ui_view}}
52
+ setup{{capitalized_name}}()
53
+ {{/properties.ui_view}}
54
+ {{#properties.unknow_type}}
55
+ setup{{capitalized_name}}()
56
+ {{/properties.unknow_type}}
68
57
  }
69
58
 
70
- private func addViewComponents() {
71
59
  {{#properties.ui_label}}
60
+ private func setup{{capitalized_name}}() {
61
+ {{name}}.textColor = <# UIColor #>
62
+ {{name}}.font = <# UIFont #>
72
63
  addSubview({{name}})
64
+ }
65
+
73
66
  {{/properties.ui_label}}
74
67
  {{#properties.ui_view}}
68
+ private func setup{{capitalized_name}}() {
69
+ {{name}}.backgroundColor = <# UIColor #>
70
+ {{name}}.clipBounds = <# true or false #>
75
71
  addSubview({{name}})
72
+ }
73
+
76
74
  {{/properties.ui_view}}
77
75
  {{#properties.unknow_type}}
76
+ private func setup{{capitalized_name}}() {
78
77
  addSubview({{name}})
79
- {{/properties.unknow_type}}
80
78
  }
81
79
 
80
+ {{/properties.unknow_type}}
81
+
82
82
  // MARK: - Constraints
83
83
 
84
84
  private func setupConstraints() {
@@ -1,5 +1,5 @@
1
1
  module Swift
2
2
  module Boiler
3
- VERSION = "1.0.9"
3
+ VERSION = "1.0.10"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swift-boiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Peres
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-18 00:00:00.000000000 Z
11
+ date: 2017-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler