[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6985":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":33,"discoverSource":34},6985,"AMPopTip","andreamazz\u002FAMPopTip","andreamazz","An animated popover that pops out a given frame, great for subtle UI tips and onboarding.","",null,"Swift",3326,451,65,28,0,2,8,61.77,"MIT License",false,"main",true,[25,26,27,28,29],"baloon","onboarding","popover","poptip","popup","2026-06-12 04:00:31","\u003Cp align=\"center\">\n  \u003Cimg width=\"420\" src=\"assets\u002Flogo.png\"\u002F>\n\u003C\u002Fp>\n\n![Test suite](https:\u002F\u002Fgithub.com\u002Fandreamazz\u002FAMPopTip\u002Fworkflows\u002FTest%20suite\u002Fbadge.svg)\n\nAnimated popover that pops out of a frame. You can specify the direction of the popover and the arrow that points to its origin. Color, border radius and font can be easily customized.\nThis popover can be used to leave subtle hints about your UI and provide fun looking onboarding popups.\n\n\u003Cp align=\"center\">\n  \u003Ca href='https:\u002F\u002Fappetize.io\u002Fapp\u002Fg7x2pwb9jtxdpz9yjb2p5wzk6g' alt='Live demo'>\n    \u003Cimg width=\"150\" height=\"75\" src=\"assets\u002Fdemo-button.png\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n# Screenshot\n![AMPopTip](https:\u002F\u002Fraw.githubusercontent.com\u002Fandreamazz\u002FAMPopTip\u002Fmaster\u002Fassets\u002Fscreenshot.gif)\n\n### Versioning notes\n\nWith version `2.0.0` the library was re-written in Swift, and the API was slightly updated. Checkout version `1.5.x` for the previous Objective-C implementation.\n\nVersion `3.0.0` introduces Swift 4 support, `3.5.0` Swift 4.2.\n\n# Setup with CocoaPods\n* Add ```pod 'AMPopTip'``` to your ```Podfile```\n* Run ```pod install```\n* Run ```open App.xcworkspace```\n\n# Setup with Carthage\n* Add ```github \"andreamazz\u002FAMPopTip\"```\n* Run ```carthage update```\n* Add ```AMPopTip.framework``` in your project\n\nYou can then import the framework in your project\n```swift\nimport AMPopTip\n```\n\n# Usage\nThe API is fairly straight forward, you can show and hide the popover at any time.\n\n## Showing the popover\nYou must specify the text that you want to display alongside the popover direction, its max width, the view that will contain it and the frame of the view that the popover's arrow will point to.\n\n```swift\nlet popTip = PopTip()\npopTip.show(text: \"Hey! Listen!\", direction: .up, maxWidth: 200, in: view, from: someView.frame)\n```\n\nYou can also display the popover in the center, with no arrow, in this case the `from` can be the whole view:\n```swift\npopTip.show(text: \"Hey! Listen!\", direction: .none, maxWidth: 200, in: view, from: view.frame)\n```\n\n## Coordinate system\nPlease note that the frame you are intended to provide needs to refer to the absolute coordinate system of the view you are presenting the popover in. This means that if you are presenting the popover in a view, pointing to a nested subview, you'll need to convert its frame using UIKit's `convertRect(_:toView:)`. Read the reference [here](https:\u002F\u002Fdeveloper.apple.com\u002Flibrary\u002Fios\u002Fdocumentation\u002FUIKit\u002FReference\u002FUIView_Class\u002F#\u002F\u002Fapple_ref\u002Focc\u002Finstm\u002FUIView\u002FconvertRect:toView:).\n\n## Direction\nYou can specify the direction that the tip will occupy, or you can let the library decide by using `auto` (all axis), `autoHorizontal` (only `left` or `right`) or `autoVertical` (only `up` or `down`). Once the popup is visible, the `direction` property will hold the direction that was decided. \n\n## Showing a custom view\nYou can provide a custom view that will be wrapped in the PopTip and presented.\n\n```swift\nlet customView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))\n\u002F\u002F Configure your view\npopTip.show(customView: customView, direction: .down, in: view, from: someView.frame)\n```\n\n## Showing a custom SwiftUI view\nYou can provide a custom SwiftUI view that will be embed in a `UIHostingController`, added to a parent controller and then wrapped in the PopTip and presented.\n\n```swift\nlet customSwiftUIView = MySwiftUIView()\n\u002F\u002F Configure your view\npopTip.show(rootView: customSwiftUIView, direction: .down, in: view, from: someView.frame, parent: someParentViewController)\n```\n\n## Dismissing the popover\n\nYou can hide the popover by calling:\n```swift\npopTip.hide()\n```\n\nOr you can specify the duration of the popover:\n```swift\npopTip.show(text: \"Hey! Listen!\", direction: .up, maxWidth: 200, in: view, from: someView.frame, duration: 3)\n```\n\nYou can also let the user dismiss the popover by tapping on it (default `true`):\n```swift\npopTip.shouldDismissOnTap = true\n```\n\nYou can also let the user tap outside the popover dismiss the PopTip (default `true`):\n```swift\npopTip.shouldDismissOnTapOutside = true\n```\n\nYou can also consider the origin frame as part of the popTip, i.e. treat the origin frame the same as tapping the popover (default `false`):\n```swift\npopTip.shouldConsiderOriginatingFrameAsPopTip = true\n```\n\nYou can also consider the cutout as a separate tap area that will call a different callback (default `false`):\n```swift\npopTip.shouldConsiderCutoutTapSeparately = true\n```\n\nYou can also allow the user to dismiss via swiping outside the PopTip (default `false`) (direction is controlled via `popTip.swipeRemoveGestureDirection` with `UISwipeGestureRecognizer.Direction`):\n```swift\npopTip.shouldDismissOnSwipeOutside = false\n```\n\nYou can add a block that will be fired when the user taps the PopTip...\n```swift\npopTip.tapHandler = { popTip in\n  print(\"\\(popTip) tapped\")\n}\n```\n\n... when the cutout is tapped...\n```swift\npopTip.tapCutoutHandler = { popTip in\n  print(\"\\(popTip) cutout tapped\")\n}\n```\n\n... when the popover is shown...\n```swift\npopTip.appearHandler = { popTip in\n  print(\"\\(popTip) appeared\")\n};\n```\n\n... or when the popover is dismissed:\n```swift\npopTip.dismissHandler = { popTip in\n  print(\"\\(popTip) dismissed\")\n}\n\npopTip.tapOutsideHandler = { _ in\n  print(\"tap outside\")\n}\n\npopTip.swipeOutsideHandler = { _ in\n  print(\"swipe outside\")\n}\n```\n\n# Forwarding tap gesture on dismiss\n\nBy default the \"tap to dismiss\" gesture recognizer cancels the taps in the view, you can enable this behaviour manually if needed:\n```swift\npopTip.tapToRemoveGestureRecognizer?.cancelsTouchesInView = false\n```\n\n# Updating the PopTip\n\nYou can update the text, attributed text, or custom view to a PopTip already visible:\n\n```swift\npopTip.update(text: \"New string\")\npopTip.update(attributedText: someAttributedString)\npopTip.update(customView: someView)\n```\n\nThe position can also be changed by updating the `from` property:\n\n```swift\nlet here = CGRect(x: 100, 100, 10, 10)\nlet there = CGRect(x: 400, 400, 10, 10)\n\npopTip.show(text: \"Hey! Listen!\", direction: .up, maxWidth: 200, in: view, from: here)\nDispatchQueue.main.asyncAfter(deadline: .now() + 2) {\n  popTip.from = there\n}\n```\n\n# Custom entrance animation\n\nYou can choose which animation should be performed when the popTip is displayed:\n```swift\npopTip.entranceAnimation = .scale;\n```\n\nAvailable animations:\n```swift\nPopTipEntranceAnimation.scale,\nPopTipEntranceAnimation.transition,\nPopTipEntranceAnimation.none,\nPopTipEntranceAnimation.custom\n```\n\n## PopTipEntranceAnimation.custom\n\nYou can provide your own animation block when using `PopTipEntranceAnimation.custom`:\n```swift\npopTip.entranceAnimationHandler = { [weak self] completion in\n  guard let `self` = self else { return }\n  self.popTip.transform = CGAffineTransform(rotationAngle: 0.3)\n  UIView.animate(withDuration: 0.5, animations: {\n    self.popTip.transform = .identity\n  }, completion: { (_) in\n    completion()\n  })\n}\n```\nThis sample makes the PopTip rotate on entrance. Make sure to call the completion block when the animation is done. Also note that the animation is fired as soon as the PopTip is added as subview.\n\n# Action animations\nAction animations are subtle animations that can be performed to get the user's attention.\nSet your preferred animation:\n```swift\npopTip.actionAnimation = .bounce()\n```\n\nAvailable animations:\n```swift\nPopTipActionAnimation.bounce,\nPopTipActionAnimation.float,\nPopTipActionAnimation.pulse,\nPopTipActionAnimation.none\n```\nThe animation is fired as soon as the popover enters the scene and completes its entrance animation, if `startActionAnimationOnShow` is set to true.\n\n## Customize the animations\n\nYou can pass a custom value as an associated value to customize the action animation:\n\n```swift\npopTip.actionAnimation = .bounce(16) \u002F\u002F This will bounce for 16px instead of the default value\n```\n\n![AMPopTip bounce](assets\u002Fbounce_effect.gif)\n\n# Customizing the arrow position\n\nThe arrow is centered by default, and moves to avoid the edge of the screen. You can manually change the offset from the center using the `bubbleOffset` property.\n\n# A note about subviews\n\nThe popover is presented inside the view provided in the `in` parameter. If this view is smaller than the resulting popover, to prevent clipping set `clipsToBounds = false` on the presenting view, and set `constrainInContainerView = false` to the pop tip instance. See #175 for more context.\n\n# Customization\n\nUse the appearance proxy to customize the popover before creating the instance, or just use its public properties:\n```swift\ntextColor = \u003C#UIColor#>;\ntextAlignment = \u003C#NSTextAlignment#>\nbubbleColor = \u003C#UIColor#>\nbubbleLayerGenerator = \u003C#(PopTip)->Void#>\nborderColor = \u003C#UIColor#>\nborderWidth = \u003C#CGFloat#>\ncornerRadius = \u003C#CGFloat#> \u002F\u002F Popover's border radius\nisRounded = \u003C#Bool#> \u002F\u002F If set to YES the radius will equal frame.height \u002F 2\noffset = \u003C#CGFloat#> \u002F\u002F Offset between the popover and the origin\nfont = \u003C#UIFont#>\npadding = \u003C#CGFloat#>\nedgeInsets = \u003C#UIEdgeInsets#>\narrowSize = \u003C#CGSize#>\nanimationIn = \u003C#TimeInterval#>\nanimationOut = \u003C#TimeInterval#>\ndelayIn = \u003C#TimeInterval#>\ndelayOut = \u003C#TimeInterval#>\nentranceAnimation = \u003C#PopTipEntranceAnimation#>\nexitAnimation = \u003C#PopTipExitAnimation#>\nactionAnimation = \u003C#PopTipActionAnimation#>\nactionAnimationIn = \u003C#TimeInterval#>\nactionAnimationOut = \u003C#TimeInterval#>\nactionDelayIn = \u003C#TimeInterval#>\nactionDelayOut = \u003C#TimeInterval#>\nedgeMargin = \u003C#CGFloat#>\nbubbleOffset = \u003C#CGFloat#> \u002F\u002F Offset between the bubble and the origin\narrowOffset = \u003C#CGFloat#> \u002F\u002F Offset between the bubble center and the arrow\narrowRadius = \u003C#CGFloat#>\nshadowOpacity = \u003C#Float#>\nshadowRadius = \u003C#Float#>\nshadowOffset = \u003C#CGSize#>\nshadowColor = \u003C#UIColor#>\nmaskColor = \u003C#UIColor#>\nshouldShowMask = \u003C#Bool#>\nshouldCutoutMask = \u003C#Bool#>\ncutoutPathGenerator = \u003C#(CGRect)->UIBezierPath#>\nconstrainInContainerView = \u003C#Bool#>\n```\n\n## Background mask\nA background mask can be applied to dim the background when the PopTip is active, this can be enabeld by setting the public property to `true`:\n```swift\npopTip.shouldShowMask = true\n```\n\nThe color is set by the `maskColor` property (default is `UIColor(red: 0, green: 0, blue: 0, alpha: 0.6)`):\n```swift\npopTip.maskColor = UIColor(red: 1, green: 0, blue: 0, alpha: 0.6)\n```\n\n### Adding a cutout\nA cutout can be applied to the background mask to allow the `from` view to be visible through the dimmed background. `shouldShowMask` must be `true` as well as `shouldCutoutMask` for this to work. The cutout path is supplied via a closure with a signature of `(_ from: CGRect) -> UIBezierPath` stored against public property `cutoutPathGenerator`. The closure will provide an argument which is the `CGRect` frame supplied to `popTip.show(...)`.\n\nThe default generator add an `8` rounded rectangle around the `from` frame area which has `8` padding in the `x` and `y` directions, it is as follows but can be changed to whatever is desired:\n```swift\npopTip.cutoutPathGenerator = { from in\n  UIBezierPath(roundedRect: from.insetBy(dx: -8, dy: -8), byRoundingCorners: .allCorners, cornerRadii: CGSize(width: 8, height: 8))\n}\n```\n\nA seperate callback closure can be called on tapping the area defined by the `cutoutPathGenerator` provided both `shouldShowMask` and `shouldCutoutMask` are `true`, the closure is as follows:\n```swift\npopTip.tapCutoutHandler = { popTip in\n  print(\"\\(popTip) cutout tapped\")\n}\n```\n\n## Custom bubble background\nA custom `CALayer` can be used as the background for the PopTip bubble, this is supplied via a closure with a signauture of `((_ path: UIBezierPath) -> CALayer?)?` stored against public property `bubbleLayerGenerator`. The closure will provide an argument which is the `UIBezierPath` that represents the draw path for the PopTip bubble and arrow.\n\nIf `bubbleLayerGenerator` is `nil`, then the `bubbleColor` will be used instead for a solid background fill. If `bubbleLayerGenerator` is not `nil`, then it will be used, providing it provides a valid `CALayer`, otherwise `bubbleColor` will be used as a solid color fallback. Example below:\n```swift\npopTip.bubbleLayerGenerator = { path in\n  \n  let gradient = CAGradientLayer()\n  gradient.frame = path.bounds\n  gradient.colors = [UIColor.black.withAlphaComponent(0.4).cgColor, UIColor.black.withAlphaComponent(0.3)]\n  gradient.locations = [0, 1]\n  gradient.startPoint = CGPoint(x: 0.5, y: 0.0)\n  gradient.endPoint = CGPoint(x: 0.5, y: 1.0)\n    \n  let shapeMask = CAShapeLayer()\n  shapeMask.path = path.cgPath\n  gradient.mask = shapeMask\n  \n  return gradient\n}\n```\n\n# Author\n[Andrea Mazzini](https:\u002F\u002Ftwitter.com\u002Ftheandreamazz). I'm available for freelance work, feel free to contact me.\n\nWant to support the development of [these free libraries](https:\u002F\u002Fcocoapods.org\u002Fowners\u002F734)? Buy me a coffee ☕️ via [Paypal](https:\u002F\u002Fwww.paypal.me\u002Fandreamazzini).\n\n# Contributors\nThanks to [everyone](https:\u002F\u002Fgithub.com\u002Fandreamazz\u002FAMPopTip\u002Fgraphs\u002Fcontributors) kind enough to submit a pull request.\n\n# MIT License\n\n\tCopyright (c) 2017 Andrea Mazzini. All rights reserved.\n\n\tPermission is hereby granted, free of charge, to any person obtaining a\n\tcopy of this software and associated documentation files (the \"Software\"),\n\tto deal in the Software without restriction, including\n\twithout limitation the rights to use, copy, modify, merge, publish,\n\tdistribute, sublicense, and\u002For sell copies of the Software, and to\n\tpermit persons to whom the Software is furnished to do so, subject to\n\tthe following conditions:\n\n\tThe above copyright notice and this permission notice shall be included\n\tin all copies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\tOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\tMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n\tIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n\tCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n\tTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n\tSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","AMPopTip 是一个用于iOS应用的动画弹出框库，能够从指定视图中弹出提示信息，非常适合用于界面提示和新用户引导。它支持自定义方向、箭头指向、颜色、圆角半径以及字体等样式，使得开发者可以根据需求灵活调整弹出框外观。该库使用Swift编写，并且提供了CocoaPods和Carthage两种集成方式，方便地融入到项目当中。无论是需要为用户提供直观的操作指导还是希望增强应用的用户体验设计，AMPopTip都是一个理想的选择。","2026-06-11 03:09:59","top_language"]