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.9%) to scientific vocabulary
Last synced: 8 months ago · JSON representation ·

Repository

Demo Swift Realm

Basic Info
  • Host: GitHub
  • Owner: joelparkerhenderson
  • Language: Swift
  • Default Branch: master
  • Size: 62.5 MB
Statistics
  • Stars: 2
  • Watchers: 3
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created almost 10 years ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing Citation

README.md

Demo Swift Realm

Realm

This demonstration shows:

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 project.

  • Use iOS template "Single View Application" and Product Name "Demo Swift Realm".

  • Help

Create a simple way to print some text to the screen.

  • We create a text view object and IBOutlet named "demoTextView".

  • Help

Add Realm to the project. We suggest using Carthage or Cocoapods.

  • Carthage Cartfile:

    github "realm/realm-cocoa"`

  • When you link the frameworks, and when you add the run phase, you want to use both Realm.framework and RealmSwift.framework.

  • Help

Create model classes

In the left Xcode area that is the project tree, create a new group and name it "Models".

In the new group "Models", create a new iOS Swift file and name it "Team.swift".

  • If Xcode prompts you for where to save it, then create a new file folder "Models", and add it to all the targets.

Create a Realm model for a "Team", such as a company.

swift import Foundation import RealmSwift class Team: Object { dynamic var name: String? = nil }

Create a Realm model for a "Task", such as a to-do item.

swift import Foundation import RealmSwift class Task: Object { dynamic var name: String? = nil }

Create model objects

Edit ViewController.swift.

Add simple code to create model objects, then print some output to the screen.

```swift import UIKit

class ViewController: UIViewController {

@IBOutlet weak var demoTextView: UITextView!

override func viewDidLoad() { super.viewDidLoad()

let team = Team()
team.name = "Arsenal Football Club"

let task = Task()
task.name = "Add sprint exercises"

demoTextView.text = team.name! + "\n" + task.name!

} … ```

Run

Run the app.

The Simulator screen shows the team name and task name.

Congratulations, you're successful!

More examples

The source code for this project contains many more examples such as:

  • Migration: how to upgrade the database when the app launches.
  • Primary keys: how to set a primary key, and why it matters.
  • Optional properties: especially by using RealmOptional.
  • Ignored properties: tell Realm to skip persisting these.
  • To-One relationships: create one-to-one and many-to-one.
  • Inverse relationships: enable efficient round-trip lookups.
  • Indexed properties: set properties to be indexed.

The source code examples are here:

Tracking

  • Package: demoswiftrealm
  • Version: 3.0.0
  • Created: 2016-04-09
  • Updated: 2017-09-22
  • License: BSD, MIT, GPL
  • Contact: Joel Parker Henderson (http://joelparkerhenderson.com)

Owner

  • Name: Joel Parker Henderson
  • Login: joelparkerhenderson
  • Kind: user
  • Location: California

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 Realm
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-realm/'
    description: Demo Swift Realm
repository-code: 'https://github.com/joelparkerhenderson/demo-swift-realm/'
abstract: >-
  Demo Swift Realm
license: See license file

GitHub Events

Total
  • Push event: 1
Last Year
  • Push event: 1

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 13
  • Total Committers: 1
  • Avg Commits per committer: 13.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Joel Parker Henderson j****l@j****m 13
Committer Domains (Top 20 + Academic)