axiumtech.net
  • Home
  • Privacy Policy
  • Contact Us
  • Guest Post – Write For Us
  • Sitemap
axiumtech.net

A simple and flexible UI component fully written in Swift

  • James Gussie
  • September 18, 2021
Total
0
Shares
0
0
0

This article will explore the design process behind a UI component written in Swift. The component, which is called an “AppBar”, is one of the most commonly used features in iOS apps. It’s also flexible enough to be used across many different app types and scenarios.

The swift component library is a simple and flexible UI component fully written in Swift. It has been created by the team at YC-backed startup, Avocado.

SlideController

SlideController is a simple and adaptable UI component built entirely in Swift. It’s a great alternative to UIPageViewController since it’s built using the power of generic types.

vertical

carousel

  • iOS 9.0+
  • Xcode 10.2+ is required.
  • Swift 5.0 and up

CocoaPods

CocoaPods is a Cocoa project dependency management. You may use the following command to install it:

cocoapods $ gem install

To use CocoaPods to incorporate SlideController into your Xcode project, add the following to your Podfile:

target ” do pod ‘SlideController’ end source ‘https://github.com/CocoaPods/Specs.git’ platform :ios, ‘9.0’ use frameworks!

Run the following command after that:

$ install pod

SlideController is imported.

  1. Produce content

let content = [ SlideLifeCycleObjectBuilder(), SlideLifeCycleObjectBuilder(), SlideLifeCycleObjectBuilder(), SlideLifeCycleObjectBuilder(), SlideLifeCycleObjectBuilder(), SlideLifeCycleObjectBuilder(), SlideLifeCycleObjectBuilder(), SlideLifeC

  • Any object that complies with Initializable, Viewable, and Slide is a PageLifeCycleObject. Protocols for the PageLifeCycle
  1. SlideController should be initialized.

CustomTitleView, CustomTitleItem> slideController = SlideController ( slideDirection:.horizontal, startPageIndex: 0, pagesContent: content)

  • CustomTitleView is a TitleScrollView subclass.
  • CustomTitleItem is a UIView subclass that follows the Initializable, ItemViewable, and Selectable protocols.
  1. SlideController should be added. hierarchy from view to view

  2. Make a call to slideController. slideController.viewDidDisappear() and viewDidAppear() in relevant UIViewController methods:

override the function view super.view DidAppear(_ animated: Bool) slideController.view.DidAppear(animated) DidAppear() is a function that checks if anything has appeared. override view func super.view DidDisappear(_ animated: Bool) slideController.view DidDisappear(animated) DidDisappear() is a function that checks if something has vanished.

SlideController

SlideController’s default initializer. pagesContent – the controller’s initial content, which may be empty. start PageIndex – the page index that should be shown first. slide .horizontal or.vertical is the slide direction.

public init(pagesContent: [SlideLifeCycleObjectProvidable], startPageIndex: Int = 0, slideDirection: SlideDirection), startPageIndex: Int = 0, slideDirection: SlideDirection)

Returns a TitleScrollView object named titleView.

public var titleView: T obj obj obj obj obj obj

The current page’s LifeCycleObject is returned.

currentModel: SlideLifeCycleObjectProvidable? public var currentModel: SlideLifeCycleObjectProvidable? obtain

Returns an array of LifeCycleObjects that correspond to the content of the SlideController.

var content: [SlideLifeCycleObjectProvidable] public private(set)

When set to true, content is unloaded when it reaches the edge of the screen. True is the default setting.

isContentUnloadingEnabled: public var Get ready to bool bool bool bool bool bool bool

When true is selected, scrolling in the direction of the last item results in a leap to the first item. Allows for endless scrolling. False is the default setting.

isCarousel: Bool get set public var isCarousel: Bool get set public var isCarousel: Bool get set public var is

Content scrolling is enabled if the value of this attribute is true, and it is disabled if the value is false. True is the default setting.

isScrollEnabled: Bool get set public var isScrollEnabled: Bool get set public var isScrollEnabled: Bool get set public

SlideLifeCycleObjectProvidable pages array is appended to the end of the sliding content.

append public func (object objects: [SlideLifeCycleObjectProvidable])

SlideLifeCycleObjectProvidable page object is inserted at index in the sliding content.

insert public func (object: SlideLifeCycleObjectProvidable, index: Int)

Deletes a page from the index.

removeAtIndex is a public func (index: Int)

If animated is set to true, the content is slid to the page at pageIndex with a sliding motion. Forced is not advised since it will shift even if there is another shift animation running or if pageIndex equals current page. The animated property’s default value is true. Forced is set to false by default.

pageIndex: Int, animated: Bool = default, forced: Bool = default) public func shift(pageIndex: Int, animated: Bool = default, forced: Bool = default)

If animated is set to true, it slides the content to the next page with a sliding motion. The animated property’s default value is true.

showNext(animated: Bool = default) is a public func.

When the SlideController is shown on the screen, this property is set to true. Used to ensure that LifeCycle events are properly triggered.

viewDidAppear is a public func ()

When the SlideController is not visible on the screen, this method informs it. Used to ensure that LifeCycle events are properly triggered.

viewDidDisappear is a public func ()


TitleScrollView

View of the title is aligned. .top,.bottom,.left, and.right are all supported. The default alignment value is.top.

SlideController.TitleViewAlignment is a public var that may be set.

The TitleScrollView’s size. The titleSize of SlideController’s horizontal slide direction matches to height. The titleSize of the SlideController.vertical slide direction matches to the width. titleSize is set to 84 by default.

get set var titleSize: CGFloat var titleSize: CGFloat var titleSize: CGFloat var titleSize: CGFlo

TitleScrollView displays an array of title elements.

open var items: [TitleItem] get var items: [TitleItem] get var items: [TitleItem] get var items:


GitHub

https://github.com/touchlane/SlideController

The swift libraries 2020 is a simple and flexible UI component fully written in Swift. It can be used for anything from games to social media apps.

Related Tags

  • swift libraries list
  • swiftui components
  • awesome swiftui
  • awesome ios animation
  • awesome ios github
Total
0
Shares
Share 0
Tweet 0
Pin it 0
James Gussie

Previous Article

How to delete temporary files in Windows 11

  • James Gussie
  • September 17, 2021
View Post
Next Article

Download Online Tik-Tok+Video for PC Windows 10,8,7

  • James Gussie
  • September 18, 2021
View Post
Table of Contents
  1. SlideController
  2. CocoaPods
    1. SlideController
    2. TitleScrollView
  3. GitHub
Featured
  • 1
    Twitter 101: The Ultimate Guide
    • June 3, 2022
  • 2
    ZAGG Pocket Keyboard for Apple Products
    • April 14, 2022
  • 3
    How to Install & Watch Dofu Sports on Firestick? [Complete Guide]
    • December 24, 2021
  • 4
    How to Repair Steam Overlay Not Working Issue on Windows 10 PC
    • December 23, 2021
  • 5
    6 Kinsta Alternatives of 2022 (Cheap & Best Competitors)
    • December 22, 2021
Must Read
  • 1
    Your Guide to Popular Operating Systems for Computers
  • 2
    Fed Up Of Coronavirus Caller Tune? Follow These Steps To Stop This Caller Tune
  • 3
    Paramount+ Ads & Price Not the Only Plan Differences
axiumtech.net
  • Home
  • Privacy Policy
  • Contact Us
  • Guest Post – Write For Us
  • Sitemap
Stay Updated Always.

Input your search keywords and press Enter.