GranifyInlineView
@objc(GFYGranifyInlineView)
public class GranifyInlineView : UIView
A view that an inline campaign can be displayed into. Handlers to expand and collapse
the view must be passed in so that inline views can be displayed.
A GranifyInlineViewLabel
must be provided
Since
Since 6.0.0.-
A label that defines identifying information for this view.
Declaration
Swift
@objc dynamic public var label: GranifyInlineViewLabel? { get set }
-
Initialization function used when this object is created programatically, rather than by a storyboard.
Declaration
Swift
@objc public init( label: GranifyInlineViewLabel, expandHandler: @escaping GranifyInlineViewExpander, collapseHandler: @escaping GranifyInlineViewCollapser )
-
Initialization function used when this object is created by a storyboard. When using this initializer,
setExpandHandler
,setCollapseHandler
, andsetLabel
must be called later.Declaration
Swift
required public init?(coder: NSCoder)
-
Registers a handler that is used to expand the
GranifyInlineView
. Expect this handler to be invoked before an inline campaign is displayed. TheGranifyInlineView
will expand and the inline campaign will be displayed inside of it. The Granify SDK handles animation of the inlines internally. Do NOT add any additional animation handling.See Inlines for details on setting up your
GranifyInlineView
.Since
Since 6.0.0Declaration
Swift
public func setExpandHandler(expandHandler: @escaping GranifyInlineViewExpander)
Parameters
expandHandler
A handler that expands the
GranifyInlineView
. -
Registers a handler that is used to collapse the
GranifyInlineView
so it is no longer visible. Expect this handler to be invoked anytime theGranifyInlineView
is no longer needed to display. The Granify SDK handles animation of the inlines internally. Do NOT add any additional animation handling.See Inlines for details on setting up your
GranifyInlineView
.Since
Since 6.0.0Declaration
Swift
public func setCollapseHandler(collapseHandler: @escaping GranifyInlineViewCollapser)
Parameters
collapseHandler
A handler that collapses the
GranifyInlineView
. -
Attaches a
GranifyInlineViewLabel
, used by the Granify SDK forGranifyInlineView
identification. Whenever the contents of the superview of aGranifyInlineView
are changed such that itsGranifyInlineViewLabel
is no longer reflective of the superview’s contents (e.g. new product id, sku), this should be called to update theGranifyInlineView
‘sGranifyInlineViewLabel
.Since
Since 6.0.0Declaration
Swift
public func setLabel(label: GranifyInlineViewLabel)
Parameters
label
A
GranifyInlineViewLabel
describing thisGranifyInlineView
. -
Unlinks the view from its superview and its window, and removes it from the responder chain. This method is called automatically, and should not be called directly.
Since
Since 6.1.0Declaration
Swift
public override func removeFromSuperview()
-
Tells the view that its window object changed. This method is called automatically, and should not be called directly.
Declaration
Swift
public override func didMoveToWindow()