{"id":13685210,"url":"https://github.com/nfarina/calloutview","last_synced_at":"2025-05-15T16:02:11.246Z","repository":{"id":4374095,"uuid":"5510742","full_name":"nfarina/calloutview","owner":"nfarina","description":"A lightweight callout view class for iOS mimicking UICalloutView.","archived":false,"fork":false,"pushed_at":"2021-06-14T05:10:49.000Z","size":832,"stargazers_count":1195,"open_issues_count":26,"forks_count":188,"subscribers_count":69,"default_branch":"master","last_synced_at":"2025-03-24T02:35:47.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://nfarina.com/post/78014139253/smcalloutview-for-ios-7","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nfarina.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-08-22T14:41:42.000Z","updated_at":"2025-03-22T23:15:14.000Z","dependencies_parsed_at":"2022-09-20T23:11:07.324Z","dependency_job_id":null,"html_url":"https://github.com/nfarina/calloutview","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfarina%2Fcalloutview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfarina%2Fcalloutview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfarina%2Fcalloutview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfarina%2Fcalloutview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nfarina","download_url":"https://codeload.github.com/nfarina/calloutview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245334891,"owners_count":20598386,"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-02T14:00:46.397Z","updated_at":"2025-03-24T19:08:30.307Z","avatar_url":"https://github.com/nfarina.png","language":"Objective-C","funding_links":[],"categories":["Objective-C","Objective-C  Stars 1000以内排名整理","etc"],"sub_categories":[],"readme":"![Example Screenshot](SampleAssets/CalloutScreenshot.png)\n\n\nOverview\n--------\n\nSMCalloutView aims to be an exact replica of the private UICalloutView system\ncontrol.\n\nWe all love those \"bubbles\" you get when clicking pins in MKMapView. But\nsadly, it's impossible to present this bubble-style \"Callout\" UI anywhere\noutside MKMapView. Phooey! So this class _painstakingly_ recreates this handy\ncontrol for your pleasure.\n\n\nUsage\n-----\n\nTo use SMCalloutView in your own projects, simply copy the files\n`SMCalloutView.h` and `SMCalloutView.m`.\n\nSMCalloutView, by default, will render in the new style introduced with\niOS 7. If you need the old style, simply include `SMClassicCalloutView.h`\nand `SMClassicCalloutView.m` in your project as well. There is a special\nclass constructor, `+[SMCalloutView platformCalloutView]` which will\nautomatically select the appropriate callout class for the current platform.\n\nThe comments in `SMCalloutView.h` do a lot of explaining on how to use the\nclass, but the main function you'll need is `presentCalloutFromRect:`. You'll\nspecify the view you'd like to add the callout to, as well as the rect\ndefining the \"target\" that the popup should point at. The target rect should\nbe _in the coordinate system of the target view_ (just like the similarly-\nnamed `UIPopover` method). Most likely this will be `target.frame` if you're\nadding the callout view as a sibling of the target view, or it would be\n`target.bounds` if you're adding the callout view to the target itself.\n\nYou can study the included project's UIViewController subclasses for a working\nexample.\n\n\nQuestions\n---------\n\n#### How do I change the height of the callout?\n\nIf you use only the `title/titleView/subtitle/subtitleView` properties, the\ncallout will always be the \"system standard\" height. If you assign the\n`contentView` property however, then the callout will size to fit the\n`contentView` and the other properties are ignored.\n\n  [#29]: https://github.com/nfarina/calloutview/issues/29\n\n\n#### Can I customize the background graphics?\n\nYes, the callout background is an instance of `SMCalloutBackgroundView`. You\ncan set your own custom `View` subclass to be the background, or you can use\none of the built-in subclasses:\n\n - `SMCalloutMaskedBackgroundView` renders an iOS-7 style background.\n\n - `SMCalloutImageBackgroundView` lets you specify each of the image\n   \"fragments\" that make up a horizontally-stretchable background.\n\n - `SMCalloutDrawnBackgroundView` draws the background at any size using\n   CoreGraphics methods. You can copy the `-drawRect` method and change the\n   parameters to suit your needs.\n\n\n#### Can I use the callout with the Google Maps iOS SDK?\n\nCheck out [ryanmaxwell's demo project][googlemaps] for an example of one way\nto do this. ([More discussion on this topic][#25])\n\n  [googlemaps]: https://github.com/ryanmaxwell/GoogleMapsCalloutView\n  [#25]: https://github.com/nfarina/calloutview/issues/25\n\n\n#### Have you recreated more of MapKit? \n\nNope, but other intrepid coders have!\n\n- For an awesome replacement of the pulsing blue \"Current Location\" dot, check\n  out [Sam Vermette's SVPulsingAnnotationView][dot].\n\n- And for the outdoor map data and tiles themselves, check out [Mapbox's iOS\n  SDK][mapbox], a complete open-source solution for custom maps. They even use\n  `SMCalloutView` out of the box!\n\n  [dot]: https://github.com/samvermette/SVPulsingAnnotationView\n  [mapbox]: https://www.mapbox.com/mobile/\n\n\nMore Info\n---------\n\nYou can read more info if you wish in the [blog post][].\n\n  [blog post]: http://nfarina.com/post/78014139253/smcalloutview-for-ios-7\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfarina%2Fcalloutview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnfarina%2Fcalloutview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfarina%2Fcalloutview/lists"}