Skip to content

Commit

Permalink
Use ObjC for custom classes in storyboards
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Jun 28, 2024
1 parent f3d6eba commit 4f3fe29
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ protocol MediaEditorAnnotationViewUndoObserver: NSObject {
/// Wrapper view that contains an image view and a PencilKit canvas to allow
/// drawing on top of the image.
///
@objc(WPMediaEditorAnnotationView)
@available(iOS 13.0, *)
class MediaEditorAnnotationView: UIView {

Expand Down
1 change: 1 addition & 0 deletions Sources/Capabilities/Drawing/MediaEditorDrawing.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit

@objc(WPMediaEditorDrawingViewController)
@available(iOS 13.0, *)
class MediaEditorDrawing: UIViewController {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit

@objc(WPMediaEditorFilterCell)
class MediaEditorFilterCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var title: UILabel!
Expand Down
1 change: 1 addition & 0 deletions Sources/Capabilities/Filters/MediaEditorFilters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ struct MediaEditorFilter {
let ciFilterName: String
}

@objc(WPMediaEditorFiltersViewController)
class MediaEditorFilters: UIViewController {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var filtersCollectionView: UICollectionView!
Expand Down
1 change: 1 addition & 0 deletions Sources/MediaEditorCapabilityCell.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit

@objc(WPMediaEditorCapabilityCell)
class MediaEditorCapabilityCell: UICollectionViewCell {
@IBOutlet weak var iconButton: UIButton!

Expand Down
1 change: 1 addition & 0 deletions Sources/MediaEditorHub.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit

@objc(WPMediaEditorHubViewController)
public class MediaEditorHub: UIViewController {

@IBOutlet public weak var doneButton: UIButton!
Expand Down
1 change: 1 addition & 0 deletions Sources/MediaEditorImageCell.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit

@objc(WPMediaEditorImageCell)
class MediaEditorImageCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var errorView: UIView!
Expand Down
1 change: 1 addition & 0 deletions Sources/MediaEditorThumbCell.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit

@objc(WPMediaEditorThumbCell)
class MediaEditorThumbCell: UICollectionViewCell {
@IBOutlet weak var thumbImageView: UIImageView!

Expand Down
22 changes: 11 additions & 11 deletions Sources/Resources/MediaEditorDrawing.storyboard
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Media Editor Drawing-->
<!--Media Editor Drawing View Controller-->
<scene sceneID="c1B-7t-CTr">
<objects>
<viewController storyboardIdentifier="drawingViewController" id="uy1-xE-iLe" customClass="MediaEditorDrawing" customModule="MediaEditor" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="drawingViewController" id="uy1-xE-iLe" customClass="WPMediaEditorDrawingViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="4Jy-bd-2Ao">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="AlG-Gr-6cY">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<rect key="frame" x="0.0" y="48" width="414" height="814"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="BwS-ar-kTV">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IFy-2Y-4OM">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IFy-2Y-4OM">
<rect key="frame" x="0.0" y="0.0" width="156" height="44"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="53" id="FTj-uO-CKq"/>
Expand Down Expand Up @@ -71,7 +71,7 @@
</button>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="egE-uW-K1q">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="egE-uW-K1q">
<rect key="frame" x="361" y="0.0" width="53" height="44"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="53" id="Bay-oh-sXZ"/>
Expand All @@ -90,10 +90,10 @@
</constraints>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="K5w-Z1-QLC">
<rect key="frame" x="0.0" y="54" width="414" height="764"/>
<rect key="frame" x="0.0" y="54" width="414" height="760"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KuD-cb-ysj" userLabel="Annotation View" customClass="MediaEditorAnnotationView" customModule="MediaEditor" customModuleProvider="target">
<rect key="frame" x="10" y="0.0" width="394" height="764"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KuD-cb-ysj" userLabel="Annotation View" customClass="WPMediaEditorAnnotationView">
<rect key="frame" x="10" y="0.0" width="394" height="760"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
Expand All @@ -108,14 +108,14 @@
</subviews>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="sGv-Ig-jBp"/>
<color key="backgroundColor" white="0.12" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="AlG-Gr-6cY" firstAttribute="top" secondItem="sGv-Ig-jBp" secondAttribute="top" id="LbP-L3-IdF"/>
<constraint firstItem="sGv-Ig-jBp" firstAttribute="bottom" secondItem="AlG-Gr-6cY" secondAttribute="bottom" id="a35-7A-fOc"/>
<constraint firstItem="sGv-Ig-jBp" firstAttribute="trailing" secondItem="AlG-Gr-6cY" secondAttribute="trailing" symbolic="YES" id="kjm-l6-Ik3"/>
<constraint firstItem="AlG-Gr-6cY" firstAttribute="leading" secondItem="sGv-Ig-jBp" secondAttribute="leading" id="n9m-6v-EBP"/>
</constraints>
<viewLayoutGuide key="safeArea" id="sGv-Ig-jBp"/>
</view>
<connections>
<outlet property="annotationView" destination="KuD-cb-ysj" id="c7S-PG-Eps"/>
Expand Down
36 changes: 19 additions & 17 deletions Sources/Resources/MediaEditorFilters.storyboard
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="collection view cell content view" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Media Editor Filters-->
<!--Media Editor Filters View Controller-->
<scene sceneID="c1B-7t-CTr">
<objects>
<viewController storyboardIdentifier="filtersViewController" id="uy1-xE-iLe" customClass="MediaEditorFilters" customModule="MediaEditor" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="filtersViewController" id="uy1-xE-iLe" customClass="WPMediaEditorFiltersViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="4Jy-bd-2Ao">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="AlG-Gr-6cY">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="59" width="393" height="759"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="K5w-Z1-QLC">
<rect key="frame" x="0.0" y="0.0" width="600" height="443"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="602"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="xoj-Wy-HEs">
<rect key="frame" x="10" y="0.0" width="580" height="443"/>
<rect key="frame" x="10" y="0.0" width="373" height="602"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand All @@ -34,7 +36,7 @@
</constraints>
</view>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="ssr-tN-2F7">
<rect key="frame" x="0.0" y="453" width="600" height="93"/>
<rect key="frame" x="0.0" y="612" width="393" height="93"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="93" id="FCk-xw-ORD"/>
Expand All @@ -46,7 +48,7 @@
<inset key="sectionInset" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="filterCell" id="5db-8s-Igp" customClass="MediaEditorFilterCell" customModule="MediaEditor" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="filterCell" id="5db-8s-Igp" customClass="WPMediaEditorFilterCell">
<rect key="frame" x="10" y="0.0" width="71" height="93"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<collectionViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="kVy-bJ-DQ7">
Expand Down Expand Up @@ -87,10 +89,10 @@
</cells>
</collectionView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="BwS-ar-kTV">
<rect key="frame" x="0.0" y="556" width="600" height="44"/>
<rect key="frame" x="0.0" y="715" width="393" height="44"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IFy-2Y-4OM">
<rect key="frame" x="0.0" y="0.0" width="287" height="44"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IFy-2Y-4OM">
<rect key="frame" x="0.0" y="0.0" width="80" height="44"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="53" id="FTj-uO-CKq"/>
</constraints>
Expand All @@ -105,11 +107,11 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LYk-87-uUE">
<rect key="frame" x="297" y="0.0" width="240" height="44"/>
<rect key="frame" x="90" y="0.0" width="240" height="44"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="egE-uW-K1q">
<rect key="frame" x="547" y="0.0" width="53" height="44"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="egE-uW-K1q">
<rect key="frame" x="340" y="0.0" width="53" height="44"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="53" id="Bay-oh-sXZ"/>
</constraints>
Expand All @@ -129,14 +131,14 @@
</subviews>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="sGv-Ig-jBp"/>
<color key="backgroundColor" white="0.12" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="AlG-Gr-6cY" firstAttribute="top" secondItem="sGv-Ig-jBp" secondAttribute="top" id="LbP-L3-IdF"/>
<constraint firstItem="sGv-Ig-jBp" firstAttribute="bottom" secondItem="AlG-Gr-6cY" secondAttribute="bottom" id="a35-7A-fOc"/>
<constraint firstItem="sGv-Ig-jBp" firstAttribute="trailing" secondItem="AlG-Gr-6cY" secondAttribute="trailing" symbolic="YES" id="kjm-l6-Ik3"/>
<constraint firstItem="AlG-Gr-6cY" firstAttribute="leading" secondItem="sGv-Ig-jBp" secondAttribute="leading" id="n9m-6v-EBP"/>
</constraints>
<viewLayoutGuide key="safeArea" id="sGv-Ig-jBp"/>
</view>
<connections>
<outlet property="cancelButton" destination="IFy-2Y-4OM" id="ga6-Vo-1tv"/>
Expand Down
Loading

0 comments on commit 4f3fe29

Please sign in to comment.