Skip to content

Commit

Permalink
fix: visionOS support via Cocoapods (#317)
Browse files Browse the repository at this point in the history
* fix: change imp attributes type to [String: Any]

* style: code format

* fix: crash when set dynamic general properties with non-string keys

* fix: delete unnecessary conditional codes

* fix: ANLSPI-18506 crash when dismiss action sheet triggered by popover dimming view

* fix: visionOS support via Cocoapods

---------

Co-authored-by: GIOSDK <[email protected]>
  • Loading branch information
YoloMao and GIOSDK authored May 30, 2024
1 parent da7c57c commit 9ab87ec
Show file tree
Hide file tree
Showing 14 changed files with 210 additions and 130 deletions.
35 changes: 30 additions & 5 deletions Example/Example-tvOS/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="22505" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="32700.99.1234" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="appleTV" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -20,25 +21,49 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dPC-6W-Dib">
<rect key="frame" x="877" y="503" width="166" height="75"/>
<rect key="frame" x="899" y="307" width="146" height="75"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="contentEdgeInsets" minX="40" minY="20" maxX="40" maxY="20"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button">
<buttonConfiguration key="configuration" style="plain" title="track">
<color key="baseForegroundColor" name="AccentColor"/>
</buttonConfiguration>
<connections>
<action selector="buttonAction:" destination="BYZ-38-t0r" eventType="primaryActionTriggered" id="Dkr-CW-Ps5"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a9h-O3-V3g">
<rect key="frame" x="867" y="433" width="210" height="75"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="contentEdgeInsets" minX="40" minY="20" maxX="40" maxY="20"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="showAlert">
<color key="baseForegroundColor" name="AccentColor"/>
</buttonConfiguration>
<connections>
<action selector="showAlert:" destination="BYZ-38-t0r" eventType="primaryActionTriggered" id="8uC-Uo-kJO"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9el-uq-kTO">
<rect key="frame" x="819" y="577" width="307" height="75"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="contentEdgeInsets" minX="40" minY="20" maxX="40" maxY="20"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="showActionSheet">
<color key="baseForegroundColor" name="AccentColor"/>
</buttonConfiguration>
<connections>
<action selector="showActionSheet:" destination="BYZ-38-t0r" eventType="primaryActionTriggered" id="1ut-zQ-mUz"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="wu6-TO-1qx"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-46" y="-74"/>
<point key="canvasLocation" x="183" y="-94"/>
</scene>
</scenes>
<resources>
Expand Down
26 changes: 26 additions & 0 deletions Example/Example-tvOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,31 @@ class ViewController: UIViewController {
GrowingAutotracker.sharedInstance().trackCustomEvent("tvOS_custom_event", withAttributes: ["key2": "value"])
}

@IBAction func showAlert(_ sender: UIButton) {
let title = "title"
let message = "message"
let controller = UIAlertController(title: title, message: message, preferredStyle: .alert)
controller.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { action in

}))
controller.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in

}))
self.present(controller, animated: true)
}

@IBAction func showActionSheet(_ sender: UIButton) {
let title = "title"
let message = "message"
let controller = UIAlertController(title: title, message: message, preferredStyle: .actionSheet)
controller.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { action in

}))
controller.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in

}))
self.present(controller, animated: true)
}

}

Loading

0 comments on commit 9ab87ec

Please sign in to comment.