-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e79e34
commit cb4a970
Showing
7 changed files
with
93 additions
and
6 deletions.
There are no files selected for viewing
Submodule Examples
updated
6 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2013-2023 Snowplow Analytics Ltd. All rights reserved. | ||
// | ||
// This program is licensed to you under the Apache License Version 2.0, | ||
// and you may not use this file except in compliance with the Apache License | ||
// Version 2.0. You may obtain a copy of the Apache License Version 2.0 at | ||
// http://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the Apache License Version 2.0 is distributed on | ||
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the Apache License Version 2.0 for the specific | ||
// language governing permissions and limitations there under. | ||
|
||
import Foundation | ||
|
||
/// Event tracked when a scroll view's scroll position changes. | ||
/// If screen engagement tracking is enabled, the scroll changed events will be aggregated into a `screen_summary` entity. | ||
/// | ||
/// Schema: `iglu:com.snowplowanalytics.mobile/scroll_changed/jsonschema/1-0-0` | ||
@objc(SPScrollChanged) | ||
public class ScrollChanged: SelfDescribingAbstract { | ||
/// Vertical scroll offset in pixels | ||
@objc | ||
public var yOffset: Int | ||
/// The height of the scroll view content in pixels | ||
public var contentHeight: Int | ||
|
||
/// - Parameters: | ||
/// - yOffset: Vertical scroll offset in pixels | ||
/// - contentHeight: The height of the scroll view content in pixels | ||
@objc | ||
public init(yOffset: Int, contentHeight: Int) { | ||
self.yOffset = yOffset | ||
self.contentHeight = contentHeight | ||
} | ||
|
||
override var schema: String { | ||
return kSPScrollChangedSchema | ||
} | ||
|
||
override var payload: [String : Any] { | ||
return [ | ||
"y_offset": yOffset, | ||
"content_height": contentHeight | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters