Skip to content

Commit 8c7ce06

Browse files
Update UI: add popup button to select the payload type
1 parent 9e62203 commit 8c7ce06

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

Knuff/APNSViewController.m

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ @interface APNSViewController () <MGSFragariaTextViewDelegate, MGSDragOperationD
5858
@property (weak) IBOutlet NSSegmentedControl *prioritySegmentedControl; // Only 5 and 10
5959

6060
@property (weak) IBOutlet NSPopUpButton *topicsPopUpButton;
61+
@property (weak) IBOutlet NSPopUpButton *payloadTypePopUpButton;
6162

6263
@property (nonatomic) BOOL showSandbox; // current state of the UI
6364
@property (weak) IBOutlet NSSegmentedControl *sandboxSegmentedControl;
@@ -95,6 +96,9 @@ - (void)viewDidLoad {
9596

9697
[self.topicsPopUpButton removeAllItems];
9798
self.topicsPopUpButton.enabled = NO;
99+
100+
[self.payloadTypePopUpButton removeAllItems];
101+
[self.payloadTypePopUpButton addItemsWithTitles:APNSItemPushTypesAll()];
98102

99103
[[MGSUserDefaultsController sharedController] addFragariaToManagedSet:self.fragariaView];
100104
}

Knuff/Base.lproj/Main.storyboard

+29-4
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,10 @@
742742
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
743743
<subviews>
744744
<box autoresizesSubviews="NO" fixedFrame="YES" boxType="custom" borderType="line" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="mrI-Z0-do9">
745-
<rect key="frame" x="64" y="39" width="374" height="197"/>
745+
<rect key="frame" x="64" y="39" width="374" height="163"/>
746746
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
747747
<view key="contentView" id="Lwi-gz-XGt" customClass="MGSFragariaView">
748-
<rect key="frame" x="1" y="1" width="372" height="195"/>
748+
<rect key="frame" x="1" y="1" width="372" height="161"/>
749749
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
750750
</view>
751751
<color key="borderColor" white="0.0" alpha="0.20000000000000001" colorSpace="calibratedWhite"/>
@@ -827,7 +827,7 @@
827827
</textFieldCell>
828828
</textField>
829829
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ji4-oK-Cm1">
830-
<rect key="frame" x="214" y="255" width="218" height="22"/>
830+
<rect key="frame" x="214" y="256" width="218" height="22"/>
831831
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
832832
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="7SA-gf-qsz">
833833
<font key="font" metaFont="system"/>
@@ -839,7 +839,7 @@
839839
</connections>
840840
</textField>
841841
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UNw-8x-tcA">
842-
<rect key="frame" x="-2" y="219" width="58" height="17"/>
842+
<rect key="frame" x="-1" y="185" width="58" height="17"/>
843843
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
844844
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Payload:" id="0qN-Z1-PD3">
845845
<font key="font" metaFont="system"/>
@@ -870,6 +870,30 @@
870870
<action selector="changePriority:" target="5gI-5U-AMq" id="mpf-bT-TSe"/>
871871
</connections>
872872
</segmentedControl>
873+
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fvt-6a-dsp" userLabel="Type: PopUp Button">
874+
<rect key="frame" x="212" y="224" width="223" height="26"/>
875+
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
876+
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" selectedItem="pm2-Fi-Ud5" id="ceZ-zF-4mv">
877+
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
878+
<font key="font" metaFont="system"/>
879+
<menu key="menu" id="aEp-HZ-hxw">
880+
<items>
881+
<menuItem title="Item 1" state="on" id="pm2-Fi-Ud5"/>
882+
<menuItem title="Item 2" id="HIC-dN-pRy"/>
883+
<menuItem title="Item 3" id="DPQ-Mi-4g5"/>
884+
</items>
885+
</menu>
886+
</popUpButtonCell>
887+
</popUpButton>
888+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="q8Y-Bi-MDi">
889+
<rect key="frame" x="117" y="229" width="89" height="17"/>
890+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
891+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Payload Type:" id="XCt-oa-qFs">
892+
<font key="font" metaFont="system"/>
893+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
894+
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
895+
</textFieldCell>
896+
</textField>
873897
</subviews>
874898
</customView>
875899
<segmentedControl verticalHuggingPriority="750" fixedFrame="YES" springLoaded="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oPK-43-5bT">
@@ -895,6 +919,7 @@
895919
<outlet property="identityView" destination="qIH-Kw-NVg" id="rFM-Gk-hIi"/>
896920
<outlet property="identityWrapperView" destination="mLb-IA-Hew" id="zAz-9r-tz0"/>
897921
<outlet property="modeSegmentedControl" destination="oPK-43-5bT" id="LTZ-dm-km3"/>
922+
<outlet property="payloadTypePopUpButton" destination="fvt-6a-dsp" id="fwH-aL-LnS"/>
898923
<outlet property="payloadView" destination="Xr8-yk-ahB" id="XrG-c3-yMs"/>
899924
<outlet property="prioritySegmentedControl" destination="8NS-MQ-LIZ" id="cPu-YG-995"/>
900925
<outlet property="sandboxSegmentedControl" destination="QQg-T8-GTZ" id="1Mj-Oo-Fid"/>

0 commit comments

Comments
 (0)