Coder Social home page Coder Social logo

scomponents's Introduction

SComponents

Pod Version Carthage compatible SwiftPM compatible Mac Catalyst compatible

Native SwiftUI components

๐Ÿฅ Features

  • [๐Ÿฅ] Popover
  • [] Aler
  • [] Modal

๐Ÿ’Š How To Use

Popover

You specify the content of a popover using a SwiftUI views extension method.

import SComponents

Text("My App content")
    .popover(isShowing: .constant(true)) {
        Text("popover content")
    }

Above example shows how to present a popover from a SwiftUI view, which acts as the anchor rect for the popover and floats above the main window. Popover uses the center position of that item to determine where to place and how to orient its arrow. Use popovers for app content that appears when needed and disappears when the user is finished with it. Pass your SwiftUI flag as binding under isShowing in order to show/hide popover. For example, you can use popovers to display information about the currently selected item, to display tools and configuration options, or to gather information from the user.

๐Ÿ”ง Installation

There are four ways to use SComponents in your project:

  • using CocoaPods
  • using Carthage
  • using Swift Package Manager
  • manual install (build frameworks or embed Xcode Project)

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the Get Started section for more details.

Podfile

platform :ios, '13.0'
pod 'SComponents'
Swift and static framework

Swift project previously had to use use_frameworks! to make all Pods into dynamic framework to let CocoaPods work.

However, starting with CocoaPods 1.5.0+ (with Xcode 9+), which supports to build both Objective-C && Swift code into static framework. You can use modular headers to use SComponents as static framework, without the need of use_frameworks!:

platform :ios, '13.0'
# Uncomment the next line when you want all Pods as static framework
# use_modular_headers!
pod 'SComponents', :modular_headers => true

See more on CocoaPods 1.5.0 โ€” Swift Static Libraries

If not, you still need to add use_frameworks! to use SComponents as dynamic framework:

platform :ios, '13.0'
use_frameworks!
pod 'SComponents'

Installation with Carthage

Carthage is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods.

To install with carthage, follow the instruction on Carthage

Carthage users can point to this repository and use generated framework

Make the following entry in your Cartfile: github "SComponents/SComponents" Then run carthage update If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained over at Carthage.

Installation with Swift Package Manager

Swift Package Manager (SwiftPM) is a tool for managing the distribution of Swift code as well as C-family dependency.

Click File -> Swift Packages -> Add Package Dependency, enter SComponents repo's URL. Or you can login Xcode with your GitHub account and just type SComponents to search.

After select the package, you can choose the dependency type (tagged version, branch or commit). Then Xcode will setup all the stuff for you.

If you're a framework author and use SComponents as a dependency, update your Package.swift file:

let package = Package(
    dependencies: [
        .package(url: "https://github.com/shial4/SComponents.git", from: "0.0.1")
    ],
    //...
)

โญ Contributing

Be welcome to contribute to this project! :)

โ“ Questions

Just create an issue on GitHub.

๐Ÿ“ License

This project was released under the MIT license.

scomponents's People

Contributors

shial4 avatar

Watchers

 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.