{"id":2739,"url":"https://github.com/touchlane/SlideController","last_synced_at":"2025-08-06T16:31:31.014Z","repository":{"id":37933716,"uuid":"100483243","full_name":"touchlane/SlideController","owner":"touchlane","description":"Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount. ","archived":false,"fork":false,"pushed_at":"2022-08-17T15:29:04.000Z","size":4397,"stargazers_count":423,"open_issues_count":0,"forks_count":32,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-18T20:17:05.051Z","etag":null,"topics":["awesome","cocoapods","ios","library","swift","uipageviewcontroller","uiscrollview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/touchlane.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2017-08-16T11:44:59.000Z","updated_at":"2024-11-17T04:05:59.000Z","dependencies_parsed_at":"2022-08-25T20:11:45.401Z","dependency_job_id":null,"html_url":"https://github.com/touchlane/SlideController","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FSlideController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FSlideController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FSlideController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FSlideController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/touchlane","download_url":"https://codeload.github.com/touchlane/SlideController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923696,"owners_count":17992567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awesome","cocoapods","ios","library","swift","uipageviewcontroller","uiscrollview"],"created_at":"2024-01-05T20:16:21.557Z","updated_at":"2024-12-09T16:31:04.323Z","avatar_url":"https://github.com/touchlane.png","language":"Swift","readme":"![LOGO](https://github.com/touchlane/SlideController/blob/master/Assets/logo.svg)\n\n![Language](https://img.shields.io/badge/swift-5.0-orange.svg)\n[![Build Status](https://travis-ci.org/touchlane/SlideController.svg?branch=master)](https://travis-ci.org/touchlane/SlideController)\n[![codecov.io](https://codecov.io/gh/touchlane/SlideController/branch/master/graphs/badge.svg)](https://codecov.io/gh/codecov/SlideController/branch/master)\n[![Version](https://img.shields.io/cocoapods/v/SlideController.svg?style=flat)](http://cocoapods.org/pods/SlideController)\n[![License](https://img.shields.io/cocoapods/l/SlideController.svg?style=flat)](http://cocoapods.org/pods/SlideController)\n[![Platform](https://img.shields.io/cocoapods/p/SlideController.svg?style=flat)](http://cocoapods.org/pods/SlideController)\n\nSlideController is a simple and flexible UI component fully written in Swift. Built using power of generic types, it is a nice alternative to UIPageViewController.\n\n![Horizontal](Example/Assets/horizontal.gif)\n![Vertical](Example/Assets/vertical.gif)\n![Carousel](Example/Assets/carousel.gif)\n\n# Requirements\n\n* iOS 9.0+\n* Xcode 10.2+\n* Swift 5.0+\n\n# Installation\n\n## CocoaPods\n\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```$ gem install cocoapods```\n\nTo integrate SlideController into your Xcode project using CocoaPods, specify it in your ```Podfile```:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'SlideController'\nend\n```\n\nThen, run the following command:\n\n```$ pod install```\n\n# Usage\n\n```swift\nimport SlideController\n```\n\n1) Create content\n```swift\nlet content = [\n            SlideLifeCycleObjectBuilder\u003cPageLifeCycleObject\u003e(),\n            SlideLifeCycleObjectBuilder\u003cPageLifeCycleObject\u003e(),\n            SlideLifeCycleObjectBuilder\u003cPageLifeCycleObject\u003e()\n        ]\n ```\n \n* ``PageLifeCycleObject`` is any object conforms to ``Initializable, Viewable, SlidePageLifeCycle `` protocols\n\n2) Initialize SlideController\n```swift\nslideController = SlideController\u003cCustomTitleView, CustomTitleItem\u003e(\n    pagesContent: content,\n    startPageIndex: 0,\n    slideDirection: .horizontal)\n```\n\n* ``CustomTitleView`` is subclass of ``TitleScrollView\u003cCustomTitleItem\u003e``\n* ``CustomTitleItem`` is subclass of ``UIView`` and conforms to ``Initializable, ItemViewable, Selectable`` protocols\n\n3) Add ``slideController.view`` to view hierarchy\n\n4) Call ``slideController.viewDidAppear()`` and ``slideController.viewDidDisappear()`` in appropriate UIViewController methods:\n\n ```swift\n override func viewDidAppear(_ animated: Bool) {\n     super.viewDidAppear(animated)\n     slideController.viewDidAppear()\n }\n ```\n \n ```swift\noverride func viewDidDisappear(_ animated: Bool) {\n    super.viewDidDisappear(animated)\n    slideController.viewDidDisappear()\n}\n```\n\n# Documentation\n\n### SlideController\n\nDefault initializer of `SlideController`.  \n`pagesContent` - initial content of controller, can be empty.  \n`startPageIndex` - page index that should be displayed initially.  \n`slideDirection` - slide direction. `.horizontal` or `.vertical`. \n```swift\npublic init(pagesContent: [SlideLifeCycleObjectProvidable],\n            startPageIndex: Int = 0,\n            slideDirection: SlideDirection)\n```\n\nReturns `titleView` instanсe of `TitleScrollView`.\n```swift \npublic var titleView: T { get }\n```\n\nReturns `LifeCycleObject` for currently displayed page.\n```swift\npublic var currentModel: SlideLifeCycleObjectProvidable? { get }\n```\n\nReturns array of `LifeCycleObject` that corresponds to `SlideController`'s content.\n ```swift\npublic private(set) var content: [SlideLifeCycleObjectProvidable]\n```\nWhen set to `true` unloads content when it is out of screen bounds. The default value is `true`.\n```swift\npublic var isContentUnloadingEnabled: Bool { get set }\n```\n\nWhen set to `true` scrolling in the direction of last item will result jumping to the first item.  Makes scrolling infinite. The default value is `false`.\n```swift\npublic var isCarousel: Bool { get set }\n```\n\nIf the value of this property is `true`, content scrolling is enabled, and if it is `false`, content scrolling is disabled. The default is `true`.\n```swift\npublic var isScrollEnabled: Bool { get set }\n```\n\nAppends pages array of `SlideLifeCycleObjectProvidable` to the end of sliding content.\n```swift\npublic func append(object objects: [SlideLifeCycleObjectProvidable])\n```\n\nInserts `SlideLifeCycleObjectProvidable` page object at `index` in sliding content.\n```swift\npublic func insert(object: SlideLifeCycleObjectProvidable, index: Int)\n```\nRemoves a page at `index`.\n```swift\npublic func removeAtIndex(index: Int)\n```\n\nSlides content to page at `pageIndex` with sliding animation if `animated` is set to `true`. Using `forced` is not recommended, it will perform shift even if other shift animation in progress or `pageIndex` equals current page. The default value of `animated` is `true`. The default value of `forced` is `false`.\n```swift\npublic func shift(pageIndex: Int, animated: Bool = default, forced: Bool = default)\n```\n\nSlides content the next page with sliding animation if `animated` is set to `true`. The default value of `animated` is `true`.\n```swift\npublic func showNext(animated: Bool = default)\n```\n\nLets the `SlideController` know when it is displayed on the screen. Used for correctly triggering `LifeCycle` events.\n```swift\npublic func viewDidAppear()\n```\n\nLets the `SlideController` know when it is not displayed on the screen. Used for correctly triggering `LifeCycle` events.\n```swift\npublic func viewDidDisappear()\n```\n___\n### TitleScrollView\n\nAlignment of title view. Supports `.top`, `.bottom`, `.left`, `.right`. The default value of `alignment` is `.top`.\n```swift\npublic var alignment: SlideController.TitleViewAlignment { get set }\n```\n\nThe size of `TitleScrollView`. For `.horizontal` slide direction of `SlideController` the `titleSize` corresponds to `height`. For `.vertical` slide direction of `SlideController` the `titleSize` corresponds to `width`.  The default value of `titleSize` is `84`.\n```swift \nopen var titleSize: CGFloat { get set }\n```\n\nArray of title items that displayed in `TitleScrollView`.\n```swift\nopen var items: [TitleItem] { get }\n```\n___\n","funding_links":[],"categories":["UI","Libs","Swift","UI [🔝](#readme)"],"sub_categories":["ScrollView","UI","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftouchlane%2FSlideController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftouchlane%2FSlideController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftouchlane%2FSlideController/lists"}