{"id":13340089,"url":"https://github.com/netreconlab/Parse-Swift","last_synced_at":"2025-03-11T16:32:07.109Z","repository":{"id":61885851,"uuid":"555847512","full_name":"netreconlab/Parse-Swift","owner":"netreconlab","description":"The original (OG) Swift SDK for Parse Platform (iOS, macOS, watchOS, tvOS, visionOS, Linux, Android, Windows). This repo is maintained by Parse-Swift's original developer and all new features and bug fixes will occur here.","archived":false,"fork":true,"pushed_at":"2024-10-03T00:02:38.000Z","size":47330,"stargazers_count":61,"open_issues_count":6,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-25T14:42:38.887Z","etag":null,"topics":["android","apple","authentication","baas","cocoapods","hacktoberfest","ios","linux","livequery","parse","parse-platform","parse-server","parse-swift","query","rest-api","sdk","spm","swift","swift-package-manager","visionos"],"latest_commit_sha":null,"homepage":"https://swiftpackageindex.com/netreconlab/Parse-Swift/documentation","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"parse-community/Parse-Swift","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netreconlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null},"funding":{"github":["cbaker6","netreconlab"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.buymeacoffee.com/cbaker6"}},"created_at":"2022-10-22T13:25:41.000Z","updated_at":"2024-10-12T22:05:00.000Z","dependencies_parsed_at":"2023-09-24T22:16:24.720Z","dependency_job_id":"2d927efb-557a-4c1e-991d-8b6f60c96b9d","html_url":"https://github.com/netreconlab/Parse-Swift","commit_stats":{"total_commits":384,"total_committers":20,"mean_commits":19.2,"dds":"0.14322916666666663","last_synced_commit":"ad1cad2ee9925ee778f4fb7d840e2fc2e84799d8"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParse-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParse-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParse-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParse-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netreconlab","download_url":"https://codeload.github.com/netreconlab/Parse-Swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243070399,"owners_count":20231444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","apple","authentication","baas","cocoapods","hacktoberfest","ios","linux","livequery","parse","parse-platform","parse-server","parse-swift","query","rest-api","sdk","spm","swift","swift-package-manager","visionos"],"created_at":"2024-07-29T19:22:07.565Z","updated_at":"2025-03-11T16:32:02.078Z","avatar_url":"https://github.com/netreconlab.png","language":"Swift","funding_links":["https://github.com/sponsors/cbaker6","https://github.com/sponsors/netreconlab","https://www.buymeacoffee.com/cbaker6"],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable --\u003e\n![parse-swift](https://user-images.githubusercontent.com/8621344/204069535-e1882bb0-bbcb-4178-87e6-58fd1bed96d1.png)\n\n\u003ch3 align=\"center\"\u003eiOS · macOS · watchOS · tvOS · visionOS · Linux · Android · Windows\u003c/h3\u003e\n\n\u003ch4 align=\"center\"\u003e\n⭐️ ParseSwift was highlighted in \u003ca href=\"https://iosdevweekly.com/issues/560#start\" target=\"_blank\"\u003e issue #560\u003c/a\u003e of \u003ca href=\"https://iosdevweekly.com\" target=\"_blank\"\u003e iOS Dev Weekly\u003c/a\u003e and discussed in \u003ca href=\"https://blog.swiftpackageindex.com/posts/swift-package-indexing-episode-5/\" target=\"_blank\"\u003e episode 5\u003c/a\u003e of \u003ca href=\"https://swiftpackageindexing.transistor.fm\" target=\"_blank\"\u003eSwift Package Index Twitter Spaces\u003c/a\u003e \u003c/h3\u003e\n\n---\n\n[![Playgrounds](https://img.shields.io/badge/swift-playgrounds-2196f3.svg)](https://github.com/netreconlab/Parse-Swift/tree/main/ParseSwift.playground/Pages)\n[![Documentation](https://img.shields.io/badge/read_-docs-2196f3.svg)](https://swiftpackageindex.com/netreconlab/Parse-Swift/documentation)\n[![Tutorial](https://img.shields.io/badge/read_-tutorials-2196f3.svg)](https://netreconlab.github.io/Parse-Swift/release/tutorials/parseswift/)\n[![Build Status CI](https://github.com/netreconlab/Parse-Swift/workflows/ci/badge.svg?branch=main)](https://github.com/netreconlab/Parse-Swift/actions?query=workflow%3Aci+branch%3Amain)\n[![Build Status Release](https://github.com/netreconlab/Parse-Swift/workflows/release/badge.svg)](https://github.com/netreconlab/Parse-Swift/actions?query=workflow%3Arelease)\n[![Coverage](https://codecov.io/gh/netreconlab/Parse-Swift/branch/main/graph/badge.svg)](https://app.codecov.io/gh/netreconlab/Parse-Swift/branch/main)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/403b74d0f2514e288b0a1b2e52b6d841)](https://www.codacy.com/gh/netreconlab/Parse-Swift/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=netreconlab/Parse-Swift\u0026amp;utm_campaign=Badge_Grade)\n[![Pod](https://img.shields.io/cocoapods/v/ParseSwiftOG.svg)](https://cocoapods.org/pods/ParseSwiftOG)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)][license-link]\n[![Swift Versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FParse-Swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/netreconlab/Parse-Swift)\n[![Platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FParse-Swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/netreconlab/Parse-Swift)\n\n---\n\nA pure Swift library that gives you access to the powerful Parse Server backend. See why ParseSwift\u003csup\u003eOG\u003c/sup\u003e is better than all of the other Parse SDK's by reviewing the [feature comparison tables](https://github.com/netreconlab/Parse-Swift/discussions/72). \n\nThe ParseSwift\u003csup\u003eOG\u003c/sup\u003e SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP)](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) and [value types](https://www.youtube.com/watch?v=A_b2oCBmm2Y) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift\u003csup\u003eOG\u003c/sup\u003e, visit the [api documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/documentation).\n\n\u003e :information_source: **Why Choose ParseSwift\u003csup\u003eOG\u003c/sup\u003e Over parse-community/Parse-Swift?** \u003cbr\u003e\n\u003e This repo is maintained by [Corey E. Baker](https://github.com/cbaker6), [1 of 2 of the original developers of ParseSwift](https://github.com/parse-community/Parse-Swift/graphs/contributors). Corey was responsible for the direction and development of all parse-community releases of ParseSwift from [1.0.0](https://github.com/parse-community/Parse-Swift/releases/tag/4.14.2) to [4.14.2](https://github.com/parse-community/Parse-Swift/releases/tag/4.14.2). ParseSwift\u003csup\u003eOG\u003c/sup\u003e has the most up-to-date features and bug fixes to develop client and server-side applications. It is the most flexible Parse Client SDK to date, can be used to write [Cloud Code](https://github.com/netreconlab/parse-server-swift), and is developed with zero dependencies. This repo is aligned with the original core principals of a swifty framework. Star, watch, and submit [questions](https://github.com/netreconlab/Parse-Swift/discussions), [issues](https://github.com/netreconlab/Parse-Swift/issues), and [pull requests](https://github.com/netreconlab/Parse-Swift/pulls) to [NetReconLab ParseSwift\u003csup\u003eOG\u003c/sup\u003e](https://github.com/netreconlab/Parse-Swift) instead of the parse-community ParseSwift to support it's development. Learn how to seemlessly migrate your apps from parse-community to ParseSwift\u003csup\u003eOG\u003c/sup\u003e by reading the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/70). For more details about why ParseSwift\u003csup\u003eOG\u003c/sup\u003e exists, see the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/7). If you benefit from ParseSwift and would like to show monetary support, feel free to: \u003cbr\u003e\n\u003ca href=\"https://www.buymeacoffee.com/cbaker6\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\n## Contributors\nDevelopers who dedicate their time and effort are who make this repo possible!\n\n\u003ca href=\"https://github.com/netreconlab/Parse-Swift/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=netreconlab/Parse-Swift\" /\u003e\n\u003c/a\u003e\n\n---\n\n- [Why use ParseSwift\u003csup\u003eOG\u003c/sup\u003e from NetReconLab?](https://github.com/netreconlab/Parse-Swift/discussions/7)\n- [Contributors](#contributors)\n- [Example Apps and Frameworks](#example-apps-and-frameworks)\n- [Test Drive Parse-Swift](#test-drive-parse-swift)\n- [Installation](#installation)\n  - [Swift Package Manager](#swift-package-manager)\n  - [CocoaPods](#cocoapods)\n- [Usage Guide](#usage-guide)\n- [LiveQuery](#livequery)\n  - [Setup Server](#setup-server)\n  - [Use Client](#use-client)\n    - [SwiftUI View Models Using Combine](#swiftui-view-models-using-combine)\n    - [Traditional Callbacks](#traditional-callbacks)\n  - [Advanced Usage](#advanced-usage)\n- [Migrating from Older Versions and SDKs](#migrating-from-older-versions-and-sdks)\n\n## Example Apps and Frameworks\nBelow is a list of apps and frameworks that use ParseSwift\u003csup\u003eOG\u003c/sup\u003e to help developers take advantage of the framework:\n- [ParseServerSwift](https://github.com/netreconlab/parse-server-swift) - Write Parse Cloud Code in Swift using ParseSwift\u003csup\u003eOG\u003c/sup\u003e\n- [ParseServerAnyAnalytics](https://github.com/netreconlab/parse-server-any-analytics-adapter) - Analytics adapter to connect Parse Server analytics to any 3rd party analytics tool\n- [CarekitSampe-ParseCareKit](https://github.com/netreconlab/CareKitSample-ParseCareKit) - An example application of [CareKit](https://github.com/carekit-apple/CareKit)'s OCKSample synchronizing CareKit data to the Cloud via [ParseCareKit](https://github.com/netreconlab/ParseCareKit)\n- [ParseCareKit](https://github.com/netreconlab/ParseCareKit) - Synchronize CareKit 2.1+ data with a parse-server using ParseSwift\u003csup\u003eOG\u003c/sup\u003e\n- [SnapCat](https://github.com/netreconlab/SnapCat) - SnapCat is a social media application for posting pictures, comments, and finding friends. SnapCat is designed using SwiftUI and the ParseSwift\u003csup\u003eOG\u003c/sup\u003e SDK\n- [ParseMigrateKeychain](https://github.com/netreconlab/ParseMigrateKeychain) - A sample app that demonstrates how to migrate an app written with the Parse [Objective-C SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) to the ParseSwift\u003csup\u003eOG\u003c/sup\u003e SDK. Learn more, see the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/71).\n\n## Test Drive Parse-Swift\nTo learn how to use or experiment with ParseSwift\u003csup\u003eOG\u003c/sup\u003e, you can run and edit the [ParseSwift.playground](https://github.com/netreconlab/Parse-Swift/tree/main/ParseSwift.playground/Pages). You can use the parse-server in [this repo](https://github.com/netreconlab/parse-hipaa/tree/parse-swift) which has docker compose files (`docker-compose up` gives you a working server) configured to connect with the playground files, has [Parse Dashboard](https://github.com/parse-community/parse-dashboard), and can be used with MongoDB or PostgreSQL. You can also configure the Swift Playgrounds to work with your own Parse Server by editing the configuation in [Common.swift](https://github.com/netreconlab/Parse-Swift/blob/e9ba846c399257100b285d25d2bd055628b13b4b/ParseSwift.playground/Sources/Common.swift#L4-L19). To learn more, see this [discussion](https://github.com/netreconlab/Parse-Swift/discussions/74) or [CONTRIBUTING.md](https://github.com/netreconlab/Parse-Swift/blob/main/CONTRIBUTING.md#swift-playgrounds).\n\n## Installation\n\n### [Swift Package Manager](https://swift.org/package-manager/)\n\nYou can use The Swift Package Manager (SPM) to install ParseSwift\u003csup\u003eOG\u003c/sup\u003e by adding the following description to your `Package.swift` file:\n\n```swift\n// swift-tools-version:5.5.2\nimport PackageDescription\n\nlet package = Package(\n    name: \"YOUR_PROJECT_NAME\",\n    dependencies: [\n        .package(url: \"https://github.com/netreconlab/Parse-Swift\", .upToNextMajor(from: \"5.10.3\"))\n    ],\n    targets: [\n        .target(\n            name: \"YOUR_PROJECT_NAME\",\n            dependencies: [\n                .product(name: \"ParseSwift\", package: \"Parse-Swift\")\n            ]\n        ),\n        .testTarget(\n            name: \"YOUR_PROJECT_NAMETests\",\n            dependencies: [\"YOUR_PROJECT_NAME\"]\n        )\n    ]\n)\n```\nThen run `swift build`. \n\nYou can also install using SPM in your Xcode project by going to \n\"Project-\u003eNameOfYourProject-\u003eSwift Packages\" and placing `https://github.com/netreconlab/Parse-Swift.git` in the \nsearch field.\n\n### [CocoaPods](https://cocoapods.org)\n\nAdd the following line to your Podfile:\n\n```ruby\npod 'ParseSwiftOG'\n```\n\nTo link to the latest updates on the main branch, add the following line to your Podfile:\n\n```ruby\npod 'ParseSwiftOG', :git =\u003e 'https://github.com/netreconlab/Parse-Swift.git', :branch =\u003e 'main'\n```\n\nIn your projects, use:\n\n```swift\nimport ParseSwiftOG\n```\n\n## Usage Guide\n\nAfter installing ParseSwift\u003csup\u003eOG\u003c/sup\u003e, to use it first `import ParseSwift` in your AppDelegate.swift and then add the following code in your `application:didFinishLaunchingWithOptions:` method:\n```swift\ntry await ParseSwift.initialize(applicationId: \"xxxxxxxxxx\", clientKey: \"xxxxxxxxxx\", serverURL: URL(string: \"https://example.com\")!)\n```\nPlease checkout the [Swift Playground](https://github.com/netreconlab/Parse-Swift/tree/main/ParseSwift.playground/Pages) for more usage information.\n\n## LiveQuery\n\n`Query` is one of the key concepts on the Parse Platform. It allows you to retrieve `ParseObject`s by specifying some conditions, making it easy to build apps such as a dashboard, a todo list or even some strategy games. However, `Query` is based on a pull model, which is not suitable for apps that need real-time support.\n\nSuppose you are building an app that allows multiple users to edit the same file at the same time. `Query` would not be an ideal tool since you can not know when to query from the server to get the updates.\n\nTo solve this problem, we introduce Parse LiveQuery. This tool allows you to subscribe to a `Query` you are interested in. Once subscribed, the server will notify clients whenever a `ParseObject` that matches the `Query` is created or updated, in real-time.\n\n### Setup Server\n\nParse LiveQuery contains two parts, the LiveQuery server and the LiveQuery clients (this SDK). In order to use live queries, you need to at least setup the server.\n\nThe easiest way to setup the LiveQuery server is to make it run with the [Open Source Parse Server](https://github.com/ParsePlatform/parse-server/wiki/Parse-LiveQuery#server-setup).\n\n\n### Use Client\n\n#### SwiftUI View Models Using Combine\n\nThe LiveQuery client interface is based around the concept of `Subscription`s. You can register any `Query` for live updates from the associated live query server and use the query as a view model for a SwiftUI view by simply using the `subscribe` property of a query: https://github.com/netreconlab/Parse-Swift/blob/0c17c781a211299f324753fa9bcbb6845c22fad2/ParseSwift.playground/Pages/19%20-%20SwiftUI%20-%20LiveQuery.xcplaygroundpage/Contents.swift#L66-L125\n\nor by calling the `subscribe(_ client: ParseLiveQuery)` method of a query. If you want to customize your view model more you can subclass `Subscription` or add the subscription to your own view model. You can test out LiveQuery subscriptions in [Swift Playgrounds](https://github.com/netreconlab/Parse-Swift/blob/main/ParseSwift.playground/Pages/19%20-%20SwiftUI%20-%20LiveQuery.xcplaygroundpage/Contents.swift).\n\n#### Traditional Callbacks\n\nYou can also use asynchronous call backs to subscribe to a LiveQuery: \n\n```swift\nlet myQuery = Message.query(\"from\" == \"parse\")\ndo {\n  let subscription = try await myQuery.subscribeCallback()\n} catch {\n    print(\"Error subscribing...\")\n}\n```\n\nor by calling the `subscribeCallback(_ client: ParseLiveQuery)` method of a query.\n\nWhere `Message` is a ParseObject.\n\nOnce you've subscribed to a query, you can `handle` events on them, like so:\n\n```swift\nsubscription.handleSubscribe { subscribedQuery, isNew in\n\n    //Handle the subscription however you like.\n    if isNew {\n        print(\"Successfully subscribed to new query \\(subscribedQuery)\")\n    } else {\n        print(\"Successfully updated subscription to new query \\(subscribedQuery)\")\n    }\n}\n```\n\nYou can handle any event for LiveQuery [docs](https://swiftpackageindex.com/netreconlab/parse-swift/main/documentation/parseswift/event):\n```swift\nsubscription.handleEvent { _, event in\n    // Called whenever an object was created\n    switch event {\n\n    case .entered(let object):\n        print(\"Entered: \\(object)\")\n    case .left(let object):\n        print(\"Left: \\(object)\")\n    case .created(let object):\n        print(\"Created: \\(object)\")\n    case .updated(let object):\n        print(\"Updated: \\(object)\")\n    case .deleted(let object):\n        print(\"Deleted: \\(object)\")\n    }\n}\n```\n\nSimiliarly, you can unsubscribe and register to be notified when it occurs:\n```swift\nsubscription.handleUnsubscribe { query in\n    print(\"Unsubscribed from \\(query)\")\n}\n\n//: To unsubscribe from your query.\ndo {\n    try await query.unsubscribe()\n} catch {\n    print(error)\n}\n```\n\nHandling errors is and other events is similar, take a look at the `Subscription` class for more information. You can test out LiveQuery subscriptions in [Swift Playgrounds](https://github.com/netreconlab/Parse-Swift/blob/main/ParseSwift.playground/Pages/11%20-%20LiveQuery.xcplaygroundpage/Contents.swift).\n\n### Advanced Usage\n\nYou are not limited to a single Live Query Client - you can create multiple instances of `ParseLiveQuery`, use certificate authentication and pinning, receive metrics about each client connection, connect to individual server URLs, and more.\n\n[license-link]: LICENSE\n\n## Migrating from Older Versions and SDKs\n\n1. See the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/74) to learn how to migrate from ParseSwift\u003csup\u003eOG\u003c/sup\u003e 4.15.0+ to 5.1.1+\n1. See the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/70) to learn how to migrate from [parse-community/Parse-Swift](https://github.com/parse-community/Parse-Swift)\n1. See the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/71) to learn how to migrate from [Parse-SDK-iOS-OSX](https://github.com/parse-community/Parse-SDK-iOS-OSX)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetreconlab%2FParse-Swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetreconlab%2FParse-Swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetreconlab%2FParse-Swift/lists"}