Skip to content

Commit 85ef99a

Browse files
authored
tvOS fixes (#3350)
1 parent 1380575 commit 85ef99a

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

Airship/Airship.xcodeproj/project.pbxproj

-13
Original file line numberDiff line numberDiff line change
@@ -1041,13 +1041,6 @@
10411041
remoteGlobalIDString = 494DD9561B0EB677009C134E;
10421042
remoteInfo = AirshipCore;
10431043
};
1044-
6E0B8746294A9C950064B7BD /* PBXContainerItemProxy */ = {
1045-
isa = PBXContainerItemProxy;
1046-
containerPortal = 494DD94E1B0EB677009C134E /* Project object */;
1047-
proxyType = 1;
1048-
remoteGlobalIDString = 494DD9561B0EB677009C134E;
1049-
remoteInfo = AirshipCore;
1050-
};
10511044
6E107F032B30B887007AFC4D /* PBXContainerItemProxy */ = {
10521045
isa = PBXContainerItemProxy;
10531046
containerPortal = 494DD94E1B0EB677009C134E /* Project object */;
@@ -4783,7 +4776,6 @@
47834776
);
47844777
dependencies = (
47854778
6E0B8743294A9C780064B7BD /* PBXTargetDependency */,
4786-
6E0B8747294A9C950064B7BD /* PBXTargetDependency */,
47874779
);
47884780
name = AirshipAutomation;
47894781
productName = AirshipAutomationSwift;
@@ -6257,11 +6249,6 @@
62576249
target = 494DD9561B0EB677009C134E /* AirshipCore */;
62586250
targetProxy = 6E0B8742294A9C780064B7BD /* PBXContainerItemProxy */;
62596251
};
6260-
6E0B8747294A9C950064B7BD /* PBXTargetDependency */ = {
6261-
isa = PBXTargetDependency;
6262-
target = 494DD9561B0EB677009C134E /* AirshipCore */;
6263-
targetProxy = 6E0B8746294A9C950064B7BD /* PBXContainerItemProxy */;
6264-
};
62656252
6E107F042B30B887007AFC4D /* PBXTargetDependency */ = {
62666253
isa = PBXTargetDependency;
62676254
target = 494DD9561B0EB677009C134E /* AirshipCore */;

Airship/AirshipAutomation/Source/InAppMessage/View/ButtonGroup.swift

+3
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ struct ButtonView: View {
163163
borderWidth: 2)
164164
}
165165
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
166+
#if os(tvOS)
167+
.buttonStyle(.card)
168+
#endif
166169
}
167170

168171
private func onTap() {

Airship/AirshipAutomation/Source/InAppMessage/View/CloseButton.swift

+9-10
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,16 @@ struct CloseButton: View {
4343

4444
var body: some View {
4545
Button(action: onTap) {
46-
VStack(alignment: .center, spacing: 0) {
47-
Spacer()
48-
dismissButtonImage
49-
Spacer()
50-
}
46+
dismissButtonImage
47+
.frame(
48+
width: max(tappableWidth, width),
49+
height: max(tappableHeight, height)
50+
)
5151
}
52-
.frame(
53-
width: max(tappableWidth, width),
54-
height: max(tappableHeight, height)
55-
)
56-
.accessibilityLabel("Dismiss")
52+
.accessibilityLabel("Dismiss")
53+
#if os(tvOS)
54+
.buttonStyle(.card)
55+
#endif
5756
}
5857
}
5958

Airship/AirshipAutomation/Source/InAppMessage/View/InAppMessageBannerView.swift

+4
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ struct InAppMessageBannerView: View {
213213
.padding(theme.padding)
214214
.applyTransitioningPlacement(placement: displayContent.placement ?? .bottom)
215215
.offset(x: 0, y: swipeOffset)
216+
#if !os(tvOS)
216217
.simultaneousGesture(swipeGesture)
218+
#endif
217219
.onAppear {
218220
setShowing(state: true)
219221
timer.onAppear()
@@ -253,6 +255,7 @@ struct InAppMessageBannerView: View {
253255
}
254256
}
255257

258+
#if !os(tvOS)
256259
private var swipeGesture: some Gesture {
257260
let minSwipeDistance: CGFloat = if self.bannerConstraints.size.height > 0 {
258261
min(100.0, self.bannerConstraints.size.height * 0.5)
@@ -292,6 +295,7 @@ struct InAppMessageBannerView: View {
292295
}
293296
}
294297
}
298+
#endif
295299
}
296300

297301
fileprivate extension View {

tvOSSample/tvOSSample.xcodeproj/project.pbxproj

+15
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@
109109
remoteGlobalIDString = 847BFFF3267CD739007CD249;
110110
remoteInfo = AirshipPreferenceCenter;
111111
};
112+
6EAF57842D36F96200DF01BB /* PBXContainerItemProxy */ = {
113+
isa = PBXContainerItemProxy;
114+
containerPortal = 6E65D5492396E99A00AF2D1A /* Airship.xcodeproj */;
115+
proxyType = 2;
116+
remoteGlobalIDString = A641E1472BDBBDB400DE6FAA;
117+
remoteInfo = AirshipObjectiveC;
118+
};
112119
6EB1B40326EAA526000421B9 /* PBXContainerItemProxy */ = {
113120
isa = PBXContainerItemProxy;
114121
containerPortal = 6E65D5492396E99A00AF2D1A /* Airship.xcodeproj */;
@@ -183,6 +190,7 @@
183190
6E6DD1612CE80FE8009CB521 /* AirshipFeatureFlags.framework */,
184191
6E65D5672396E99A00AF2D1A /* AirshipMessageCenter.framework */,
185192
6EB1B40826EAA526000421B9 /* AirshipPreferenceCenter.framework */,
193+
6EAF57852D36F96200DF01BB /* AirshipObjectiveC.framework */,
186194
6E65D5632396E99A00AF2D1A /* AirshipDebug.framework */,
187195
6E65D55F2396E99A00AF2D1A /* AirshipTests.xctest */,
188196
6E250F2929DFF1480016A030 /* AirshipAutomationTests.xctest */,
@@ -360,6 +368,13 @@
360368
remoteRef = 6E6DD1622CE80FE8009CB521 /* PBXContainerItemProxy */;
361369
sourceTree = BUILT_PRODUCTS_DIR;
362370
};
371+
6EAF57852D36F96200DF01BB /* AirshipObjectiveC.framework */ = {
372+
isa = PBXReferenceProxy;
373+
fileType = wrapper.framework;
374+
path = AirshipObjectiveC.framework;
375+
remoteRef = 6EAF57842D36F96200DF01BB /* PBXContainerItemProxy */;
376+
sourceTree = BUILT_PRODUCTS_DIR;
377+
};
363378
6EB1B40426EAA526000421B9 /* AirshipBasement.framework */ = {
364379
isa = PBXReferenceProxy;
365380
fileType = wrapper.framework;

0 commit comments

Comments
 (0)