Skip to content

Commit 4fe7326

Browse files
committed
add DevX survey to the demo app
1 parent f581143 commit 4fe7326

File tree

4 files changed

+68
-30
lines changed

4 files changed

+68
-30
lines changed

MixpanelDemo/MixpanelDemo/Base.lproj/LaunchScreen.storyboard

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
34
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
58
</dependencies>
69
<scenes>
710
<!--View Controller-->
@@ -13,10 +16,9 @@
1316
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
1417
</layoutGuides>
1518
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
19+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
1720
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18-
<animations/>
19-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
21+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2022
</view>
2123
</viewController>
2224
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>

MixpanelDemo/MixpanelDemo/Base.lproj/Main.storyboard

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="F3T-Id-qfv">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="F3T-Id-qfv">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
77
<capability name="System colors in document resources" minToolsVersion="11.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -26,55 +26,85 @@
2626
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
2727
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2828
<subviews>
29-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Project token" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oGc-Lo-doN">
30-
<rect key="frame" x="16" y="49" width="102" height="21"/>
31-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
29+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Project token(Set in AppDelegate)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oGc-Lo-doN">
30+
<rect key="frame" x="16" y="49" width="260" height="21"/>
3231
<fontDescription key="fontDescription" type="system" pointSize="17"/>
3332
<nil key="textColor"/>
3433
<nil key="highlightedColor"/>
3534
</label>
36-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Distinct ID" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WbS-VF-Mos">
35+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Distinct ID" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WbS-VF-Mos">
3736
<rect key="frame" x="16" y="142" width="79" height="21"/>
38-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
3937
<fontDescription key="fontDescription" type="system" pointSize="17"/>
4038
<nil key="textColor"/>
4139
<nil key="highlightedColor"/>
4240
</label>
43-
<textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="dF8-sW-d6G">
44-
<rect key="frame" x="16" y="78" width="343" height="34"/>
45-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
41+
<textField opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="dF8-sW-d6G">
42+
<rect key="frame" x="15" y="78" width="345" height="34"/>
4643
<fontDescription key="fontDescription" type="system" pointSize="14"/>
4744
<textInputTraits key="textInputTraits"/>
4845
</textField>
49-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="n2n-QQ-M8f">
46+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="n2n-QQ-M8f">
5047
<rect key="frame" x="16" y="229" width="45" height="21"/>
51-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
5248
<fontDescription key="fontDescription" type="system" pointSize="17"/>
5349
<nil key="textColor"/>
5450
<nil key="highlightedColor"/>
5551
</label>
56-
<textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="zYg-qh-UCB">
57-
<rect key="frame" x="16" y="171" width="343" height="34"/>
58-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
52+
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="zYg-qh-UCB">
53+
<rect key="frame" x="15" y="171" width="345" height="34"/>
5954
<fontDescription key="fontDescription" type="system" pointSize="14"/>
6055
<textInputTraits key="textInputTraits"/>
6156
</textField>
62-
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="r1P-Ov-L4W">
63-
<rect key="frame" x="16" y="338" width="343" height="55"/>
64-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
57+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="r1P-Ov-L4W">
58+
<rect key="frame" x="15" y="338" width="345" height="55"/>
59+
<constraints>
60+
<constraint firstAttribute="height" constant="55" id="H93-30-vpf"/>
61+
</constraints>
6562
<state key="normal" title="Start"/>
6663
<connections>
6764
<action selector="start:" destination="F3T-Id-qfv" eventType="touchUpInside" id="rrE-sZ-eIT"/>
6865
</connections>
6966
</button>
70-
<textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="clQ-eQ-0dZ">
71-
<rect key="frame" x="16" y="258" width="343" height="34"/>
72-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
67+
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="clQ-eQ-0dZ">
68+
<rect key="frame" x="15" y="258" width="345" height="34"/>
7369
<fontDescription key="fontDescription" type="system" pointSize="14"/>
7470
<textInputTraits key="textInputTraits"/>
7571
</textField>
72+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SbI-St-Utg">
73+
<rect key="frame" x="17" y="401" width="343" height="55"/>
74+
<constraints>
75+
<constraint firstAttribute="height" constant="55" id="n90-eB-CNH"/>
76+
</constraints>
77+
<state key="normal" title="Rate Mixpanel Developer Experience"/>
78+
<connections>
79+
<action selector="rateDevX:" destination="F3T-Id-qfv" eventType="touchUpInside" id="7iJ-1U-ZKb"/>
80+
</connections>
81+
</button>
7682
</subviews>
7783
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
84+
<constraints>
85+
<constraint firstItem="zYg-qh-UCB" firstAttribute="leading" secondItem="Odw-8A-P1I" secondAttribute="leading" constant="15" id="2Th-9R-MJm"/>
86+
<constraint firstItem="n2n-QQ-M8f" firstAttribute="top" secondItem="zYg-qh-UCB" secondAttribute="bottom" constant="24" id="2Vs-fc-ezJ"/>
87+
<constraint firstItem="dF8-sW-d6G" firstAttribute="top" secondItem="oGc-Lo-doN" secondAttribute="bottom" constant="8" symbolic="YES" id="2jt-e4-rBh"/>
88+
<constraint firstItem="WbS-VF-Mos" firstAttribute="leading" secondItem="Odw-8A-P1I" secondAttribute="leading" constant="16" id="3i8-7U-kyJ"/>
89+
<constraint firstItem="clQ-eQ-0dZ" firstAttribute="leading" secondItem="Odw-8A-P1I" secondAttribute="leading" constant="15" id="439-k7-027"/>
90+
<constraint firstItem="r1P-Ov-L4W" firstAttribute="top" secondItem="J7H-Hs-BHX" secondAttribute="bottom" constant="338" id="4o3-1e-Cwb"/>
91+
<constraint firstItem="oGc-Lo-doN" firstAttribute="leading" secondItem="Odw-8A-P1I" secondAttribute="leading" constant="16" id="9W6-v0-fbr"/>
92+
<constraint firstItem="clQ-eQ-0dZ" firstAttribute="top" secondItem="n2n-QQ-M8f" secondAttribute="bottom" constant="8" symbolic="YES" id="B1f-2R-Io2"/>
93+
<constraint firstItem="oGc-Lo-doN" firstAttribute="top" secondItem="J7H-Hs-BHX" secondAttribute="bottom" constant="49" id="Ei0-V0-PDo"/>
94+
<constraint firstItem="r1P-Ov-L4W" firstAttribute="centerX" secondItem="Odw-8A-P1I" secondAttribute="centerX" id="GNw-9X-Iwz"/>
95+
<constraint firstItem="SbI-St-Utg" firstAttribute="leading" secondItem="Odw-8A-P1I" secondAttribute="leading" constant="17" id="HuI-7i-dQA"/>
96+
<constraint firstAttribute="trailing" secondItem="dF8-sW-d6G" secondAttribute="trailing" constant="15" id="Iqk-sm-nnr"/>
97+
<constraint firstItem="r1P-Ov-L4W" firstAttribute="leading" secondItem="Odw-8A-P1I" secondAttribute="leading" constant="15" id="LKH-hC-OMK"/>
98+
<constraint firstAttribute="trailing" secondItem="clQ-eQ-0dZ" secondAttribute="trailing" constant="15" id="LQc-Xr-Zxu"/>
99+
<constraint firstItem="dF8-sW-d6G" firstAttribute="leading" secondItem="Odw-8A-P1I" secondAttribute="leading" constant="15" id="UTD-K9-jJ8"/>
100+
<constraint firstItem="zYg-qh-UCB" firstAttribute="top" secondItem="WbS-VF-Mos" secondAttribute="bottom" constant="8" symbolic="YES" id="VbU-IS-RTT"/>
101+
<constraint firstItem="r1P-Ov-L4W" firstAttribute="top" secondItem="clQ-eQ-0dZ" secondAttribute="bottom" constant="46" id="Z22-ea-ODF"/>
102+
<constraint firstItem="n2n-QQ-M8f" firstAttribute="leading" secondItem="Odw-8A-P1I" secondAttribute="leading" constant="16" id="ZvV-Zb-I80"/>
103+
<constraint firstItem="SbI-St-Utg" firstAttribute="top" secondItem="r1P-Ov-L4W" secondAttribute="bottom" constant="8" symbolic="YES" id="fsu-eI-fMf"/>
104+
<constraint firstAttribute="trailing" secondItem="r1P-Ov-L4W" secondAttribute="trailing" constant="15" id="oab-hM-8FG"/>
105+
<constraint firstAttribute="trailing" secondItem="SbI-St-Utg" secondAttribute="trailing" constant="15" id="y8i-fw-sGP"/>
106+
<constraint firstAttribute="trailing" secondItem="zYg-qh-UCB" secondAttribute="trailing" constant="15" id="z8q-Fa-8ku"/>
107+
</constraints>
78108
</view>
79109
<connections>
80110
<outlet property="distinctIdTextField" destination="zYg-qh-UCB" id="sem-xA-N0A"/>

MixpanelDemo/MixpanelDemo/LoginViewController.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,10 @@ class LoginViewController: UIViewController {
3939

4040
goToMainView()
4141
}
42+
43+
@IBAction func rateDevX(_ sender: Any) {
44+
if let url = URL(string: "https://www.mixpanel.com/devnps") {
45+
UIApplication.shared.open(url)
46+
}
47+
}
4248
}

Sources/Mixpanel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ open class Mixpanel {
166166
let waveHand = UnicodeScalar(0x1f44b) ?? "*"
167167
let thumbsUp = UnicodeScalar(0x1f44d) ?? "*"
168168
let thumbsDown = UnicodeScalar(0x1f44e) ?? "*"
169-
print(Array(repeating: "\(waveHand)", count: 5).joined(separator: ""))
169+
print(Array(repeating: "\(waveHand)", count: 10).joined(separator: ""))
170170
print("""
171-
Hi, Zihe & Jared here, please tell us about the Mixpanel developer experience!
171+
Hi, Zihe & Jared here, please give feedback or tell us about the Mixpanel developer experience!
172172
open -> https://www.mixpanel.com/devnps \(thumbsUp)\(thumbsDown)
173173
""")
174-
print(Array(repeating: "\(waveHand)", count: 5).joined(separator: ""))
174+
print(Array(repeating: "\(waveHand)", count: 10).joined(separator: ""))
175175
surveyShownCount += 1
176176
UserDefaults.standard.set(surveyShownCount, forKey: surveyShownCountKey)
177177
var debugProperties: Properties = properties

0 commit comments

Comments
 (0)