{"id":22050128,"url":"https://github.com/icapps/ios-delirium","last_synced_at":"2025-05-08T23:20:56.179Z","repository":{"id":56908384,"uuid":"60837270","full_name":"icapps/ios-delirium","owner":"icapps","description":"Delirium contains a set of UI components that can be reused during development.","archived":false,"fork":false,"pushed_at":"2022-05-30T12:09:37.000Z","size":11315,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-03T02:59:39.558Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/icapps.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":null,"security":null,"support":null}},"created_at":"2016-06-10T09:32:21.000Z","updated_at":"2019-03-19T23:21:04.000Z","dependencies_parsed_at":"2022-11-29T13:20:30.416Z","dependency_job_id":null,"html_url":"https://github.com/icapps/ios-delirium","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fios-delirium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fios-delirium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fios-delirium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fios-delirium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icapps","download_url":"https://codeload.github.com/icapps/ios-delirium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253161338,"owners_count":21863725,"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-11-30T14:17:57.905Z","updated_at":"2025-05-08T23:20:56.140Z","avatar_url":"https://github.com/icapps.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](Resources/Delirium.jpg)\n\n[![CI Status](http://img.shields.io/travis/icapps/ios-delirium.svg?style=flat)](https://travis-ci.org/icapps/ios-delirium)\n[![License](https://img.shields.io/cocoapods/l/Delirium.svg?style=flat)](http://cocoapods.org/pods/Delirium)\n[![Platform](https://img.shields.io/cocoapods/p/Delirium.svg?style=flat)](http://cocoapods.org/pods/Delirium)\n[![Version](https://img.shields.io/cocoapods/v/Delirium.svg?style=flat)](http://cocoapods.org/pods/Delirium)\n[![Language Swift 4.2](https://img.shields.io/badge/Language-Swift%204.2-orange.svg?style=flat)](https://swift.org)\n\n\u003e Delirium contains a set of UI components that can be reused during development.\n\n## TOC\n\n- [Installation](#installation)\n- [Features](#features)\n  - [Animations](#animations)\n    - [Blurred Transition](#blurred-transition)\n    - [Shake](#shake)\n  - [Controllers](#controllers)\n    - [Alert](#alert)\n  - [Views](#views)\n    - [Pie Chart](#pie-chart)\n    - [Pin](#pin)\n  - [Keyboard](#keyboard)\n  - [Font](#font)\n- [Bucket List](#bucket-list)\n- [Author](#author)\n- [License](#license)\n\n## Installation\n\nDelirium is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your `Podfile`:\n\n```ruby\n    pod 'Delirium', :git =\u003e 'https://github.com/icapps/ios-delirium.git', :commit =\u003e '....'\n```\n\n## Features\n\n### Animations\n\n#### Blurred Transition\n\nAdd some custom modal transitions to your application. Here is an example of what this transition looks like:\n\n![](Resources/Blur.png)\n\nYou can pass all the values of `UIBlurEffectStyle` to the `ActionTransitioningDelegate` class. And here is how you implement this transition.\n\n```swift\nlet transitionDelegate = ActionTransitioningDelegate()\n\nrequired init?(coder aDecoder: NSCoder) {\n  super.init(coder: aDecoder)\n\n  transitionDelegate.blurEffectStyle = .Light\n  transitioningDelegate = transitionDelegate\n  modalPresentationStyle = .Custom\n}\n```\n\n_This transition will only work on iOS 9._\n\n#### Shake\n\nYou can shake a UIView with this handy `shake` function.\n\n```swift\nlet view: UIView = ...\n\n// Shake the view with the default `duration` of 0.07 seconds and a `repeatCount` of 4.\nview.shake()\n\n// You can also pass a custom `duration` or `repeatCount` is wanted.\nview.shake(repeatCount: 10, duration: 1.0)\n```\n\n## Controllers\n\n### Alert\n\nYou can present an `NSError` from your `UIViewController` instance. This will present a `UIAlertController` with a title translated by the 'delirium.alert.button.ok' key. And with a description `localizedDescription` from `NSError`.\n\nHere is an example of how it looks:\n\n![](Resources/Error.png)\n\nAnd here how to implement:\n\n```swift\nlet error: NSError = ...\npresentAlertController(with: error)\n```\n\nWhen you want to present an 'ErrorType' than you'll have to conform to the `AlertError` protocol. This will make sure that the `ErrorType` has a title and a description to show in the alert.\n\n```swift\nstruct SomeError: AlertError {\n  var title: String { return \"Some error occured\" }\n  var description: String { return \"This is the reason why some error occured.\" }\n}\n\nlet error: SomeError = ...\npresentAlertController(with: error)\n```\n\nThe `presentAlertController` function can have a `retry` closure. When implementing this closure you will get a 'Try again' button in the alert. When tapping this button the closure will be triggered.\n\n```swift\nlet error: NSError = ...\npresentAlertController(withError: error) {\n  // Tapped retry.\n}\n```\n\nThe `presentAlertController` function can also have an `ok` closure. This\ncallback will be triggered when you press the 'ok' button.\n\n```swift\nlet error: NSError = ...\npresentAlertController(withError: error, retry: {\n  // Tapped retry.\n}, ok: {\n  // Tapped ok.\n})\n```\n\n## Views\n\n### Pie Chart\n\nShow a basic pie chart that has a simple overlay that breaks the pie chart and gives it a clean design.\n\n![](Resources/PieChart.png)\n\nYou can easily integrate the `PieChartView` by just extending a `UIView` in your storyboard. But for the hardcore fans, you can also create the view manually. (_like an animal_)\n\nWhen the view is created you can add some slices to it. A slice contains a value and a color.\n\n```swift\nlet pieChartView = ...\n\npieChartView.add(slice: PieChartSlice(value: 12.0, color: UIColor.redColor()))\npieChartView.add(slice: PieChartSlice(value: 8.0, color: UIColor.greenColor()))\n```\n\nThis will result in a pie chart that has two slices. The **red** slice will take 60% of the pie chart, and the **green** slice will contain 40% of the pie chart.\n\nNext to the slices you can also pass some minor configuration options to the view.\n\n```swift\n// This is the overlay color of the circle that is drawn over the center of the pie chart. When giving this color an alpha value the pie chart is broken nicely.\npieChartView.overlayColor = UIColor.blueColor()\n\n// This stroke color is the color that is displayed between the slices.\npieChartView.strokeColor = UIColor.blueColor()\n\n// This is the size of the padding from where the overlay circle will be displayed.\npieChartView.overlayPadding = 20.0\n```\n\n### Pin\n\nPresent a pin view is really easy with _Delirium_.\n\n![](Resources/Pin.png)\n\nSubclass a `UIView` in your storyboard and set it to `PinView`. This view will\nautomatically calculate it's own intrinsic content size. So when using the pin\nview in you Storyboard you don't have to set a width or a height manually. Make\nsure that the pin view isn't to strictly pinned to it's super view.\n\n```swift\npinView.delegate = self\n```\n\nWhen you set the delegate to be the current controller. Than this controller needs to conform to `PinViewDelegate`. Which means that the following method should be implemented.\n\n```swift\nfunc pinView(view: PinView, didEnterPin pin: String) {\n    // This method is called whenever your pin code is complete.\n    // So when the `numberOfDigitis` matched the pin count.\n}\n```\n\nYou can pass a custom configuration to the `PinView`. Here are some of the options that can be configured:\n\n```swift\n    @IBOutlet weak var textField: UITextField!\n    @IBOutlet weak var keyboardConstraint: KeyboardConstraint! {\n        didSet {\n            keyboardConstraint.offsetFromKeyboardHeight = 25\n        }\n    }\n\n    @IBAction func tapOutsideTextfield(_ sender: UITapGestureRecognizer) {\n        textField.resignFirstResponder()\n    }\n```\n\nBelow is an overview of all the different configuration options available.\n\n```swift\n/// Define the size of the buttons.\nconfiguration.buttonSize: CGFloat = 60.0\n/// Define the font of the buttons.\nconfiguration.buttonFont = UIFont.systemFont(ofSize: 18.0)\n/// Define if you want to see the touch down highlight color.\nconfiguration.allowSelectionFeedback = true\n// Define the number of digits you want to enter.\nconfiguration.numberOfDigits = 4\n// The title to be displayed in the navigation bar.\nconfiguration.title = \"Enter your pin\"\n// The color of the filled dot at the top of the pin view.\nconfiguration.dotColor = UIColor(red:0.11, green:0.68, blue:0.93, alpha:1.00)\n// The color of the stroked dot at the top of the pin view.\nconfiguration.dotStrokeColor = UIColor(red:0.73, green:0.77, blue:0.81, alpha:1.00)\n// The color of the stroked pin number button.\nconfiguration.numberStrokeColor = UIColor(red:0.75, green:0.79, blue:0.83, alpha:1.00)\n// The color of the highlighted background in the pin number button.\nconfiguration.selectionBackgroundColor = UIColor(red:0.90, green:0.91, blue:0.93, alpha:1.00)\n// The color of the background in the pin number button.\nconfiguration.backgroundColor = UIColor.whiteColor()\n// The color of the text in the pin number button.\nconfiguration.numberTextColor = UIColor(red:0.01, green:0.13, blue:0.28, alpha:1.00)\n/// The color of the stroked clear button.\nconfiguration.clearStrokeColor = UIColor.red\n/// The color of the highlighted background in the clear button.\nconfiguration.clearSelectionBackgroundColor = UIColor.lightGray\n/// The color of the text in the clear button.\nconfiguration.clearTextColor = UIColor.red\n```\n\nYou can set the configuration by passing the `configuration` instance to the `pinView` instance.\n\n```swift\nlet configuration = PinConfiguration()\npinView.configuration = configuration\n```\n\n# Keyboard\n\nSimply animate any view with the keyboard by setting the class of a layout constraint.\n\nTake a look at the example. You do not need to implement the viewcontroller like below or sublcass it. Just use the `KeyboardConstraint` class.\n\nCredits to *Stefan Adams* form iCapps!\n\n```swift\nclass KeyboardViewController: UIViewController {\n\n    @IBOutlet weak var textField: UITextField!\n\n    @IBAction func tapOutsideTextfield(_ sender: UITapGestureRecognizer) {\n        textField.resignFirstResponder()\n    }\n\n}\n\nextension KeyboardViewController: UITextFieldDelegate {\n\n    func textFieldShouldEndEditing(_ textField: UITextField) -\u003e Bool {\n        textField.resignFirstResponder()\n        return true\n    }\n}\n```\nThe amount of space beteen the keyboard and your view can be set in storyboard when you select the constraint of class `KeyboardConstraint`\n\n![](Resources/Inspectable.png)\n\n# Font\n\nEasily use UIKit's Dynamic Type and Text Styles with a custom font family. When using Dynamic Type in your apps, your apps will respond to users changing their preferred text size in their iOS device's settings.\n\nText Styles are a set of styles that make it easier to implement different font sizes and font weights into your app. For example, a headline would default to a semi-bold weight and a 17pt point size while a body would default to a regular weight and a 17pt point size.\n\nThe default Dynamic Type when no changes are done by the user is `Large`. Dynamic Types vary from `xSmall` to `xxxLarge`.\n\nAvailable parameters:\n- `family`: The name of the font family to be used as returned by `UIFont.familyNames` or a custom font embedded in the app.\n- `style`: The font text style to be used. (e.g. `UIFontTextStyle.headline`)\n\n_Example Usage:_\n\n```swift\n// Without using TraitCollection:  \nlet fontFamilyHeitiSC = \"Heiti SC\"\nlet font = UIFont.preferredFont(with: fontFamilyHeitiSC, for: .body)\n\n// Using TraitColletion:\nlet fontFamilyThonburi = \"Thonburi\"\nlet anotherFont = UIFont.preferredFont(with: fontFamilyThonburi, for: style, compatibleWith: traitCollection)\n\n// For a list of available fonts use:\nprint(UIFont.familyNames)\n```\n\n![](Resources/Text_Default.png)\n\n![](Resources/Text_Large.png)\n\n_More information regarding Dynamic Type and Typography in general can be found at [Apple](https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/)._\n\n## Bucket List\n\nHere is an overview what is on our todo list.\n\n- [ ] Add `UIView` Wiggle.\n\n## Author\n\nJelle Vandebeeck, jelle@fousa.be\nHannes Van den Berghe hannes.van.den.berghe@live.be\n\n## License\n\nDelirium 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%2Ficapps%2Fios-delirium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficapps%2Fios-delirium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficapps%2Fios-delirium/lists"}