Convert Figma logo to code with AI

parse-community logoParse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)

2,811
873
2,811
46

Top Related Projects

Bolts is a collection of low-level libraries designed to make developing mobile apps easier.

Firebase SDK for Apple App Development

Realm is a mobile database: a replacement for Core Data & SQLite

40,982

Elegant HTTP Networking in Swift

A delightful networking framework for iOS, macOS, watchOS, and tvOS.

Quick Overview

The Parse-SDK-iOS-OSX is an open-source SDK for iOS and macOS that provides a way to interact with Parse Server, a backend-as-a-service platform. It offers a comprehensive set of tools for building applications with features like data storage, user authentication, push notifications, and more, all while abstracting away the complexities of server-side operations.

Pros

  • Easy integration with iOS and macOS applications
  • Comprehensive feature set including data persistence, user management, and real-time updates
  • Active community support and regular updates
  • Seamless migration path from Parse.com to self-hosted Parse Server

Cons

  • Learning curve for developers new to Parse ecosystem
  • Dependency on Parse Server backend, which may not suit all project requirements
  • Limited customization options for complex backend logic compared to building a custom server
  • Potential performance overhead for very large-scale applications

Code Examples

  1. Saving an object to Parse:
let gameScore = PFObject(className: "GameScore")
gameScore["score"] = 1337
gameScore["playerName"] = "Sean Plott"
gameScore["cheatMode"] = false

gameScore.saveInBackground { (success, error) in
    if success {
        print("Object saved!")
    } else {
        print("Error: \(error?.localizedDescription ?? "Unknown error")")
    }
}
  1. Querying objects from Parse:
let query = PFQuery(className: "GameScore")
query.whereKey("playerName", equalTo: "Sean Plott")
query.findObjectsInBackground { (objects, error) in
    if let objects = objects {
        print("Successfully retrieved \(objects.count) scores.")
    } else {
        print("Error: \(error?.localizedDescription ?? "Unknown error")")
    }
}
  1. User authentication:
PFUser.logInWithUsername(inBackground: "myUsername", password: "myPassword") { (user, error) in
    if let user = user {
        print("User logged in successfully")
    } else {
        print("Error: \(error?.localizedDescription ?? "Unknown error")")
    }
}

Getting Started

  1. Install the SDK using CocoaPods. Add to your Podfile:

    pod 'Parse'
    
  2. Run pod install in your project directory.

  3. Import Parse in your Swift file:

    import Parse
    
  4. Initialize Parse in your AppDelegate:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let configuration = ParseClientConfiguration {
            $0.applicationId = "YOUR_APP_ID"
            $0.clientKey = "YOUR_CLIENT_KEY"
            $0.server = "https://YOUR_PARSE_SERVER_URL/parse"
        }
        Parse.initialize(with: configuration)
        return true
    }
    

Now you're ready to use Parse in your iOS or macOS application!

Competitor Comparisons

Bolts is a collection of low-level libraries designed to make developing mobile apps easier.

Pros of Bolts-ObjC

  • Lightweight and focused on asynchronous programming
  • Can be used independently of Parse SDK
  • Provides a simple and efficient way to handle tasks and promises

Cons of Bolts-ObjC

  • Limited functionality compared to the full Parse SDK
  • Requires more manual setup for Parse-specific features
  • May need additional libraries for comprehensive app development

Code Comparison

Bolts-ObjC:

BFTask *task = [BFTask taskWithResult:@"Hello"];
[task continueWithBlock:^id(BFTask *t) {
    NSString *result = t.result;
    NSLog(@"%@", result);
    return nil;
}];

Parse-SDK-iOS-OSX:

PFObject *gameScore = [PFObject objectWithClassName:@"GameScore"];
gameScore[@"score"] = @1337;
gameScore[@"playerName"] = @"Sean Plott";
[gameScore saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
    if (succeeded) {
        NSLog(@"Object saved!");
    }
}];

The Bolts-ObjC example demonstrates its focus on task handling, while the Parse-SDK-iOS-OSX example shows how it simplifies working with Parse objects and data storage. Parse-SDK-iOS-OSX provides a higher-level abstraction for Parse-specific operations, making it easier to work with the Parse backend, while Bolts-ObjC offers more general-purpose asynchronous programming tools.

Firebase SDK for Apple App Development

Pros of Firebase-iOS-SDK

  • More comprehensive suite of services, including real-time database, authentication, and analytics
  • Stronger backing and support from Google, ensuring long-term maintenance and updates
  • Seamless integration with other Google Cloud services

Cons of Firebase-iOS-SDK

  • Potentially higher learning curve due to the broader range of features
  • Less flexibility in terms of self-hosting and customization compared to Parse
  • Vendor lock-in to Google's ecosystem

Code Comparison

Parse-SDK-iOS-OSX:

let object = PFObject(className: "MyClass")
object["key"] = "value"
object.saveInBackground { (success, error) in
    if success {
        print("Object saved!")
    }
}

Firebase-iOS-SDK:

let db = Firestore.firestore()
db.collection("myCollection").addDocument(data: [
    "key": "value"
]) { err in
    if let err = err {
        print("Error adding document: \(err)")
    } else {
        print("Document added!")
    }
}

Both SDKs offer straightforward ways to save data, but Firebase uses a more document-oriented approach with Firestore, while Parse uses a more traditional object-oriented model.

Realm is a mobile database: a replacement for Core Data & SQLite

Pros of realm-swift

  • Offers offline-first capabilities, allowing seamless data synchronization
  • Provides a more intuitive object-oriented API for data modeling
  • Faster performance for complex queries and large datasets

Cons of realm-swift

  • Steeper learning curve compared to Parse-SDK-iOS-OSX
  • Less flexibility in terms of backend options (primarily designed for MongoDB)
  • Requires more setup and configuration for cloud synchronization

Code Comparison

Parse-SDK-iOS-OSX:

let gameScore = PFObject(className: "GameScore")
gameScore["score"] = 1337
gameScore["playerName"] = "Sean Plott"
gameScore.saveInBackground { (success, error) in
    if success {
        print("Score saved successfully")
    } else {
        print("Error saving score: \(error?.localizedDescription ?? "")")
    }
}

realm-swift:

let realm = try! Realm()
try! realm.write {
    let gameScore = GameScore()
    gameScore.score = 1337
    gameScore.playerName = "Sean Plott"
    realm.add(gameScore)
}

The realm-swift example demonstrates a more concise and object-oriented approach to data persistence, while Parse-SDK-iOS-OSX uses a key-value coding style. Realm's API is more intuitive for developers familiar with Swift's syntax, but Parse offers a simpler setup for cloud-based backends.

40,982

Elegant HTTP Networking in Swift

Pros of Alamofire

  • More lightweight and focused specifically on networking tasks
  • Extensive community support and frequent updates
  • Easier to integrate into existing projects without a full backend solution

Cons of Alamofire

  • Lacks built-in data persistence and user management features
  • Requires more manual setup for complex backend operations
  • No out-of-the-box support for real-time data synchronization

Code Comparison

Parse-SDK-iOS-OSX:

let object = PFObject(className: "MyClass")
object["key"] = "value"
object.saveInBackground { (success, error) in
    if success {
        print("Object saved!")
    }
}

Alamofire:

AF.request("https://api.example.com/data", method: .post, parameters: ["key": "value"])
    .responseDecodable(of: MyResponse.self) { response in
        switch response.result {
        case .success(let value):
            print("Response: \(value)")
        case .failure(let error):
            print("Error: \(error)")
        }
    }

The Parse SDK provides a higher-level abstraction for working with backend data, including built-in object persistence and querying. Alamofire, on the other hand, offers more flexibility for custom networking tasks but requires additional setup for data management and persistence. Parse SDK is better suited for rapid development of apps with complex backend requirements, while Alamofire is ideal for projects that need fine-grained control over network operations.

A delightful networking framework for iOS, macOS, watchOS, and tvOS.

Pros of AFNetworking

  • More lightweight and focused on networking tasks
  • Offers greater flexibility for custom network operations
  • Widely adopted and battle-tested in many iOS applications

Cons of AFNetworking

  • Requires more manual setup for backend operations
  • Lacks built-in support for user authentication and data persistence
  • May require additional libraries for complete backend functionality

Code Comparison

Parse-SDK-iOS-OSX:

let object = PFObject(className: "MyClass")
object["key"] = "value"
object.saveInBackground { (success, error) in
    if success {
        print("Object saved!")
    }
}

AFNetworking:

let manager = AFHTTPSessionManager()
manager.post("https://api.example.com/endpoint", parameters: ["key": "value"]) { response, data, error in
    if error == nil {
        print("Request successful!")
    }
}

The Parse SDK provides a higher-level abstraction for working with backend data, while AFNetworking offers more granular control over network requests. Parse SDK is better suited for rapid development with built-in backend services, whereas AFNetworking is ideal for custom networking solutions in iOS applications.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

parse-repository-header-sdk-apple

iOS · iPadOS · macOS · watchOS · tvOS


Build Status CI Build Status Release Snyk Badge Coverage auto-release

iOS iPad macOS watchOS tvOS

SPM

Backers on Open Collective Sponsors on Open Collective License Forum Twitter Chat


A library that gives you access to the powerful Parse Server backend from your iOS, iPadOS, macOS, watchOS and tvOS app. For more information about the Parse Platform and its features, see the public documentation.


Getting Started

The easiest way to install the SDK is via Swift Package Manager.

  1. Open Xcode > File > Add packages...
  2. Add the following package URL:
https://github.com/parse-community/Parse-SDK-iOS-OSX
  1. Add package
  2. Choose the submodules you want to install

Take a look at the public documentation & API and start building.

How Do I Contribute?

We want to make contributing to this project as easy and transparent as possible. Please refer to the Contribution Guidelines.

Dependencies

We use the following libraries as dependencies inside of Parse:

  • Bolts, for task management.
  • OCMock, for unit testing.