{"id":13743408,"url":"https://github.com/alvises/FPPopover","last_synced_at":"2025-05-09T01:30:55.394Z","repository":{"id":2998421,"uuid":"4015554","full_name":"alvises/FPPopover","owner":"alvises","description":"FPPopover provides an alternative to the native iOS UIPopoverController, adding support for iPhone and additional opportunities to customize the look and feel of the popovers.","archived":false,"fork":false,"pushed_at":"2016-03-01T11:53:02.000Z","size":5875,"stargazers_count":899,"open_issues_count":76,"forks_count":247,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-05-01T09:39:34.892Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.poeticoding.com/fppopover-a-customizable-uipopovercontroller-for-iphone-and-ipad/","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/alvises.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":"2012-04-13T12:13:39.000Z","updated_at":"2025-02-03T05:09:54.000Z","dependencies_parsed_at":"2022-09-02T15:01:04.549Z","dependency_job_id":null,"html_url":"https://github.com/alvises/FPPopover","commit_stats":null,"previous_names":["50pixels/fppopover"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvises%2FFPPopover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvises%2FFPPopover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvises%2FFPPopover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvises%2FFPPopover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvises","download_url":"https://codeload.github.com/alvises/FPPopover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253174231,"owners_count":21865836,"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-03T05:00:46.250Z","updated_at":"2025-05-09T01:30:52.885Z","avatar_url":"https://github.com/alvises.png","language":"Objective-C","readme":"How To\n========\n\u003ca href=\"http://www.poeticoding.com/fppopover-a-customizable-uipopovercontroller-for-iphone-and-ipad/\"\u003eFPPopover, a customizable UIPopoverController for iPhone and iPad\u003c/a\u003e\n\nFPPopover\n========\nThis library provides an alternative to the native iOS UIPopoverController, \nadding support for iPhone and additional opportunities to customize the look and feel of the popovers.\n\nThe development started as first as a [Mobiloud](http://www.mobiloud.com) open source component, after some commits we realized was a appreciated library so I decided to continue the development, also the development is continuing thank to your feedbacks and pull requests!\n\n\u003cimg src=\"wiki_images/main.png\" height=300 border=1\u003e\n\n\nFeatures\n========\n\n* Works like UIPopoverController.\n* Runs on both iPhone and iPad.\n* Popover rendered using no images, only Quartz code.\n* Customize the look of popovers (color, dimensions).\n* Automatic orientation. It will find the best orientation and size for every situation.\n* Can draw popover with no arrows\n* Borderless popover\n* MIT License (you can use it for commercial apps, edit and redistribute).\n* Using ARC (see [ARC-Support](https://github.com/50pixels/FPPopover/wiki/ARC-support))\n\nWhat you need\n---\n\nTo use FPPopoverController you only need\n\n* FPPopoverController.m and .h    (the controller)\n* FPPopoverView.m and .h\n* FPTouchView.m and .m\n* ARCMacros.h  \n\nThat's it.\n\n\n\n\nHow to use it\n---  \n\nLet's start with a simple example\n\n```objective-c\n-(IBAction)buttonClicked:(UIButton*)okButton\n{\n    //the view controller you want to present as popover\n    YourViewController *controller = [[YourViewController alloc] init]; \n\n    //our popover\n    FPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:controller]; \n    \n    //the popover will be presented from the okButton view \n    [popover presentPopoverFromView:okButton]; \n\n    //no release (ARC enable)\n    //[controller release];\n}\n```\n    \nThis will display a black popover with automatic arrow positioning and a maximum of 200x300 content size and no delegate messages.\n\nThe title of YourViewController (controller.title) will be presented on the top.\n\n##Customize the size\n\nDefault content size is 200x300. This can be set using the following property\n```objective-c\npopover.contentSize = CGSizeMake(150,200);\n```\n\nThis property defines a maximum boundary for content, but the actual content area displayed may\nvary according to the what is found to be the optimal size to fit the popover on the screen (e.g. when adjusting the layout from portrait to landscape mode).\n\n\n\n##Customize the tint\n\n* FPPopoverBlackTint  (default)\n* FPPopoverLightGrayTint\n* FPPopoverGreenTint\n* FPPopoverRedTint\n\n```objective-c\npopover.tint = FPPopoverRedTint;\n```\n\nContact us if you need more tints!\n\n##Force the arrow direction\n\nIf you need to force the arrow direction use the arrowDirection property\n\n```objective-c\npopover.arrowDirection = FPPopoverArrowDirectionUp;\n```\n\n##No arrow\nIf you want a popover like a popup, with no arrow\n\n```objective-c\npopover.arrowDirection = FPPopoverNoArrow;\n```\n\u003cimg src=\"wiki_images/no_arrow.png\" height=200\u003e\n\n##No title\n\n```objective-c\n//the view controller you want to present as popover\nYourViewController *controller = [[YourViewController alloc] init]; \ncontroller.title = nil;\n```\n\n\u003cimg src=\"wiki_images/no_title.png\" height=200\u003e\n\n##Borderless popover\n\n```objective-c\npopover.border = NO;\npopover.tint = FPPopoverWhiteTint;\n```\n\n\u003cimg src=\"wiki_images/borderless.png\" height=200\u003e\n\n## Transparency \nIf you want to change alpha channel and handle the transparency of the popover\n\n```objective-c\npopover.alpha = 0.8;\n```\n\n![transparent popover](https://raw.github.com/50pixels/FPPopover/master/alpha_popover.png)\n\n##Delegate messages\n\nSet your delegate\n\n```objective-c    \nYourViewController *controller = [[YourViewController alloc] init]; \nFPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:controller]; \npopover.delegate = controller;\n....\n```\n\nIn this case we are setting up the YourViewController as our popover delegate.\n\n####Know when a new popover is displayed\n```objective-c\n- (void)presentedNewPopoverController:(FPPopoverController *)newPopoverController \n          shouldDismissVisiblePopover:(FPPopoverController*)visiblePopoverController;\n```\n\nUse this delegate method to know when a new different popover is displayed. If you want to dismiss the old popover, and release it, send the dismiss message inside this method.\n\n```objective-c\n- (void)presentedNewPopoverController:(FPPopoverController *)newPopoverController \n          shouldDismissVisiblePopover:(FPPopoverController*)visiblePopoverController\n{\n    [visiblePopoverController dismissPopoverAnimated:YES];\n    [visiblePopoverController autorelease];\n}\n```\n\n####Know when the popover is dismissed\n\n```objective-c\n    - (void)popoverControllerDidDismissPopover:(FPPopoverController *)popoverController;\n```\n\nUse this delegate method to know when the popover is dismissed. This could happen when the user taps outside the popover or when a dismiss message is sent by other actions.\n\n## Contributors\n\nThank you to the following wonderful people for contributing:\nalphabetically sorted\n\n * [@avolovoy](https://github.com/avolovoy)\n * [@johnlinvc](https://github.com/johnlinvc)\n * [@markd2](https://github.com/markd2)\n * [@markrickert](https://github.com/markrickert)\n * [@romanr](https://github.com/romanr)\n * [@RubenSandwich](https://github.com/RubenSandwich)\n \n \n\n","funding_links":[],"categories":["Objective-C  Stars 1000以内排名整理","Objective-C","etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvises%2FFPPopover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvises%2FFPPopover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvises%2FFPPopover/lists"}