Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #361 from hkellaway/bugfix/use-parameter
Browse files Browse the repository at this point in the history
Use JSONSerialization options from client
  • Loading branch information
hkellaway committed Aug 29, 2020
2 parents d2249d2 + fe21838 commit 9fc9f5a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Gloss.podspec
Expand Up @@ -6,7 +6,7 @@ Pod::Spec.new do |s|
s.description = "A shiny JSON parsing library in Swift. Features include mapping JSON to objects, mapping objects to JSON, handling of nested objects and custom transformations."
s.homepage = "https://github.com/hkellaway/Gloss"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Harlan Kellaway" => "hello@harlankellaway.com" }
s.author = { "Harlan Kellaway" => "harlan.github@gmail.com" }
s.source = { :git => "https://github.com/hkellaway/Gloss.git", :tag => s.version.to_s }

s.swift_version = "5.0"
Expand Down
12 changes: 5 additions & 7 deletions GlossExample/GlossExample/Base.lproj/LaunchScreen.xib
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -16,9 +14,9 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gloss_logo_tagline.png" translatesAutoresizingMaskIntoConstraints="NO" id="EcA-La-bQh" userLabel="Gloss Image">
<rect key="frame" x="80" y="193.5" width="320" height="93"/>
<rect key="frame" x="80" y="143.5" width="320" height="193"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2019 Harlan Kellaway. MIT License." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2020 Harlan Kellaway. MIT License." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="440" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Harlan Kellaway
Copyright (c) 2020 Harlan Kellaway

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -2,7 +2,7 @@

## Features :sparkles:
[![CocoaPods](https://img.shields.io/cocoapods/v/Gloss.svg)](http://cocoapods.org/pods/Gloss)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
[![SPM](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![License](https://img.shields.io/cocoapods/l/Gloss.svg)](https://raw.githubusercontent.com/hkellaway/Gloss/master/LICENSE)
[![CocoaPods](https://img.shields.io/cocoapods/p/Gloss.svg)](http://cocoapods.org/pods/Gloss)
Expand All @@ -19,7 +19,7 @@ The Gloss source currently available via CocoaPods, Carthage and Swift Package M

### Swift Version

It is compatible with Swift 5.0.
Gloss is compatible with Swift 5.0.

To use a version compatible with Swift 4.2, use version 2.1.x.

Expand All @@ -37,7 +37,7 @@ github "hkellaway/Gloss"

### Installation with Swift Package Manager

See [Adding Package Dependencies to Your App](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). Search for `Gloss` with **Owner** `hkellaway`. Point to the desired version or `master` branch.
See [Adding Package Dependencies to Your App](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). Search for `Gloss` with *Owner* `hkellaway`. Point to the desired version or the `master` branch.

## Usage

Expand Down Expand Up @@ -535,7 +535,7 @@ The particular word "gloss" was chosen as it evokes both being lightweight and a

## Credits

Gloss was created by [Harlan Kellaway](http://harlankellaway.com).
Gloss was created by [Harlan Kellaway](http://hkellaway.github.io).

Inspiration was gathered from other great JSON parsing libraries like [Argo](https://github.com/thoughtbot/Argo). Read more about why Gloss was made [here](http://harlankellaway.com/blog/2015/08/16/introducing-gloss-json-parsing-swift).

Expand Down
2 changes: 1 addition & 1 deletion Sources/Gloss/ExtensionArray.swift
Expand Up @@ -75,7 +75,7 @@ public extension Array where Element: JSONDecodable {
*/
static func from(data: Data, serializer: JSONSerializer = GlossJSONSerializer(), options: JSONSerialization.ReadingOptions = .mutableContainers) -> [Element]? {
guard
let jsonArray = (try? JSONSerialization.jsonObject(with: data, options: .mutableContainers)) as? [JSON],
let jsonArray = (try? JSONSerialization.jsonObject(with: data, options: options)) as? [JSON],
let models = [Element].from(jsonArray: jsonArray) else {
return nil
}
Expand Down

0 comments on commit 9fc9f5a

Please sign in to comment.