GithubHelp home page GithubHelp logo

jawadsrour20 / swiftuix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swiftuix/swiftuix

0.0 0.0 0.0 2.41 MB

Extensions and additions to the standard SwiftUI library.

License: MIT License

Swift 99.88% Ruby 0.12%

swiftuix's Introduction

SwiftUIX

CI

SwiftUIX attempts to fill the gaps of the still nascent SwiftUI framework, providing an extensive suite of components, extensions and utilities to complement the standard library. This project is by far the most complete port of missing UIKit/AppKit functionality, striving to deliver it in the most Apple-like fashion possible.

Why

The goal of this project is to complement the SwiftUI standard library, offering hundreds of extensions and views that empower you, the developer, to build applications with the ease promised by the revolution that is SwiftUI.

Requirements

  • iOS 13, macOS 10.15, tvOS 13, or watchOS 6
  • Swift 5.5+
  • Xcode 13.0+

Installation

The preferred way of installing SwiftUIX is via the Swift Package Manager.

Xcode 11 integrates with libSwiftPM to provide support for iOS, watchOS, macOS and tvOS platforms.

  1. In Xcode, open your project and navigate to FileSwift PackagesAdd Package Dependency...
  2. Paste the repository URL (https://github.com/SwiftUIX/SwiftUIX) and click Next.
  3. For Rules, select Branch (with branch set to master).
  4. Click Finish.
  5. Open the Project settings, add SwiftUI.framework to the Linked Frameworks and Libraries, set Status to Optional.

Contents

All documentation is available via the repository wiki.

While the project itself is stable and heavily being used in production, its documentation is work-in-progress. Contributions are encouraged and welcomed.

UIKit → SwiftUI

UIKit SwiftUI SwiftUIX
LPLinkView - LinkPresentationView
UIActivityIndicatorView - ActivityIndicator
UIActivityViewController - AppActivityView
UIBlurEffect - BlurEffectView
UICollectionView - CollectionView
UIDeviceOrientation - DeviceLayoutOrientation
UIImagePickerController - ImagePicker
UIPageViewController - PaginationView
UIScreen - Screen
UISearchBar - SearchBar
UIScrollView ScrollView CocoaScrollView
UISwipeGestureRecognizer - SwipeGestureOverlay
UITableView List CocoaList
UITextField TextField CocoaTextField
UIModalPresentationStyle - ModalPresentationStyle
UIViewControllerTransitioningDelegate - UIHostingControllerTransitioningDelegate
UIVisualEffectView - VisualEffectView
UIWindow - WindowOverlay

Activity

  • ActivityIndicator

    ActivityIndicator()
        .animated(true)
        .style(.large)
    
  • AppActivityView - a SwiftUI port for UIActivityViewController.

    AppActivityView(activityItems: [...])
        .excludeActivityTypes([...])
        .onCancel { }
        .onComplete { result in
            foo(result)
        }

Appearance

  • View/visible(_:) - Sets a view's visibility.

Error Handling

  • TryButton - A button capable of performing throwing functions.

Geometry

  • flip3D(_:axis:reverse:) - Flips this view.
  • RectangleCorner - A corner of a Rectangle.
  • ZeroSizeView - A zero-size view for when EmptyView just doesn't work.

Keyboard

  • Keyboard - An object representing the keyboard.
  • View/padding(.keyboard) - Pads this view with the active system height of the keyboard.

Link Presentation:

  • LinkPresentationView

    LinkPresentationView(url: url)
        .frame(height: 192)

Navigation

  • View/navigationBarColor(_:) - Configures the color of the navigation bar for this view.
  • View/navigationBarTranslucent(_:) - Configures the translucency of the navigation bar for this view.
  • View/navigationBarTransparent(_:) - Configures the transparency of the navigation bar for this view.

Pagination

  • PaginationView

    PaginationView(axis: .horizontal) {
        ForEach(0..<10, id: \.hashValue) { index in
            Text(String(index))
        }
    }
    .currentPageIndex($...)
    .pageIndicatorAlignment(...)
    .pageIndicatorTintColor(...)
    .currentPageIndicatorTintColor(...)

Scrolling

  • View/isScrollEnabled(_:) - Adds a condition that controls whether users can scroll within this view. Works with:

    • CocoaList
    • CocoaScrollView
    • CollectionView
    • TextView

    Does not work with SwiftUI's ScrollView.

Search

  • SearchBar - A SwiftUI port for UISearchBar.

    struct ContentView: View {
        @State var isEditing: Bool = false
        @State var searchText: String = ""
        
        var body: some View {
            SearchBar("Search...", text: $searchText, isEditing: $isEditing)
                .showsCancelButton(isEditing)
                .onCancel { print("Canceled!") }
        }
    }
  • View/navigationSearchBar(_:) - Sets the navigation search bar for this view.

    Text("Hello, world!")
        .navigationSearchBar {
            SearchBar("Placeholder", text: $text)
        }
  • View/navigationSearchBarHiddenWhenScrolling(_:) - Hides the integrated search bar when scrolling any underlying content.

Screen

  • Screen - A representation of the device's screen.
  • UserInterfaceIdiom - A SwiftUI port for UIUserInterfaceIdiom.
  • UserInterfaceOrientation - A SwiftUI port for UserInterfaceOrientation.

Scroll

  • ScrollIndicatorStyle - A type that specifies the appearance and interaction of all scroll indicators within a view hierarchy
    • HiddenScrollViewIndicatorStyle - A scroll indicator style that hides all scroll view indicators within a view hierarchy.

Status Bar

  • View/statusItem(id:image:) - Adds a status bar item configured to present a popover when clicked

    Text("Hello, world!")
        .statusItem(id: "foo", image: .system(.exclamationmark)) {
            Text("Popover!")
                .padding()
        }

Text

  • TextView

    TextView("placeholder text", text: $text, onEditingChanged: { editing in
        print(editing)
    })

Visual Effects

  • VisualEffectBlurView - A blur effect view that expands to fill.

    VisualEffectBlurView(blurStyle: .dark)
        .edgesIgnoringSafeArea(.all)

Window

  • View/windowOverlay(isKeyAndVisible:content:) - Makes a window key and visible when a given condition is true.

Contributing

SwiftUIX welcomes contributions in the form of GitHub issues and pull-requests. Please refer the projects section before raising a bug or feature request, as it may already be under progress.

To create an Xcode project for SwiftUIX run bundle install; bundle exec fastlane generate_xcodeproj. To check the automated builds for SwiftUIX run bundle install; bundle exec fastlane build.

License

SwiftUIX is licensed under the MIT License.

Support

SwiftUIX is and will always be free and open. Maintaining SwiftUIX, however, is a time-consuming endeavour. If you're reliant on SwiftUIX for your app/project and would like to see it grow, consider contributing/donating as way to help.

Credits

SwiftUIX is a project of @vmanot.

swiftuix's People

Contributors

vmanot avatar brett-best avatar siddarthgandhi avatar jevonmao avatar coledunsby avatar mufasayc avatar adarovsky avatar lorenzofiamingo avatar dadalar avatar benlmyers avatar yosshi4486 avatar fampayyc avatar steipete avatar moriquendi avatar overcot avatar zsy78191 avatar traleven avatar emmavvv avatar dscyrescotti avatar zeveisenberg avatar touyu avatar vicky-ghost avatar naeemshaikh90 avatar maximkrouk avatar mattecarra avatar mrackwitz avatar marcprux avatar jonewang avatar benjaminfox avatar basthomas 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.