gyro 1.1.0 → 1.2.0
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 +4 -4
- data/lib/gyro/version.rb +1 -1
- data/lib/templates/swift3/README.md +7 -7
- data/lib/templates/swift3/inc/_attributes_properties.liquid +2 -2
- data/lib/templates/swift3/inc/_enum_attribute_property.liquid +2 -2
- data/lib/templates/swift3/inc/_optional_attribute_property.liquid +2 -2
- data/lib/templates/swift3/inc/_relationship_properties.liquid +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f72b04e5d34ad6d93bb6a96d8c206be24d8f0f9
|
4
|
+
data.tar.gz: be4c052362fa59db8bad14c5e3a0946004b36b02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc6c81d67e271ceabddacab4e1a88c303af9a49040af39d3f1b8b48a11632733364edabd4f2d294b09aa9a8b0254ace8532c465b360d4ce809eba4bda8b214b1
|
7
|
+
data.tar.gz: 377f9d34d0a560f07e0af33c5a693ac5ff0579ebf70ecafc128dfff7a3abaf87c1c49448bd194f0e3d4f2554e6d274ab03d374e5cb86f1a20a69ff8c8c7c1b24
|
data/lib/gyro/version.rb
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
| --------- | ----------------- |
|
5
5
|
| Folder name | templates/swift3 |
|
6
6
|
| Invocation example | `gyro -m <model> -t swift3 …` |
|
7
|
-
| Language | Swift 3 |
|
7
|
+
| Language | Swift 3 and Swift 4 |
|
8
8
|
|
9
9
|
# When to use it
|
10
10
|
|
11
|
-
This template is the reference for swift 3 with Realm generation code.
|
11
|
+
This template is the reference for swift 3 with Realm generation code. This template is compatible with swift 4.
|
12
12
|
You can use it when you need to work with `Realm`
|
13
13
|
|
14
14
|
# Caracteristics
|
@@ -20,7 +20,7 @@ In this template optional Realm objects (Attributes - RealmOptional - or Relatio
|
|
20
20
|
{%- if attribute.is_number == true or attribute.is_bool == true %}
|
21
21
|
let {{ attribute.name }} = RealmOptional<{{ convert_type }}>()
|
22
22
|
{%- else %}
|
23
|
-
dynamic var {{ attribute.name }}: {{ convert_type }}?
|
23
|
+
@objc dynamic var {{ attribute.name }}: {{ convert_type }}?
|
24
24
|
{%- endif -%}
|
25
25
|
|
26
26
|
// Relationship generation
|
@@ -28,7 +28,7 @@ In this template optional Realm objects (Attributes - RealmOptional - or Relatio
|
|
28
28
|
{%- if relationship.type == "to_many" %}
|
29
29
|
let {{ relationship.name }} = List<{{ relationship.inverse_type }}>()
|
30
30
|
{%- else %}
|
31
|
-
dynamic var {{ relationship.name }}: {{ relationship.inverse_type }}?
|
31
|
+
@objc dynamic var {{ relationship.name }}: {{ relationship.inverse_type }}?
|
32
32
|
{%- endif %}
|
33
33
|
{%- endif %}
|
34
34
|
```
|
@@ -52,10 +52,10 @@ final class Product: Object {
|
|
52
52
|
case users = "users"
|
53
53
|
}
|
54
54
|
|
55
|
-
dynamic var brand: String?
|
56
|
-
dynamic var name: String = ""
|
55
|
+
@objc dynamic var brand: String?
|
56
|
+
@objc dynamic var name: String = ""
|
57
57
|
let price = RealmOptional<Int32>()
|
58
|
-
|
58
|
+
|
59
59
|
let users = List<Users>()
|
60
60
|
}
|
61
61
|
```
|
@@ -19,7 +19,7 @@
|
|
19
19
|
{%- include 'inc/optional_attribute_property' -%}
|
20
20
|
{%- else -%}
|
21
21
|
{%- comment -%} ******* GENERATE DEFAULT ATTRIBUTE PROPERTY ******* {% endcomment %}
|
22
|
-
dynamic var {{ attribute.name }}: {{ convert_type }} = {{ default_value }}
|
22
|
+
@objc dynamic var {{ attribute.name }}: {{ convert_type }} = {{ default_value }}
|
23
23
|
{%- endif -%}
|
24
24
|
{%- endif -%}
|
25
25
|
{%- endif -%}
|
@@ -29,4 +29,4 @@
|
|
29
29
|
{%- include 'inc/relationship_properties' -%}
|
30
30
|
|
31
31
|
{%- comment %} ******* GENERATE INVERSE PROPERTIES ******* {% endcomment -%}
|
32
|
-
{%- include 'inc/inverse_properties' -%}
|
32
|
+
{%- include 'inc/inverse_properties' -%}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
{%- if attribute.optional == true %}
|
2
2
|
|
3
|
-
dynamic var {{ attribute.name }}: String?
|
3
|
+
@objc dynamic var {{ attribute.name }}: String?
|
4
4
|
{%- else %}
|
5
5
|
|
6
|
-
dynamic var {{ attribute.name }}: String = ""
|
6
|
+
@objc dynamic var {{ attribute.name }}: String = ""
|
7
7
|
{%- endif %}
|
8
8
|
{%- assign enum_type = attribute.enum_type %}
|
9
9
|
{%- assign enum_name = attribute.name %}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{%- if attribute.is_number == true or attribute.is_bool == true %}
|
2
2
|
let {{ attribute.name }} = RealmOptional<{{ convert_type }}>()
|
3
3
|
{%- else %}
|
4
|
-
dynamic var {{ attribute.name }}: {{ convert_type }}?
|
5
|
-
{%- endif -%}
|
4
|
+
@objc dynamic var {{ attribute.name }}: {{ convert_type }}?
|
5
|
+
{%- endif -%}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
{%- if relationship.type == "to_many" %}
|
4
4
|
let {{ relationship.name }} = List<{{ relationship.inverse_type }}>()
|
5
5
|
{%- else %}
|
6
|
-
dynamic var {{ relationship.name }}: {{ relationship.inverse_type }}?
|
6
|
+
@objc dynamic var {{ relationship.name }}: {{ relationship.inverse_type }}?
|
7
7
|
{%- endif %}
|
8
8
|
{%- endif %}
|
9
|
-
{%- endfor -%}
|
9
|
+
{%- endfor -%}
|