Skip to content

Commit

Permalink
Merge branch 'main' into feat/swiftui-skip-mask-modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
ioannisj authored Dec 24, 2024
2 parents 6647158 + 39df17d commit 450ba29
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Next

- feat: add postHogNoMask() SwiftUI view modifier to explicitly mark any View as non-maskable ([#277](https://github.com/PostHog/posthog-ios/pull/277))
- feat: add `postHogNoMask` SwiftUI view modifier to explicitly mark any View as non-maskable ([#277](https://github.com/PostHog/posthog-ios/pull/277))

## 3.17.2 - 2024-12-23

- fix: ignore additional keyboard windows for $screen event ([#279](https://github.com/PostHog/posthog-ios/pull/279))

## 3.17.1 - 2024-12-18

Expand Down
2 changes: 1 addition & 1 deletion PostHog.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PostHog"
s.version = "3.17.1"
s.version = "3.17.2"
s.summary = "The hassle-free way to add posthog to your iOS app."

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion PostHog/PostHogVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

// if you change this, make sure to also change it in the podspec and check if the script scripts/bump-version.sh still works
// This property is internal only
public var postHogVersion = "3.17.1"
public var postHogVersion = "3.17.2"

public let postHogiOSSdkName = "posthog-ios"
// This property is internal only
Expand Down
1 change: 0 additions & 1 deletion PostHog/UIViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

@objc func viewDidAppearOverride(animated: Bool) {
// ignore views from keyboard window
// these may include: UIInputWindowController, _UICursorAccessoryViewController, UICompatibilityInputViewController,UIKeyboardHiddenViewController_Autofill and others
if let window = viewIfLoaded?.window, !window.isKeyboardWindow {
captureScreenView(window)
}
Expand Down
35 changes: 34 additions & 1 deletion PostHog/Utils/UIWindow+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,42 @@
import Foundation
import UIKit

/**
Known keyboard window (private) types

## UIRemoteKeyboardWindow
This is the window that manages the actual keyboard

The following system view controllers were observed to be presented in a UIRemoteKeyboardWindow window
- UIInputWindowController
- UICompatibilityInputViewController
- UISystemInputAssistantViewController
- UIPredictionViewController
- UISystemKeyboardDockController
- TUIEmojiSearchInputViewController
- STKPrewarmingViewController
- STKStickerRemoteSearchViewController
- _UIRemoteInputViewController
- _UISceneHostingViewController
- STKEmojiAndStickerCollectionViewController

## UITextEffectsWindow
Hosts system components like the magnifying glass for text selection, predictive text suggestions, copy/paste menus, input accessory views etc.

The following system view controllers were observed to be presented in a UITextEffectsWindow window
- UIInputWindowController
- UICompatibilityInputViewController

These view controllers should not appear in a $screen event. If they do, then it means that they are presented in a UIWindow not listed below
*/
private let knownKeyboardWindowTypes: [String] = [
"UIRemoteKeyboardWindow",
"UITextEffectsWindow",
]

extension UIWindow {
var isKeyboardWindow: Bool {
String(describing: type(of: window)) == "UIRemoteKeyboardWindow"
knownKeyboardWindowTypes.contains(String(describing: type(of: self)))
}
}
#endif

0 comments on commit 450ba29

Please sign in to comment.