Giter Club home page Giter Club logo

simformsolutionspvtltd / ssstorystatus Goto Github PK

View Code? Open in Web Editor NEW
28.0 4.0 0.0 2.13 MB

SSStoryStatus: Elevate your SwiftUI projects with seamless user list integration and captivating story displays. Empowering developers with effortless integration and complete UI customization, this versatile library makes showcasing stories a breeze.

License: MIT License

Swift 98.89% Ruby 1.11%
control custom-control customization ios status story storytelling swiftui swiftui-learning story-status

ssstorystatus's Introduction

SSStoryStatus

SSStoryStatus

Swift Compatibility-badge Platform Compatibility-badge Release-badge License Badge-badge Pod Version-badge SPM Compatible-badge

SSStoryStatus is a versatile and intuitive SwiftUI library designed to effortlessly display user lists and seamlessly showcase their captivating stories. This library empowers developers to effortless integration of user listings with story viewing functionality. This library provides complete control over view components for UI customization.

Profile Listing Story View Message & Reaction

Features

  • Image & Video stories
  • Customizable component with styles
  • Built-in caching support
  • Callback on story seen
  • Reaction emojis and message
  • Story caption support

Requirements

  • iOS 17+
  • XCode 15+
  • Swift 5.9+

Installation

Swift Package Manager

You can install SSStoryStaus using Swift Package Manager by:

  1. Go to Xcode -> File -> Add Package Dependencies...
  2. Add package URL https://github.com/SimformSolutionsPvtLtd/SSStoryStatus

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

Navigate to project root folder to integrate pod.

$ pod init

It will generate Podfile for your project. To integrate SSStoryStatus into your project specify it in your Podfile:

platform :ios, '17.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'SSStoryStatus'
end

Then, run the following command:

$ pod install

It will generate <Project>.xcworkspace file. From now on you should open the project using this file.

Script Sandboxing Error

If you face build error Command PhaseScriptExecution failed with a nonzero exit code then follow this steps:

Go to project Build Settings -. Search for User Script Sandboxing -> Set to No.

Refrence - User Script Sandboxing

Usage

First import required package:

import SSStoryStatus

SSStoryStatus accepts list of Users as UserModel.

let users: [UserModel] = [
    UserModel(
        id: UUID().uuidString, // Unique identifier for user (optional, uses UUID by default)
        name: "Krunal",        // Name of user
        image: "",             // URL of profile image
        stories: stories,      // List of story for this user
    )
]

UserModel accepts stories for each user as list of StoryModel.

let stories: [StoryModel] = [
    StoryModel(
        id: UUID().uuidString,  // Unique identifier for story (optional, uses UUID by default)
        mediaURL: "",           // Media url of image or video
        date: .now,             // Story creation date
        caption: "",            // Caption for the story (optional)
        mediaType: .image,      // Media type: image or video
        storyState: .seen       // Story is seen or unseen
    )
]

Now, you can pass this list of user to SSStoryStatus.

SSStoryStatus(
    users: users,            // List of users
    sorted: true,            // Whether the users should be sorted based on their seen status (default is false)
    cacheExpire: expireDate  // Date indicating cache expiration time (default is 24 hours)
)

You can listen to callback when user see any story:

SSStoryStatus(users: users)
    .onStorySeen { user, storyIndex in
        print("Seen - ", user.stories[storyIndex].mediaURL) // You can retrieve story instance using user and storyIndex
    }

When user press any emoji or reply to story you can observe it:

SSStoryStatus(users: users)
    .emoji { emoji, user, storyIndex in
        print("Selected \(emoji) for story \(user.stories[storyIndex].id)") // Emoji pressed by user
    }
    .messageField { message, user, storyIndex in
        print("Sent \(message) to \(user.name)") // Message sent
    }   

Customization

For customizing SSStoryStatus please refer Customization Guide.

Documentation

Documentation - Find the full API reference for more detailed documentation.

Find this samples useful? ❤️

Support it by joining stargazers ⭐ for this repository.

How to Contribute 🤝

Whether you're helping us fix bugs, improve the docs, or a feature request, we'd love to have you! 💪
Check out our Contributing Guide for ideas on contributing.

Bugs and Feedback

For bugs, feature feature requests, and discussion use GitHub Issues.

Other Mobile Libraries

Check out our other libraries Awesome-Mobile-Libraries.

License

Distributed under the MIT license. See LICENSE for details.

ssstorystatus's People

Contributors

bhargavbajani-simformsolutions avatar krunal-simform avatar mobile-simformsolutions avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.