{"id":21997673,"url":"https://github.com/osfunapps/uidynamicview","last_synced_at":"2025-03-23T04:45:10.767Z","repository":{"id":56924876,"uuid":"288687948","full_name":"osfunapps/UIDynamicView","owner":"osfunapps","description":"Build dynamic views FAST for iOS/OSX","archived":false,"fork":false,"pushed_at":"2020-09-27T23:03:19.000Z","size":3309,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T23:50:18.830Z","etag":null,"topics":["codable-view","dynamic-views","ios","osx","pod","uiview"],"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/osfunapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-19T09:20:35.000Z","updated_at":"2020-09-27T23:03:02.000Z","dependencies_parsed_at":"2022-08-21T06:20:13.923Z","dependency_job_id":null,"html_url":"https://github.com/osfunapps/UIDynamicView","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2FUIDynamicView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2FUIDynamicView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2FUIDynamicView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2FUIDynamicView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osfunapps","download_url":"https://codeload.github.com/osfunapps/UIDynamicView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056902,"owners_count":20553854,"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":["codable-view","dynamic-views","ios","osx","pod","uiview"],"created_at":"2024-11-29T22:17:37.998Z","updated_at":"2025-03-23T04:45:10.749Z","avatar_url":"https://github.com/osfunapps.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UIDynamicView\n\n[![CI Status](https://img.shields.io/travis/osfunapps/UIDynamicView.svg?style=flat)](https://travis-ci.org/osfunapps/UIDynamicView)\n[![Version](https://img.shields.io/cocoapods/v/UIDynamicView.svg?style=flat)](https://cocoapods.org/pods/UIDynamicView)\n[![License](https://img.shields.io/cocoapods/l/UIDynamicView.svg?style=flat)](https://cocoapods.org/pods/UIDynamicView)\n[![Platform](https://img.shields.io/cocoapods/p/UIDynamicView.svg?style=flat)](https://cocoapods.org/pods/UIDynamicView)\n\n\n![1](./res/1.gif) \n![2](./res/2.gif)\n![3](./res/3.png)\n\n# NOTICE\nThis project is only a module from larger set of tools for iOS UIViews and thus, has been moved to [![https://github.com/osfunapps/OsUIViews-iOS](https://github.com/osfunapps/OsUIViews-iOS)]\n\n## Introduction\nUse this library if you want to create views FAST without creating a pesky .xib file for every single view.\n\n## Usage\n\nJust create the dynamic view and add the subviews you would like to use.\n\n ```\nimport UIDynamicView\n \nprivate func popFactsDialog() {\n      \n    // build the dynamic view with all of the props\n    let dv = UIDynamicView()\n    dv.prepareView(parentView: view,\n                   padding: 14,\n                   margin: 14,\n                   maxWidthPercentFromParent: 0.65)\n    dv.dropShadow(shadowRadius: 5.0)\n    \n    // add the title\n    let topTitleProps = InitialLabelProps(text: \"Teletubbies\",\n                                          textAlignment: .center,\n                                          font: UIFont.systemFont(ofSize: 20, weight: .bold))\n    dv.addView(initialProps: topTitleProps)\n    \n    // add the image\n    let imgProps = InitialUIImageViewProps(imageName: \"tt\",\n                                           widthPercentFromParent: 0.3,\n                                           tag: 99,\n                                           alignment: .center)\n    dv.addView(initialProps: imgProps)\n    \n    // add the description\n    let descriptionProps =  InitialLabelProps(text:\n        \"\"\"\n        Teletubbies is a British children's television series\n        created by Ragdoll Productions' Anne Wood and Andrew\n        Davenport for BBC.\n        \"\"\",\n        textAlignment: .left,\n        font: UIFont.systemFont(ofSize: 17)\n    )\n    dv.addView(initialProps: descriptionProps)\n    \n    // add the footer buttons\n    let nextFactButton = InitialButtonProps(labelText: \"Previous Fact\",\n    alignment: .left,\n    tapSelector: #selector(onPreviousFactTap))\n    \n    let nextBtn = InitialButtonProps(labelText: \"Next Fact!\",\n                                         alignment: .right,\n                                         tapSelector: #selector(onNextFactTap))\n    let footerStackViewProps = InitialStackViewProps(subviewsInitialPropsList: [nextFactButton, nextBtn])\n    \n    dv.addView(initialProps: footerStackViewProps)\n    dv.attachView(parentView: view)\n}\n  \n@objc func onPreviousFactTap() {\n}\n  \n@objc func onNextFactTap() {\n}\n ```\n\nOR another example:\n\n ```\nimport UIDynamicView\n \nprivate func popHelpDialog() {\n        \n    // build the dynamic view with all of the props\n    dv = UIDynamicView()\n    dv.prepareView(parentView: view,\n                   padding: 14,\n                   margin: 14,\n                   maxWidthPercentFromParent: 0.65)\n    dv.dropShadow(shadowRadius: 5.0)\n    \n    // add the title\n    let topTitleProps = InitialLabelProps(text: \"Help\",\n                                          textAlignment: .center,\n                                          font: UIFont.systemFont(ofSize: 20, weight: .bold))\n    dv.addView(initialProps: topTitleProps)\n    \n    // add the description\n    let descriptionProps =  InitialLabelProps(text:\n        \"\"\"\n        Please watch the below video to understand how to use the app\n        \"\"\",\n        textAlignment: .left,\n        font: UIFont.systemFont(ofSize: 19)\n    )\n    dv.addView(initialProps: descriptionProps)\n    \n    // add the youtube video\n    let videoProps = InitialYoutubeVideoProps(videoId: \"BywDOO99Ia0\",\n                                              widthPercentFromParent: 0.75,\n                                              alignment: .center)\n    dv.addView(initialProps: videoProps)\n    \n    // add the footer button\n    let okBtnProps = InitialButtonProps(labelText: \"OK\",\n    alignment: .right,\n    tapSelector: #selector(onOkBtnTap))\n    \n    dv.addView(initialProps: okBtnProps)\n    dv.attachView(parentView: view)\n}\n ```\n\n## Dialog Wrapper\n\nYou can also use the dialog wrapper for a faster dialog buildup (the Controller Connection example)\n ```\nimport UIDynamicView\n\nprivate var dialogWrapper: UIDialogWrapper!\n    \n    private func popDialog() {\n        \n        // prepare the dialog\n        dialogWrapper = UIDialogWrapper(parentView: view, margin: 20, maxWidthPercentFromParent: 0.6)\n                                        \n        // set title and description                                \n        dialogWrapper.setTitle(text: \"Controller Connection\")\n        dialogWrapper.setTopDesription(text: \"\"\"\n                NOTICE: iOS 13.0 is required to connect your controller via Bluetooth\n\n                - With your Xbox controller, long click on the Xbox and pairing buttons together, until the Xbox button will start flashing\n                - In your iPhone/iPad, go to Settings app -\u003e tap on Bluetooth -\u003e activate it\n                - Look for the Xbox Controller in the list of devices, click on it and approve the connection\n                — You're all set!\n                \"\"\", size: 16)\n                \n        // add bottom description, youtube video and footer        \n        dialogWrapper.setBottomDesription(text: \"** UPDATED: 10.4.2020\")\n        dialogWrapper.setYoutubeVideo(videoId: \"wPV0QtYm-4o\", widthPercentFromParent: 0.75)\n        dialogWrapper.setFooter(leftBtnText: \"Cancel\", rightBtnText: \"Ok\", leftBtnTapSelector: #selector(onLeftTap), rightBtnTapSelector: #selector(onRightTap))\n        \n        // attach the view to it's parent\n        dialogWrapper.attachView(parentView: view)\n    }\n    \n    @objc func onLeftTap() {\n        dialogWrapper.dismiss()\n        print(\"on left tap\")\n    }\n    \n    @objc func onRightTap() {\n        print(\"on right tap\")\n    }\n```\n\n\n\n## Installation\n\nUIDynamicView is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'UIDynamicView'\n```\n\n## Author\n\nosApss, support@os-apps.com\n\n## License\n\nUIDynamicView is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosfunapps%2Fuidynamicview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosfunapps%2Fuidynamicview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosfunapps%2Fuidynamicview/lists"}