Swiftpack.co - iWECon/Marker as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by iWECon.
iWECon/Marker 3.1.5
Light, convenient, and qualified guidance prompts. 简单、快速、可配置的引导提示。
⭐️ 11
🕓 1 week ago
.package(url: "https://github.com/iWECon/Marker.git", from: "3.1.5")


Light, convenient, and qualified guidance prompts.





  • Simple.

Simple code, simple use, simple configuration.

  • No calculation.

No calculation required (calculation of relative position, etc.)

  • Decorationable.

Can be used as a decorative view, no event in response. (hitTest:) always return nil.

  • Global.

Global style configure, global instance by identifier, global dismiss all marker instance.

  • Strong guidance.

Only respond event on tap marker range.

Needs to set options: [.strongGuidance].

Default is weak guidance: tap anywhere to respond event(show next).



Marker.Info is a structure used to describe how Marker displays.

    // Marked view
    marker: UIView?,
    // `String` or `NSAttributedString`
    intro: Any?, 
    styles: [Marker.Info.Style] = [],
    options: [Options] = [],
    // Completed this time
    completion: CompletionBlock? = nil

styles: [Marker.Info.Style]: [
    case hideArrow
    /// font of intro text
    case font(UIFont)
    /// text color of intro text
    case textColor(UIColor)
    case backgroundColor(Color)
    case arrowPosition(ArrowPosition)
    case dimFrame(CGRect)
    case highlightRangeExpande(CGFloat)
    case timeout(TimeInterval)
    /// max width of intro text
    case maxWidth(CGFloat)
    /// corner style of highlight range
    case cornerStyle(CornerStyle)
    /// horizontal alignment
    case hAlignment(HAlignment)
    /// vertical alignment
    case vAlignment(VAlignment)
    /// Spacing between triangle arrow and highlighted view.
    /// Default value see `Marker.default.spacing`.
    case spacing(CGFloat)

options: [Options]: [
    // Strong guidance. It means that only tap on the highlighted range will respond.
    // Default is weak guidance: tap anywhere to continue(next).
    // Will not repond any tap events.
    // ⚠️ Need to be used with `strongGuidance`.
    // It means that only display on view, no event repond.
    // It will set dimFrame to `.zero`.

Global Style Configuration

Marker.default, see Marker+Appearence.swift

Can configure: maxWidth, color, spacing, padding, textFont, textColor, showArrow...



let info = Marker.Info(
    marker: settingsButton, 
    intro: "Tap here enter to settings.",
    styles: [
    options: [.decoration],
    completion: { (markerInstance: Marker, isTriggerByUser: Bool) in
        print("marker of enter settings dismiss with user: \(isTriggerByUser)")

let profile = Marker.Info(
    marker: profileButton, 
    intro: "Tap here to edit your profile."
        on: self.view,
        completion: { (markerInstance: Marker, isTriggerByUser: Bool) in 
            print("marker of enter to settings and profile are all of dismiss")

HAlignment / VAlignment


Describe intro horizontal alignment.

public enum HAlignment {
    /// `Default` if available.
    case center
    case left
    case right

Marker.Info(... styles: [.hAlignment(Marker.Info.HAlignment)])


Describe intro vertical alignment.

public enum VAlignment {
    /// `Default`.
    case auto
    /// Above the highlighted view.
    case top
    /// Below the highlighted view.
    case bottom

Marker.Info(... styles: [.vAlignment(Marker.Info.VAlignment)])

Strong guidance


Only respond event(show next) on tap highlight range.

Marker.Info(... options: [.strongGuidance])


Pass event to next hitTest view on tap highlight range.

Marker.Info(... options: [.strongGuidance, .eventPenetration])


// show
Marker(info, identifier: "settings-marked").show(on: self.view)

// Dismiss specify marker
Marker.instance(from: "settings-marked")?.dismiss()

// Dismiss all marker
Marker.dismiss(triggerByUser: <#Bool#>)


Swift Package Manager

.package(url: "https://github.com/iWECon/Marker", from: "3.0.0")


Stars: 11
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics