demo-swift-objectmapper
Demo Swift ObjectMapper
https://github.com/joelparkerhenderson/demo-swift-objectmapper
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.0%) to scientific vocabulary
Repository
Demo Swift ObjectMapper
Basic Info
- Host: GitHub
- Owner: joelparkerhenderson
- Language: Swift
- Default Branch: master
- Size: 11 MB
Statistics
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Demo Swift ObjectMapper

This demonstration shows:
How to use the ObjectMapper tool that converts between JSON and models
This README describes how to create the demo.
Start
To use this demo, you can clone this repo, or you can use this README to create your own project.
If you clone this repo, then be aware that there are multiple git branches, so pick the one you want.
swift-4-xcode-9: Swift version 4, Xcode version 9, iOS version 11.
swift-3-xcode-8: Swift version 3, Xcode version 8, iOS version 10.
Create the project
Launch Xcode and create a new Xcode project.
Use iOS template "Single View Application" and Product Name "Demo Swift ObjectMapper"
Create a simple way to print some text to the screen.
We create a text view object and IBOutlet named "demoTextView".
Add ObjectMapper to the project. We suggest using Carthage or Cocoapods.
Carthage
Cartfile:github "Hearst-DD/ObjectMapper" ~> 2.2
Create a model class
Create a new group named "Models".
Create a new iOS Swift file named "Item.swift", and when you save it, also create a new disk folder named "Models".
Edit Item.swift.
```swift import Foundation import ObjectMapper
class Item: Mappable {
var name: String?
// Implement Mappable required init?(map: Map) { }
// Implement Mappable func mapping(map: Map) { name <- map["name"] }
} ```
Instantiate a model
Edit ViewController.swift.
Add simple code to create a model object, then print some output to the screen.
```swift import UIKit import ObjectMapper
class ViewController: UIViewController {
@IBOutlet weak var demoTextView: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
let item = Mapper
Run
Run the app.
The Simulator screen shows the item name, which is "Demo Item".
Congratulations, you're successful!
Tracking
- Package: demoswiftobjectmapper
- Version: 3.0.0
- Created: 2016-05-30
- Updated: 2017-09-22
- License: BSD, GPL, MIT
- Contact: Joel Parker Henderson (http://joelparkerhenderson.com)
Owner
- Name: Joel Parker Henderson
- Login: joelparkerhenderson
- Kind: user
- Location: California
- Website: http://www.joelparkerhenderson.com
- Repositories: 319
- Profile: https://github.com/joelparkerhenderson
Software developer. Technology consultant. Creator of GitAlias.com, NumCommand.com, SixArm.com, and many open source projects.
Citation (CITATION.cff)
cff-version: 1.2.0
title: Demo Swift ObjectMapper
message: >-
If you use this work and you want to cite it,
then you can use the metadata from this file.
type: software
authors:
- given-names: Joel Parker
family-names: Henderson
email: joel@joelparkerhenderson.com
affiliation: joelparkerhenderson.com
orcid: 'https://orcid.org/0009-0000-4681-282X'
identifiers:
- type: url
value: 'https://github.com/joelparkerhenderson/demo-swift-objectmapper/'
description: Demo Swift ObjectMapper
repository-code: 'https://github.com/joelparkerhenderson/demo-swift-objectmapper/'
abstract: >-
Demo Swift ObjectMapper
license: See license file
GitHub Events
Total
- Push event: 1
Last Year
- Push event: 1
Committers
Last synced: 11 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Joel Parker Henderson | j****l@j****m | 5 |
Committer Domains (Top 20 + Academic)
Dependencies
- Hearst-DD/ObjectMapper ~> 2.2
- Hearst-DD/ObjectMapper 2.2.9