It provides UI components such as popover, popup, dialog supporting iOS apps

Related tags

UI LCUIComponents
Overview



Overview

LCUIComponents is an on-going project, which supports creating transient views appearing above other content onscreen when a control is selected. Currently, the framework provides supports to simply create a customisable popover with a selectable data list.

Requirements

  • iOS 8.0+
  • Xcode 8+
  • Swift 3

Usage

The following is an example of how to create a popover. For more advanced use please check out the Sample path.

Set up a basic popover with data list

import LCUIComponents
import UIKit

class PopoverSamplesVC: UIViewController {
    
    // Create a data source
    let spiceList: [LCTuple<Int>] = [(key: 1, value:"Cinnamon"),
                                     (key: 2, value:"Cloves"),
                                     (key: 3, value:"Ginger"),
                                     (key: 4, value:"Turmeric"),
                                     (key: 5, value:"Tamarind")]
    
    @IBAction func btnPopoverTapped(_ sender: UIButton) {
        setupBasicPopover(for: sender)
    }
    
    func setupBasicPopover(for sender: UIView) {
        // Init a popover with a callback closure after selecting data
        let popover = LCPopover<Int>(for: sender, title: "Spices") { tuple in
            // Use of the selected tuple
            guard let value = tuple?.value else { return }
            print(value)
        }
        // Assign data to the dataList
        popover.dataList = spiceList
        // Present the popover
        present(popover, animated: true, completion: nil)
    }
}

Set up a custom popover with data list

func setupCustomPopover(for sender: UIView) {
    // Init a popover with a callback closure after selecting data
    let popover = LCPopover<Int>(for: sender, title: "Spices") { tuple in
        // Use of the selected tuple
        guard let value = tuple?.value else { return }
        print(value)
    }
    // Assign data to the dataList
    popover.dataList = spiceList

    // Set popover properties
    popover.size = CGSize(width: 250, height: 219)
    popover.arrowDirection = .down
    popover.backgroundColor = .orange
    popover.borderColor = .orange
    popover.borderWidth = 2
    popover.barHeight = 44
    popover.titleFont = UIFont.boldSystemFont(ofSize: 19)
    popover.titleColor = .orange
    popover.textFont = UIFont(name: "HelveticaNeue-MediumItalic", size: 17) ?? UIFont.systemFont(ofSize: 17)
    popover.textColor = .black

    // Present the popover
    present(popover, animated: true, completion: nil)
}

Installation

CocoaPods

Specify LCUIComponents into your project's Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

pod 'LCUIComponents'

Manually Embedded

Simply download and add the Popover.swift file from Source path to your project.

You might also like...
Swift Package for distributing Mozilla's Rust-based application components
Swift Package for distributing Mozilla's Rust-based application components

Swift Package for Mozilla's Rust Components This repository is a Swift Package for distributing releases of Mozilla's various Rust-based application c

NotSwiftUI is designed to help you create UI components quickly and efficiently with code!
NotSwiftUI is designed to help you create UI components quickly and efficiently with code!

NotSwiftUI NotSwiftUI is designed to help you create UI components quickly and efficiently with code! Capitalizing on the idea that most of the UI ele

A paging scroll view for SwiftUI, using internal SwiftUI components
A paging scroll view for SwiftUI, using internal SwiftUI components

PagingView A paging scroll view for SwiftUI, using internal SwiftUI components. This is basically the same as TabView in the paging mode with the inde

SwiftUI components and extensions that seem to be highly reusable

SwiftUI components and extensions that seem to be highly reusable

MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup UIPresentationController size and feel form sheet.
MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup UIPresentationController size and feel form sheet.

MZFormSheetPresentationController MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding sup

Provides an iOS view controller allowing a user to draw their signature with their finger in a realistic style.
Provides an iOS view controller allowing a user to draw their signature with their finger in a realistic style.

Swift version now available! Mimicking pen-on-paper signatures with a touch screen presents a difficult set of challenges. The rate touch events are e

RangeSeedSlider provides a customizable range slider like a UISlider.
RangeSeedSlider provides a customizable range slider like a UISlider.

RangeSeekSlider Overview RangeSeekSlider provides a customizable range slider like a UISlider. This library is based on TomThorpe/TTRangeSlider (Objec

A framework that provides CurtainController. CurtainController is a container view controller that implements a content-curtain interface. You can find a similar implementation in applications like Apple Maps, Find My, Stocks, etc. Someone calls it
ScrollViewPlus is a small library that provides some helpful extension and capabilities for working with NSScrollView.

ScrollViewPlus is a small library that provides some helpful extension and capabilities for working with NSScrollView.

Releases(1.1.5)
Owner
Linh Chu
Linh Chu
Simple selection dialog

SelectionDialog Simple selection dialog inspired from ios-custom-alertview Preview Requirements iOS 8.0+ Swift 3 Xcode 8.0 Installation CocoaPods use_

Lee Sun-Hyoup 117 Aug 5, 2022
:octocat:๐Ÿ’ง A slider widget with a popup bubble displaying the precise value selected. Swift UI library made by @Ramotion

FLUID SLIDER A slider widget with a popup bubble displaying the precise value selected written on Swift. We specialize in the designing and coding of

Ramotion 1.9k Dec 23, 2022
ToastSwiftUI-master - A simple way to show a toast or a popup in SwiftUI

ToastSwiftUI-master - A simple way to show a toast or a popup in SwiftUI

Kushal Shingote 2 May 25, 2022
๐Ÿ’พ A collection of classic-style UI components for iOS

A collection of classic-style UI components for UIKit, influenced by Windows 95 Introduction This is a little exploration into applying '90s-era desig

Blake Tsuzaki 2.2k Dec 22, 2022
Modular and customizable Material Design UI components for iOS

Material Components for iOS Material Components for iOS (MDC-iOS) helps developers execute Material Design. Developed by a core team of engineers and

Material Components 4.6k Dec 29, 2022
Material design components for iOS written in Swift

MaterialKit NOTE: This project is unmaintained. Material design components (inspired by Google Material Design) for iOS written in Swift Please feel f

Le Van Nghia 2.5k Jan 5, 2023
๐ŸŽธ๐ŸŽธ๐ŸŽธ Common categories for daily development. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV and more.

?????? Common categories for daily development. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV and more.

77ใ€‚ 423 Jan 4, 2023
Spinner loader components with liquid animation

LiquidLoader LiquidLoader is the spinner loader UI components with liquid animation, inspired by Spinner Loader - Gooey light Effect [] (https://githu

Takuma Yoshida 1.3k Dec 21, 2022
SwiftUI: Components Library Inspired by Twitter's Bootstrap

bootswiftui SwiftUI: Components Library Inspired by Twitter's Bootstrap Warning This is just SwiftUI exercise. Please do not consider using this repo

Robert Sandru 1 Oct 27, 2022
A few drop-in SwiftUI components for easily importing and thumb-nailing files

FilesUI A few drop-in SwiftUI components for easily importing and thumb-nailing files Usage 1. Import Files To import files you can use the FileImport

Brianna Zamora 3 Oct 19, 2022