{"id":13466276,"url":"https://github.com/zenangst/Family","last_synced_at":"2025-03-25T21:31:52.507Z","repository":{"id":45892136,"uuid":"121143667","full_name":"zenangst/Family","owner":"zenangst","description":":children_crossing: A child view controller framework that makes setting up your parent controllers as easy as pie.","archived":true,"fork":false,"pushed_at":"2021-11-29T11:01:24.000Z","size":821,"stargazers_count":249,"open_issues_count":6,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-12T00:05:49.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zenangst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":"FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["zenangst"]}},"created_at":"2018-02-11T16:39:16.000Z","updated_at":"2025-01-16T10:27:30.000Z","dependencies_parsed_at":"2022-08-20T20:20:39.409Z","dependency_job_id":null,"html_url":"https://github.com/zenangst/Family","commit_stats":null,"previous_names":[],"tags_count":155,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenangst%2FFamily","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenangst%2FFamily/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenangst%2FFamily/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenangst%2FFamily/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenangst","download_url":"https://codeload.github.com/zenangst/Family/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245547915,"owners_count":20633470,"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":[],"created_at":"2024-07-31T15:00:41.893Z","updated_at":"2025-03-25T21:31:51.983Z","avatar_url":"https://github.com/zenangst.png","language":"Swift","funding_links":["https://github.com/sponsors/zenangst"],"categories":["Libs","UI [🔝](#readme)"],"sub_categories":["UI"],"readme":"![Family logo](https://github.com/zenangst/Family/blob/master/Images/Family-header.png?raw=true)\n\u003cdiv align=\"center\"\u003e\n\n[![CI Status](https://travis-ci.org/zenangst/Family.svg?branch=master)](https://travis-ci.org/zenangst/Family)\n[![Version](https://img.shields.io/cocoapods/v/Family.svg?style=flat)](http://cocoadocs.org/docsets/Family)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![codecov](https://codecov.io/gh/zenangst/Family/branch/master/graph/badge.svg)](https://codecov.io/gh/zenangst/Family)\n[![License](https://img.shields.io/cocoapods/l/Family.svg?style=flat)](http://cocoadocs.org/docsets/Family)\n[![Platform](https://img.shields.io/cocoapods/p/Family.svg?style=flat)](http://cocoadocs.org/docsets/Family)\n![Swift](https://img.shields.io/badge/%20in-swift%204.2-orange.svg)\n\n\u003c/div\u003e\n\n## Description\n\n\u003cimg src=\"https://github.com/zenangst/Family/blob/master/Images/Family-icon.png?raw=true\" alt=\"Family Icon\" align=\"right\" /\u003e\n\nFamily is a child view controller framework that makes setting up your parent controllers as easy as pie.\nWith a simple yet powerful public API, you can build complex layouts without losing maintainability, leaving you to focus on what matters: making your applications pop and your business logic shine.\n\nThis framework was built to make it easier to build and maintain parent controllers, also known as flow controllers. Using child view controllers can make your code more modular, flexible and testable. It addresses one of the biggest shortcomings of the vanilla approach: how do you get a continuous scrolling experience while keeping dequeuing intact?\n\nThis is where Family framework comes in. With the help of its layout algorithm, all your regular- and scroll views get stacked in the same linear vertical order you add them to the hierarchy. To achieve a continuous scrolling view, your child scroll views no longer scroll themselves, but get their new content offset passed to them by the parent scroll view, which the framework handles for you. The framework also modifies the views' frames on the fly, constraining the height to the window.\n\n## The story behind Family\nIf you are interested in the origin story behind Family, then you can read this [Medium article](https://medium.com/hyperoslo/why-i-wrote-family-framework-d1c3cb062c85).\n\n## Features\n\n- [x] 🍩Animation support.\n- [x] 🤳🏻Continuous scrolling with multiple scroll views.\n- [x] 📏Margins between child view controllers.\n- [x] 🌀Table view and collection view dequeuing.\n- [x] 🍭Supports custom spacing between views.\n- [x] 📱iOS support.\n- [x] 💻macOS support.\n- [x] 📺tvOS support.\n\n## Supporting the project\n\nIf you want to support the development of this framework, you can do so by becoming a [sponsor](https://github.com/sponsors/zenangst). ❤️\n\n## Usage\n\nThe new public API:\n\n```swift\nbody(withDuration: 0) {\n  add(detailViewController)\n  .background(.view(backgroundView))\n  .padding(.init(top: 20, left: 20, bottom: 20, right: 20))\n  .margin(.init(top: 20, left: 0, bottom: 20, right: 0))\n}\n```\n\nAdd a regular child view controller:\n\n```swift\nlet familyController = FamilyViewController()\nlet viewController = UIViewController()\n\nfamilyController.addChild(viewController)\n```\n\nAdd a child view controller constrained by height:\n\n```swift\nlet familyController = FamilyViewController()\nlet viewController = UIViewController()\n\nfamilyController.addChild(viewController, height: 175)\n```\n\nAdd a child view controller with a custom view on the controller:\n\n```swift\nlet familyController = FamilyViewController()\nlet customController = CustomViewController()\n\n// This will add the scroll view of the custom controller\n// instead of the controllers view.\nfamilyController.addChild(customController, view: { $0.scrollView })\n```\n\nMove a view controller:\n\n```swift\nfamilyController.moveChild(customController, to: 1)\n```\n\nPerform batch updates (it is encouraged to use performBatchUpdates when updaing more than one view controller):\n\n```swift\nfamilyController.performBatchUpdates({ controller in\n  controller.addChild(controller1)\n  controller.addChild(controller2)\n  controller.moveChild(controller2, to: 0)\n  controller3.removeFromParent()\n})\n```\n\nAdding animations\n\nWhen adding animations, not that you have to give them a key.\n```swift\nlet basicAnimation = CABasicAnimation()\nbasicAnimation.duration = 0.5\ncontroller.view.layer.add(springAnimation, forKey: \"Basic Animations\")\n\nlet springAnimation = CASpringAnimation()\nspringAnimation.damping = 0.6\nspringAnimation.initialVelocity = 0.6\nspringAnimation.mass = 0.4\nspringAnimation.duration = 0.6\nspringAnimation.isRemovedOnCompletion = false\ncontroller.view.layer.add(springAnimation, forKey: \"Spring Animations\")\n```\n\n\n## Installation\n\n**Family** is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'Family'\n```\n\nand then run\n```sh\npod install\n```\n\n**Family** is also available through [Carthage](https://github.com/Carthage/Carthage).\nTo install just write into your Cartfile:\n\n```ruby\ngithub \"zenangst/Family\"\n```\n\nand then run\n```sh\ncarthage install\n```\n\nWhen it's finished, install the built framework (which can be found in the `Carthage/Build` folder) into your Xcode project.\n\n**Family** can also be installed manually. Just download and drop `Sources` folders in your project.\n\n## Author\n\nChristoffer Winterkvist, christoffer@winterkvist.com\n\n## Contributing\n\nWe would love you to contribute to **Family**, check the [CONTRIBUTING](https://github.com/zenangst/Family/blob/master/CONTRIBUTING.md) file for more info.\n\n## Credits\n\n- [hyperoslo's Spots](https://github.com/hyperoslo/Spots) uses the same kind of implementation in order to render its component.\n- [Ole Begemanns](https://github.com/ole/) implementation of [OLEContainerScrollView](https://github.com/ole/OLEContainerScrollView) is the basis for `SpotsScrollView`, we salute you.\nReference: http://oleb.net/blog/2014/05/scrollviews-inside-scrollviews/\n\n## License\n\n**Family** is available under the MIT license. See the [LICENSE](https://github.com/zenangst/Family/blob/master/LICENSE.md) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenangst%2FFamily","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenangst%2FFamily","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenangst%2FFamily/lists"}