Swiftpack.co - mongodb-developer/realm-binary-tree as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by mongodb-developer.
mongodb-developer/realm-binary-tree initial-state
Swift Package for the Realm-Powered Binary Tree Sample
⭐️ 4
🕓 2 years ago
iOS
.package(url: "https://github.com/mongodb-developer/realm-binary-tree.git", from: "initial-state")

BinaryTree

A simple implementation of a Realm-backed Binary Tree.

This library is a demo on how to use DocC. See beelow how your new docs will look! 👇

You can read a series of posts about how to create a small guessing game in the Realm/MongoDB blog, starting with Creating a framework that uses Realm as a 3rd party dependency

Realm + Swift Packages

Also it shows how to integrate and use Realm in your Swift Packages. For details, have a look at Package.swift

Generating DocC using Github Actions

This repo also has a Github Action to automatically generate the DocC docs on each push. You can read about this in the MongoDB Developer Center article Continuously Building and Hosting our Swift DocC Documentation using Github Actions and Netlify

For the impatient, check the main.yml file

Generated DocC files can be found in this repo

Local testing

Every time you build the documentation from Xcode the documentation browser will allow you to check how your docs look. You can export the docs as a Documentation Archive.

But this docs are a web site that we can serve locally. Let's see how to do it using Docker

To host your generated docs in a local web server, if you have Docker installed you can create your own image or mount the generated doc folder

Creating an Image

Create an image based on this Docker file: it'll have an Apache httpd server and the doccarchive files

docker build -t docs .

then run the image in a container

docker run -dit --name my-running-app -p 8080:80 docs

Mounting the generated doc folder

docker run -dit -v /Users/dfreniche/Code/DocC/BinaryTree/docs/BinaryTree.doccarchive:/usr/local/apache2/htdocs/  -p 8080:80 httpd:2.4

Change the path to where you exported the doccarchive

Resources

To learn more about Realm/MongoDB you have all these fantastic resources:

GitHub

link
Stars: 4
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics