{"id":13902809,"url":"https://github.com/nicolaschengdev/WYPopoverController","last_synced_at":"2025-07-18T00:32:01.909Z","repository":{"id":72576991,"uuid":"12180649","full_name":"nicolaschengdev/WYPopoverController","owner":"nicolaschengdev","description":"WYPopoverController is for the presentation of content in popover on iPhone / iPad devices. Very customizable.","archived":false,"fork":false,"pushed_at":"2017-10-28T03:43:40.000Z","size":3738,"stargazers_count":1936,"open_issues_count":78,"forks_count":370,"subscribers_count":76,"default_branch":"master","last_synced_at":"2024-11-21T04:11:28.529Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/nicolaschengdev.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,"governance":null}},"created_at":"2013-08-17T15:04:48.000Z","updated_at":"2024-10-31T07:42:19.000Z","dependencies_parsed_at":"2023-05-30T04:45:30.679Z","dependency_job_id":null,"html_url":"https://github.com/nicolaschengdev/WYPopoverController","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaschengdev%2FWYPopoverController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaschengdev%2FWYPopoverController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaschengdev%2FWYPopoverController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaschengdev%2FWYPopoverController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicolaschengdev","download_url":"https://codeload.github.com/nicolaschengdev/WYPopoverController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226320575,"owners_count":17606321,"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-08-06T22:01:25.913Z","updated_at":"2024-11-25T11:30:23.515Z","avatar_url":"https://github.com/nicolaschengdev.png","language":"Objective-C","readme":"WYPopoverController\n===================\n\nWYPopoverController is for the presentation of content in popover on iPhone / iPad devices. Very customizable.\n\n### Screenshots\n\n---\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/wypopover_screenshot_1.png) ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/wypopover_screenshot_2.png) \n\n### Features\n\n---\n\n* UIAppearance support\n* Works like UIPopoverController\n* Works also with blocks\n* Animation options\n* Automatic orientation support\n* UIStoryboard support\n* Keyboard show / hide support\n* iOS 6 \u0026 7 support\n* UIAccessibility support\n* Theme support\n\n### UIAppearance support\n\n---\n\n| Property                      | Type           | Default value (iOS 6)  | Default value (iOS 7)  |\n| ----------------------------- | -------------- | ---------------------: | ---------------------: |\n| tintColor                     | `UIColor`      |                  *nil* |                  *nil* |\n| arrowBase                     | `NSUInteger`   |                     42 |                     25 |\n| arrowHeight                   | `NSUInteger`   |                     18 |                     13 |\n| borderWidth                   | `NSUInteger`   |                      6 |                      0 |\n| outerCornerRadius             | `NSUInteger`   |                      8 |                      5 |\n| innerCornerRadius             | `NSUInteger`   |                      6 |                      0 |\n| viewContentInsets             | `UIEdgeInsets` |         { 3, 0, 0, 0 } |       UIEdgeInsetsZero |\n| fillTopColor                  | `UIColor`      | \t            #373f47ff | \t         #f4f4f4ff |\n| fillBottomColor               | `UIColor`      |              #3b434cff |              #f4f4f4ff |\n| glossShadowColor              | `UIColor`      |              #c3c5c77f |           #transparent |\n| glossShadowBlurRadius         | `NSUInteger`   |                      0 |                      0 |\n| glossShadowOffset             | `CGSize`       |             { 0, 1.5 } |             CGSizeZero |\n| outerShadowColor              | `UIColor`      |              #000000bf |           #transparent |\n| outerShadowBlurRadius         | `NSUInteger`   |                      8 |                      0 |\n| outerShadowOffset             | `CGSize`       |               { 0, 2 } |             CGSizeZero |\n| innerShadowColor              | `UIColor`      | \t\t\t    #000000bf | \t\t  #transparent |\n| innerShadowBlurRadius         | `NSUInteger`   |                      2 |                      0 |\n| innerShadowOffset             | `CGSize`       |               { 0, 1 } |             CGSizeZero |\n| minOuterCornerRadius          | `NSUInteger`   |  \t\t            0 |  \t\t             0 |\n| innerStrokeColor              | `UIColor`      |              #262c31ff |           #transparent |\n| outerStrokeColor              | `UIColor`      |              #262c31ff |           #transparent |\n\n##### Arrow \u0026 Border\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_arrowbase.png \"arrowBase: 42\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_arrowheight.png \"arrowHeight: 18\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_borderwidth.png \"borderWidth: 6\")\n\n##### Corner radius \u0026 View content insets\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_outercornerradius_0.png \"outerCornerRadius: 0\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_innercornerradius_14.png \"innerCornerRadius: 14\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_viewcontentinsets_4-4-4-4.png \"viewContentInsets: {4, 4, 4, 4}\")\n\n##### Stroke \u0026 Fill\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_innerstrokecolor.png \"innerStrokeColor: #c3045e\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_outerstrokecolor.png \"outerStrokeColor: #c3045e\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_filltopcolor.png \"fillTopColor: #c3045e\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_fillbottomcolor.png \"fillBottomColor: #c3045e\")\n\n##### Gloss\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_glossshadowcolor.png \"glossShadowColor: #c3045e, glossShadowOffset: {0, 1.5}, glossShadowBlurRadius: 0\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_glossshadowblurradius_2.png \"glossShadowColor: #c3045e, glossShadowOffset: {0, 1.5}, glossShadowBlurRadius: 2\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_glossshadowoffset_0-3.png \"glossShadowColor: #c3045e, glossShadowOffset: {0, 3}, glossShadowBlurRadius: 0\")\n\n##### Outer\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_outershadowcolor.png \"outerShadowColor: #c3045e, outerShadowOffset: {0, 2}, outerShadowBlurRadius: 8\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_outershadowblurradius_2.png \"outerShadowColor: #c3045e, outerShadowOffset: {0, 2}, outerShadowBlurRadius: 2\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_outershadowoffset_0--2.png \"outerShadowColor: #c3045e, outerShadowOffset: {0, -2}, outerShadowBlurRadius: 2\")\n\n##### Inner\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_innershadowcolor.png \"innerShadowColor: #c3045e, innerShadowOffset: {0, 1}, innerShadowBlurRadius: 2\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_innershadowoffset_0--1.png \"innerShadowColor: #c3045e, innerShadowOffset: {0, -1}, innerShadowBlurRadius: 2\") , ![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/appearance/small/wypopover_innershadowblurradius_0.png \"innerShadowColor: #c3045e, innerShadowOffset: {0, 1}, innerShadowBlurRadius: 0\")\n\n### Works like UIPopoverController\n\n---\n\n#### passthroughViews\n\nAn array of views that the user can interact with while the popover is visible.\n\n#### wantsDefaultContentAppearance\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/wypopover_wantsdefaultcontentappearance.png \"\")\n\nDetermines whether the default content appearance should be used for the popover.\n\n#### popoverLayoutMargins\n\n![](https://raw.github.com/nicolaschengdev/WYPopoverController/master/screenshots/wypopover_popoverlayoutmargins.png \"\")\n\nThe margins that define the portion of the screen in which it is permissible to display the popover.\n\n### Works also with blocks\n\n---\n\nA block object can be executed when animation sequences ends. This parameter may be `nil`.\n\n**Important :** If a block object is defined then correspondent delegate methods is not called.\n\n#### Example\n\n```objective-c\n\npopover = [[WYPopoverController alloc] initWithContentViewController:contentViewController];\n[popover presentPopoverAsDialogAnimated:YES\n                             completion:^{\n                                 // Code executed after popover presentation animation sequence ends\n                             }];\n```\n\n### Animation options\n\n---\n\nThere are 3 styles of animation :\n* Fade *(by default)*\n* Scale\n* Fade with Scale\n\n#### Example\n\n```objective-c\n\npopover = [[WYPopoverController alloc] initWithContentViewController:contentViewController];\n[popover presentPopoverFromRect:btn.bounds\n                         inView:btn\n       permittedArrowDirections:WYPopoverArrowDirectionAny\n                       animated:YES\n                        options:WYPopoverAnimationOptionFadeWithScale];\n```\n\n### ARC\n\n---\n\nWYPopoverController uses ARC.\n\n### Installation\n\n---\n\n~~iOS SDK 7.0 (with Xcode 5) is required.~~\n\n#### Cocoapods\n\nAdd this line `pod 'WYPopoverController', '~\u003e 0.2.0'` to your PodFile.\n\nYour PodFile should look like :\n\n```Ruby\nplatform :ios, '6.0'\npod 'WYPopoverController', '~\u003e 0.2.2'\n```\n\nTo use the `master` branch of the repo :\n\n```Ruby\nplatform :ios, '6.0'\npod 'WYPopoverController', :git =\u003e 'https://github.com/nicolaschengdev/WYPopoverController.git'\n```\n\n#### Manually\n\nAdd these files to your project : \n* `WYPopoverController.h` and `WYPopoverController.m`\n* `WYStoryboardPopoverSegue.h` and `WYStoryboardPopoverSegue.m` \n\nAnd link `QuartzCore.framework` library in the *Build Phases* of your project targets.\n\n### Examples\n\n---\n\n##### Simple\n\nIn the implementation of your view controller\n\n```objective-c\n// YourViewController.m\n\n@interface YourViewController () \u003cWYPopoverControllerDelegate\u003e\n{\n    WYPopoverController* popoverController;\n}\n\n- (IBAction)showPopover:(id)sender;\n\n@end\n\n@implementation YourViewController\n\n- (IBAction)showPopover:(id)sender\n{\n\tpopoverController = [[WYPopoverController alloc] initWithContentViewController:controller];\n    popoverController.delegate = self;\n    [popoverController presentPopoverFromRect:button.bounds inView:button permittedArrowDirections:WYPopoverArrowDirectionAny animated:YES];\n}\n\n- (BOOL)popoverControllerShouldDismissPopover:(WYPopoverController *)controller\n{\n    return YES;\n}\n\n- (void)popoverControllerDidDismissPopover:(WYPopoverController *)controller\n{\n    popoverController.delegate = nil;\n    popoverController = nil;\n}\n\n@end\n```\n\n##### Appearance (Tint Color)\n\n```objective-c\n[WYPopoverController setDefaultTheme:[WYPopoverTheme theme]];\n\nWYPopoverBackgroundView *appearance = [WYPopoverBackgroundView appearance];\n[appearance setTintColor:[UIColor orangeColor]];\n```\n\n##### Appearance (Flat Popover)\n\n```objective-c\nUIColor *greenColor = [UIColor colorWithRed:26.f/255.f green:188.f/255.f blue:156.f/255.f alpha:1];\n\n[WYPopoverController setDefaultTheme:[WYPopoverTheme theme]];\n\nWYPopoverBackgroundView *popoverAppearance = [WYPopoverBackgroundView appearance];\n        \n[popoverAppearance setOuterCornerRadius:4];\n[popoverAppearance setOuterShadowBlurRadius:0];\n[popoverAppearance setOuterShadowColor:[UIColor clearColor]];\n[popoverAppearance setOuterShadowOffset:CGSizeMake(0, 0)];\n        \n[popoverAppearance setGlossShadowColor:[UIColor clearColor]];\n[popoverAppearance setGlossShadowOffset:CGSizeMake(0, 0)];\n        \n[popoverAppearance setBorderWidth:8];\n[popoverAppearance setArrowHeight:10];\n[popoverAppearance setArrowBase:20];\n        \n[popoverAppearance setInnerCornerRadius:4];\n[popoverAppearance setInnerShadowBlurRadius:0];\n[popoverAppearance setInnerShadowColor:[UIColor clearColor]];\n[popoverAppearance setInnerShadowOffset:CGSizeMake(0, 0)];\n        \n[popoverAppearance setFillTopColor:greenColor];\n[popoverAppearance setFillBottomColor:greenColor];\n[popoverAppearance setOuterStrokeColor:greenColor];\n[popoverAppearance setInnerStrokeColor:greenColor];\n        \nUINavigationBar* navBarInPopoverAppearance = [UINavigationBar appearanceWhenContainedIn:[UINavigationController class], [WYPopoverController class], nil];\n[navBarInPopoverAppearance setTitleTextAttributes: @{\n                  UITextAttributeTextColor : [UIColor whiteColor],\n            UITextAttributeTextShadowColor : [UIColor clearColor],\n           UITextAttributeTextShadowOffset : [NSValue valueWithUIOffset:UIOffsetMake(0, -1)]}];\n```\n\n##### Storyboard\n\n```objective-c\n- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender\n{\n\tif ([segue.identifier isEqualToString:@\"[YOUR_SEGUE_IDENTIFIER]\"])\n\t{\n\t\tWYStoryboardPopoverSegue* popoverSegue = (WYStoryboardPopoverSegue*)segue;\n\n\t\tUIViewController* destinationViewController = (UIViewController *)segue.destinationViewController;\n        destinationViewController.contentSizeForViewInPopover = CGSizeMake(280, 280);\t\t// Deprecated in iOS7. Use 'preferredContentSize' instead.\n\n        popoverController = [popoverSegue popoverControllerWithSender:sender permittedArrowDirections:WYPopoverArrowDirectionAny animated:YES];\n        popoverController.delegate = self;\n\t}\n}\n```\n\n##### Theme\n\nIntroduced in 0.2.1 release, you can change appearance of your popovers with themes.\n\n```objective-c\n- (void)changePopoverTheme\n{\n    popover.theme = [WYPopoverTheme themeForIOS6];  // you set a new theme\n\n    // use beginThemeUpdates and endThemeUpdates methods if you have to change several values which compose your current theme\n    \n    [popover beginThemeUpdates];\n        popover.theme.arrowHeight = 30;\n        popover.theme.arrowBase = 40;\n    [popover endThemeUpdates];\n}\n```\n\n##### Keyboard\n\nBy default, when keyboard is shown, popover will be repositionned if it is (partially) hidden.\nIntroduced in 0.2.1 release, you can control value of y offset when keyboard is shown with the following `delegate` method :\n\n```objective-c\n- (void)popoverController:(WYPopoverController *)popoverController willTranslatePopoverWithYOffset:(CGFloat *)value\n{\n    *value = 0; // if value is setted to 0 then popover will not be translated\n}\n```\n\n### Handling popover controllers during orientation changes\n\n---\n\nWhen showing a popover controller, there are times when you will need to handle how the popover controller appears after a change in device orientation.\n\nSituations when handling is required:\n\n* If the popover controller is presented from a target rectangle using the `-presentPopoverFromRect:inView:permittedArrowDirections:animated` method of WYPopoverController. You can use `-popoverController:willRepositionPopoverToRect:inView:` method introduced in the **0.1.6 release** .\n* If the popover controller is presented from a bar button item that is removed after the rotation has finished .\n\n### Change logs\n\n---\n\nA brief summary of each WYPopoverController release can be found on the [wiki](https://github.com/nicolaschengdev/WYPopoverController/wiki/Change-logs).\n\n### Contact\n\n---\n\n* [@mikl_jeo](https://twitter.com/mikl_jeo) on Twitter\n* [@nicolaschengdev](https://github.com/nicolaschengdev) on Github\n\n### License\n\n---\n\nWYPopoverController is available under the MIT license.\n\nCopyright © 2013 Nicolas CHENG\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":["Objective-C","etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolaschengdev%2FWYPopoverController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolaschengdev%2FWYPopoverController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolaschengdev%2FWYPopoverController/lists"}