File tree 3 files changed +24
-2
lines changed
3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
Pod ::Spec . new do |s |
10
10
s . name = 'JSONStub'
11
- s . version = '0.1.1 '
11
+ s . version = '0.1.2 '
12
12
s . summary = 'Use JSONStub to easily load JSON files into your Mappable objects.'
13
13
14
14
# This description is used to generate tags and improve search results.
Original file line number Diff line number Diff line change 6
6
// Copyright © 2016 Swift Yah. All rights reserved.
7
7
//
8
8
9
- import ObjectMapper
9
+ import struct Foundation. Data
10
+ import protocol ObjectMapper. BaseMappable
10
11
11
12
public extension BaseMappable {
12
13
init ? ( fromFileName file: String ) {
Original file line number Diff line number Diff line change
1
+ //
2
+ // ImmutableMappable.swift
3
+ // Pods
4
+ //
5
+ // Created by Rafael Ferreira on 3/30/17.
6
+ //
7
+ //
8
+
9
+ import protocol ObjectMapper. ImmutableMappable
10
+
11
+ public extension ImmutableMappable {
12
+ init ? ( fromFileName file: String ) {
13
+ guard let json = file. fileDictionary ( ) else { return nil }
14
+
15
+ do {
16
+ try self . init ( JSON: json)
17
+ } catch {
18
+ return nil
19
+ }
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments