Skip to content

Commit

Permalink
feat: add support for ph-label in autocapture elements (#271)
Browse files Browse the repository at this point in the history
* feat: add postHogLabel

* fix: build

* Update PostHog/Autocapture/ForwardingPickerViewDelegate.swift

Co-authored-by: Manoel Aranda Neto <[email protected]>

* fix: remove fatalError

* fix: remove masking

* fix: unmask when removed from hierarchy

* fix: capture only superclass if not common base type

* fix: remove PostHogLabelTaggerView from hierarchy if not needed

* fix: remove single char identifiers

---------

Co-authored-by: Manoel Aranda Neto <[email protected]>
  • Loading branch information
ioannisj and marandaneto authored Dec 10, 2024
1 parent 8a9d07f commit 3db5aeb
Show file tree
Hide file tree
Showing 12 changed files with 340 additions and 978 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

- feat: ability to add a custom label to autocapture elements ([#271](https://github.com/PostHog/posthog-ios/pull/271))

## 3.16.2 - 2024-12-05

- fix: ignore autocapture events from keyboard window ([#269](https://github.com/PostHog/posthog-ios/pull/269))
Expand Down
20 changes: 20 additions & 0 deletions PostHog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,16 @@
69F5183A2BB2BA8300F52C14 /* UIApplicationTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F518392BB2BA8300F52C14 /* UIApplicationTracker.swift */; };
DA0CA6F12CFF6B6300AF9500 /* UIWindow+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0CA6F02CFF6B6300AF9500 /* UIWindow+.swift */; };
DA26419C2CC0499300CB427B /* PostHogAutocaptureEventTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA26419A2CC0499300CB427B /* PostHogAutocaptureEventTracker.swift */; };
DA4932FD2D0102950092C213 /* AssociatedKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA4932FC2D0102910092C213 /* AssociatedKeys.swift */; };
DA5AA7192CE245D2004EFB99 /* UIApplication+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA5AA7132CE245CD004EFB99 /* UIApplication+.swift */; };
DA5B85882CD21CBB00686389 /* AutocaptureEventProcessing.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA5B85872CD21CBB00686389 /* AutocaptureEventProcessing.swift */; };
DA979D7B2CD370B700F56BAE /* PostHogAutocaptureEventTrackerSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA979D7A2CD370B700F56BAE /* PostHogAutocaptureEventTrackerSpec.swift */; };
DAC699D62CC790D9000D1D6B /* PostHogAutocaptureIntegration.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC699D52CC790D9000D1D6B /* PostHogAutocaptureIntegration.swift */; };
DAC699EC2CCA73E5000D1D6B /* ForwardingPickerViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC699EB2CCA73E5000D1D6B /* ForwardingPickerViewDelegate.swift */; };
DACF6D5D2CD2F5BC00F14133 /* PostHogAutocaptureIntegrationSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = DACF6D5C2CD2F5BC00F14133 /* PostHogAutocaptureIntegrationSpec.swift */; };
DAD5DD0C2CB6DEF30087387B /* PostHogMaskViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAD5DD072CB6DEE70087387B /* PostHogMaskViewModifier.swift */; };
DAD76A212D006AEE003E1A43 /* UIView+PostHogLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAD76A1B2D006AE8003E1A43 /* UIView+PostHogLabel.swift */; };
DAD76A242D006C15003E1A43 /* View+PostHogLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAD76A232D006C0B003E1A43 /* View+PostHogLabel.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -395,6 +398,7 @@
69F518392BB2BA8300F52C14 /* UIApplicationTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIApplicationTracker.swift; sourceTree = "<group>"; };
DA0CA6F02CFF6B6300AF9500 /* UIWindow+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIWindow+.swift"; sourceTree = "<group>"; };
DA26419A2CC0499300CB427B /* PostHogAutocaptureEventTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostHogAutocaptureEventTracker.swift; sourceTree = "<group>"; };
DA4932FC2D0102910092C213 /* AssociatedKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociatedKeys.swift; sourceTree = "<group>"; };
DA5AA7132CE245CD004EFB99 /* UIApplication+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+.swift"; sourceTree = "<group>"; };
DA5B85872CD21CBB00686389 /* AutocaptureEventProcessing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutocaptureEventProcessing.swift; sourceTree = "<group>"; };
DA8D37242CBEAC02005EBD27 /* PostHogExampleAutocapture.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PostHogExampleAutocapture.xcodeproj; path = PostHogExampleAutocapture/PostHogExampleAutocapture.xcodeproj; sourceTree = "<group>"; };
Expand All @@ -403,6 +407,8 @@
DAC699EB2CCA73E5000D1D6B /* ForwardingPickerViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForwardingPickerViewDelegate.swift; sourceTree = "<group>"; };
DACF6D5C2CD2F5BC00F14133 /* PostHogAutocaptureIntegrationSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostHogAutocaptureIntegrationSpec.swift; sourceTree = "<group>"; };
DAD5DD072CB6DEE70087387B /* PostHogMaskViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostHogMaskViewModifier.swift; sourceTree = "<group>"; };
DAD76A1B2D006AE8003E1A43 /* UIView+PostHogLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+PostHogLabel.swift"; sourceTree = "<group>"; };
DAD76A232D006C0B003E1A43 /* View+PostHogLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+PostHogLabel.swift"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -524,6 +530,7 @@
690FF0AE2AEB9C1400A0B06B /* DateUtils.swift */,
699C5FE52C20178E007DB818 /* UUIDUtils.swift */,
690B2DF22C205B5600AE3B45 /* TimeBasedEpochGenerator.swift */,
DA4932FC2D0102910092C213 /* AssociatedKeys.swift */,
);
path = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -769,6 +776,8 @@
DA26419B2CC0499300CB427B /* Autocapture */ = {
isa = PBXGroup;
children = (
DAD76A222D006BF7003E1A43 /* SwiftUI */,
DAD76A1B2D006AE8003E1A43 /* UIView+PostHogLabel.swift */,
DA5B85872CD21CBB00686389 /* AutocaptureEventProcessing.swift */,
DAC699EB2CCA73E5000D1D6B /* ForwardingPickerViewDelegate.swift */,
DAC699D52CC790D9000D1D6B /* PostHogAutocaptureIntegration.swift */,
Expand All @@ -785,6 +794,14 @@
name = Products;
sourceTree = "<group>";
};
DAD76A222D006BF7003E1A43 /* SwiftUI */ = {
isa = PBXGroup;
children = (
DAD76A232D006C0B003E1A43 /* View+PostHogLabel.swift */,
);
path = SwiftUI;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -1153,6 +1170,7 @@
69261D252AD9787A00232EC7 /* PostHogExtensions.swift in Sources */,
3AE3FB4E2993D1D600AFFC18 /* PostHogStorageManager.swift in Sources */,
3AE3FB49299391DF00AFFC18 /* PostHogStorage.swift in Sources */,
DAD76A212D006AEE003E1A43 /* UIView+PostHogLabel.swift in Sources */,
69261D232AD9784200232EC7 /* PostHogVersion.swift in Sources */,
69779BEC2AE68E6900D7A48E /* UIViewController.swift in Sources */,
3A0F108929C9BD76002C0084 /* Errors.swift in Sources */,
Expand All @@ -1168,6 +1186,7 @@
69ED1A5C2C7F15F300FE7A91 /* PostHogSessionManager.swift in Sources */,
69F23A742BB3088E001194F6 /* URLSessionSwizzler.swift in Sources */,
69F518142BAC7F4300F52C14 /* Date+Util.swift in Sources */,
DA4932FD2D0102950092C213 /* AssociatedKeys.swift in Sources */,
69F5183A2BB2BA8300F52C14 /* UIApplicationTracker.swift in Sources */,
69F518182BAC80A300F52C14 /* String+Util.swift in Sources */,
69ED1A882C89B73100FE7A91 /* PostHogSwiftUIViewModifiers.swift in Sources */,
Expand All @@ -1185,6 +1204,7 @@
690FF0B52AEBBD3C00A0B06B /* DictUtils.swift in Sources */,
69F23A7A2BB309F3001194F6 /* MethodSwizzler.swift in Sources */,
69261D1B2AD9678C00232EC7 /* PostHogEvent.swift in Sources */,
DAD76A242D006C15003E1A43 /* View+PostHogLabel.swift in Sources */,
69EE82BC2BA9C53000EB9542 /* PostHogSessionReplayConfig.swift in Sources */,
DA5AA7192CE245D2004EFB99 /* UIApplication+.swift in Sources */,
69EE82CE2BAAC76000EB9542 /* ViewTreeSnapshotStatus.swift in Sources */,
Expand Down
Loading

0 comments on commit 3db5aeb

Please sign in to comment.