Intelligently educate your users about the right features at the right time with TipKit

Posts under TipKit tag

50 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

TipKit: showing a popover tip on a SwiftUI toolbar button
Hi folks, there's currently a known issue in TipKit due to which it won't show popover tips on buttons that are inside a SwiftUI ToolbarItem. For example, if you try this code, the popover tip will not appear: ToolbarItem { Button(action: {...}) { Label("Tap here", systemImage: "gear") } .popoverTip(sampleTip) } There's an easy workaround for this issue. Just apply a style to the button. It can be any style. Some examples are bordered, borderless, plain and borderedProminent. Here's a fixed version of the above code: ToolbarItem { Button(action: {...}) { Label("Tap here", systemImage: "gear") } .buttonStyle(.plain) // Adding this line fixes the issue. .popoverTip(sampleTip) } Hope this helps anyone running into this issue.
7
7
2.9k
Jun ’24
Does `TipKit` not available right now?
I want to try the new TipKit features but when I import it from project, Xcode told me that No such module 'TipKit' and I also try the following code to create a tip directly but it doesn't work and Xcode shows Cannot find type 'Tip'. What can I do to use the new feature? // MARK: Tips define here. struct bookmarkTip: Tip { }
2
0
1.8k
Aug ’23
Tip Kit
I am trying to use tip kit in my demo app but I am unable to access its api's. When I try to call TipsCenter.shared.configure() I am getting Cannot find 'TipsCenter' in scope. I am using the latest Xcode beta and trying in swiftUI. Any solutions?
9
6
3.9k
Jul ’23
TipKitMacros throws an error
Hi folks, I'm trying to implement TipKits to understand more better but I'm facing an error while trying to use @Parameter macro. Here is the sample code that I've tried as showed on instruction videos below struct FavoriteLandmarkTip: Tip { @Parameter static var isLoggedIn: Bool = false var title: Text { Text("Save as Favourite") } var message: Text? { Text("Your favorite landmarks always appear at the top of the list.") } var asset: Image? { Image(systemName: "star") } var actions: [Action] { [ Tip.Action( id: "learn-more", title: "Learn More" ), ] } } But I'm getting this error for isLoggedIn property External macro implementation type 'TipKitMacros.ParameterMacro' could not be found for macro 'Parameter(isTransient:customID:)'; the type must be public and provided by a macro target in a Swift package, or via '-plugin-path' or '-load-plugin-library' Could you help me to solve this problem ?
1
0
930
Jul ’23
More control of TipKit arrow locations
Hello! Based on the lack of forum posts, I think I'm one of the first people to really be diving into TipKit. :) I'm trying to use a tip to coax users toward a button in the toolbar of a NavigationView. The docs say to put the TipView "close to the content", but the best I can do for the NavigationView toolbar is to put it in one of the views inside the Navigation View itself. I'm using a TipView with an arrowEdge: .top parameter, which results in this: I'd love to be able to move the arrow tip under the plus button. Is that possible in this early beta stage? Do I need to restructure my view hierarchy somehow?
5
1
1.1k
Aug ’23
TipViewStyle with default dismiss button
I have created a custom TipViewStyle to have more control over the layout in the TipView. However, I've noticed that by doing so I lose the default "X" dismiss button. I do not see any way to access it from the Configuration. Is my only solution to add an Action to my Tip? Also, as an aside, has anyone figured out a way to add a shadow other than using the popoverTip? It seems to be clipped... struct Test: TipViewStyle { func makeBody(configuration: Configuration) -> some View { HStack() { configuration.image?.scaledToFit() VStack(alignment: .leading) { configuration.title configuration.message } } } }
2
1
789
Sep ’23
Popover tips not affected by tip view modifiers
Tips presented using the popoverTip view modifier can't be styled using other tip view modifiers (as of beta 8). For instance, the last two modifiers don't have any effect here: Image(systemName: "wand.and.stars") .popoverTip(tip) .tipBackground(.red) .tipCornerRadius(30) It will look like this: Whereas applying the same modifiers to a TipView changes its look: TipView(tip, arrowEdge: .bottom) .tipBackground(.red) .tipCornerRadius(30) Is this intended behavior? How can we change the appearance of popup tips?
2
0
930
Sep ’23
TipKit Image asset tint color
Hello, I have a simple tip that im displaying, but want to change the tint color to something other than the default system blue tint. I tried different approaches that are common in changing image tint color but none seem to work. Is there a special call to achieve that? Note: I'm using UIKit to display the tip. Version 15.0 beta 8 (15A5229m) Thank you! example tip: struct FavoriteTip: Tip { var title: Text { Text("Favorite This Car") } var message: Text? { Text("Favorite this car to receive status updates and more!") } var image: Image? { Image(systemName: "heart.fill") } }
4
0
1.5k
Oct ’23
TipKit not showing via TestFlight
My TipKit views are showing in Previews, when I run on a Simulator, and on a physical device (running iOS 17 Beta), but if I archive and upload to TestFlight, I do not see them (on devices running iOS 17 Beta)... Anyone else encounter this? I am using the Xcode 15 GM (15A240d). I tried manually adding the framework into the target. I am worried that if I submit for Review it will not show on devices when released... Am I just supposed to trust that it will work via the App Store? 🫣
13
3
1.8k
Nov ’23
SwiftUI: popoverTip prevents other modal views from appearing
I want to show a tip on a button that will open a modal sheet on tap. The state if the sheet should be presented is held in an ObservableObject view model: @MainActor class ViewModel: ObservableObject { @Published var showSheet = false } struct ContentView: View { var tip = PopoverTip() @ObservedObject var viewModel = ViewModel() var body: some View { Button(action: { viewModel.showSheet.toggle() }, label: { Text("Button") }) .popoverTip(tip) .sheet(isPresented: $viewModel.showSheet) { Text("Sheet") } } } Here is the issue: When the tip is dismissed by tapping outside of it instead of tapping the close button, the tip will always reappear when tapping the button instead of showing the sheet. So effectively there is no way of triggering the actual button action, the tip will always pop up again and prevent the sheet from appearing. This is only an issue when using an ObservableObject to track the sheet state. When using a @State var showSheet: Bool inside the view itself instead, the sheet is shown as expected when tapping the button. It seems to be an issue of timing: Attempting to show the sheet somehow causes the view to be re-evaluated, which causes the tip to reappear (since it wasn't dismissed via close action). And since the tip is presented using modal presentation, the sheet can't be presented anymore. Is this a bug, or is there a simple way to avoid this issue?
3
3
1.3k
Oct ’23
Multiple PopoverTip Modifiers in SwiftUI: Persistent Display Glitch
Hello! I've encountered an issue when attempting to add multiple popoverTip modifiers in my SwiftUI code. Regardless of whether there's a specified rule or parameter, the tips begin to constantly appear and disappear. Is this a recognized issue? How can we sequentially display multiple tip popovers on complex views? Even when one tip is invalidated, the glitch persists. Should this be used only for views without any state updates? Here's a sample code that demonstrates the problem: import SwiftUI import TipKit @main struct testbedApp: App { var body: some Scene { WindowGroup { ContentView() } } init() { try? Tips.configure() } } struct PopoverTip1: Tip { var title: Text { Text("Test title 1").foregroundStyle(.indigo) } var message: Text? { Text("Test message 1") } } struct PopoverTip2: Tip { var title: Text { Text("Test title 2").foregroundStyle(.indigo) } var message: Text? { Text("Test message 2") } } struct ContentView: View { private let timer = Timer.publish(every: 0.001, on: .main, in: .common).autoconnect() @State private var counter = 1 var body: some View { VStack(spacing: 20) { Spacer() Text("Counter value: \(counter)").popoverTip(PopoverTip1()) Spacer() Text("Counter value multiplied by 2: \(counter * 2)") .foregroundStyle(.tertiary) .popoverTip(PopoverTip2()) Spacer() } .padding() .onReceive(timer) { _ in counter += 1 } } } #Preview { ContentView() }
2
1
899
Sep ’23
Dismiss Tip
Is it possible to disable the ability for the user to dismiss a tip? If not, is there a way to activate a tip again after it has been dismissed? Can the tip status be reset without deleting the datastore? I want to show a tip for password help after 3 failed login attempts but I never want it to be invalidated by the user.
3
1
875
Oct ’23
TipUIPopoverViewController disables all the views from presenting screen
when using Tips with UIKit, presenting TipUIPopoverViewController disables all the buttons from the presenting screen. I assume this is the expected behaviour but is there a way to disable it? I would like the button that the tip is pointing to to be still enabled. Otherwise user has to tap on it twice which is not ideal. Method checking for tip's eligibility. private extension MenuViewController { func activateTips() { Task { @MainActor [weak self] in guard let self else { return } for await shouldDisplay in createMapTip.shouldDisplayUpdates { if shouldDisplay { let controller = TipUIPopoverViewController(createMapTip, sourceItem: createMapButton) { [weak self] action in if action.id == "LearnAboutMaps" { if self?.presentedViewController is TipUIPopoverViewController { self?.dismiss(animated: true) { self?.createMapTip.invalidate(reason: .actionPerformed) self?.viewModel.handle(.didTapLearnMoreAboutMaps) } } } } present(controller, animated: true) } else if presentedViewController is TipUIPopoverViewController { dismiss(animated: true) } } } } }
2
0
651
Oct ’23
Bug: Tip comes back as pending first, then available when reloading screen
When loading screen, I scan for tips: private lazy var scanAreaTipTask = Task { @MainActor in for await shouldDisplay in scanAreaTip.statusUpdates { if shouldDisplay == .available { onSetBeacon.send(.scanArea(scanAreaTip, .show)) } else { onSetBeacon.send(.scanArea(scanAreaTip, .hide)) scanAreaTipFinished = true } } } Task is called in ViewDidAppear of the UIViewController. First time I load this view controller, the scanAreaTip.statusUpdates always comes back as pending. If I quit this view controller and open it again, the scanAreaTip.statusUpdates will come back as available. Why does it always come back as pending on the first opening where it should come back as available? This is the tip that I am using. As shown, there aren't any rules or options used. Just a plain tip that should show straight away. public struct ScanAreaTip: Tip { public init() {} public var title: Text { Text("Scan area around you") .brandFont(style: .regular(.headline)) .foregroundStyle(Color.accentColor) } }
1
0
522
Oct ’23