Commit e2c874c1 by Javier Heisekce

Llama a numeros

parent 4c4ec645
<?xml version="1.0" encoding="UTF-8"?> <?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" initialViewController="PED-ba-Jdi"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="PED-ba-Jdi">
<device id="retina4_7" orientation="portrait" appearance="light"/> <device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
...@@ -77,13 +77,6 @@ ...@@ -77,13 +77,6 @@
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eBo-CT-x9g">
<rect key="frame" x="58" y="212" width="30" height="30"/>
<state key="normal" title="Call"/>
<connections>
<action selector="callButton:" destination="i2T-MY-6qf" eventType="touchUpInside" id="nXp-Mk-RCH"/>
</connections>
</button>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="mobile" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KxJ-Qv-kA7"> <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="mobile" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KxJ-Qv-kA7">
<rect key="frame" x="16" y="240" width="44" height="17"/> <rect key="frame" x="16" y="240" width="44" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
...@@ -94,7 +87,7 @@ ...@@ -94,7 +87,7 @@
<rect key="frame" x="16" y="259" width="111" height="30"/> <rect key="frame" x="16" y="259" width="111" height="30"/>
<state key="normal" title="(888) 555-5512"/> <state key="normal" title="(888) 555-5512"/>
<connections> <connections>
<action selector="callButton:" destination="i2T-MY-6qf" eventType="touchUpInside" id="H4b-52-ngQ"/> <action selector="callSpecificNumber:" destination="i2T-MY-6qf" eventType="touchUpInside" id="FHq-SH-TBR"/>
</connections> </connections>
</button> </button>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="mobile" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vQF-Eq-KWL"> <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="mobile" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vQF-Eq-KWL">
...@@ -107,7 +100,7 @@ ...@@ -107,7 +100,7 @@
<rect key="frame" x="18" y="316" width="111" height="30"/> <rect key="frame" x="18" y="316" width="111" height="30"/>
<state key="normal" title="(888) 555-5512"/> <state key="normal" title="(888) 555-5512"/>
<connections> <connections>
<action selector="callButton:" destination="i2T-MY-6qf" eventType="touchUpInside" id="xgn-e5-2aF"/> <action selector="callSpecificNumber:" destination="i2T-MY-6qf" eventType="touchUpInside" id="f9Y-mD-DTh"/>
</connections> </connections>
</button> </button>
</subviews> </subviews>
...@@ -116,15 +109,12 @@ ...@@ -116,15 +109,12 @@
<constraint firstItem="YV1-WY-lTn" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="m4m-IH-dYv" secondAttribute="trailing" symbolic="YES" id="1AC-tb-Lsi"/> <constraint firstItem="YV1-WY-lTn" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="m4m-IH-dYv" secondAttribute="trailing" symbolic="YES" id="1AC-tb-Lsi"/>
<constraint firstItem="SSh-qK-Te0" firstAttribute="leading" secondItem="YV1-WY-lTn" secondAttribute="leading" constant="137" id="5ra-OQ-OXE"/> <constraint firstItem="SSh-qK-Te0" firstAttribute="leading" secondItem="YV1-WY-lTn" secondAttribute="leading" constant="137" id="5ra-OQ-OXE"/>
<constraint firstItem="78U-Dh-WFs" firstAttribute="top" secondItem="vQF-Eq-KWL" secondAttribute="bottom" constant="2" id="7Qu-oy-WiY"/> <constraint firstItem="78U-Dh-WFs" firstAttribute="top" secondItem="vQF-Eq-KWL" secondAttribute="bottom" constant="2" id="7Qu-oy-WiY"/>
<constraint firstItem="KxJ-Qv-kA7" firstAttribute="top" secondItem="eBo-CT-x9g" secondAttribute="bottom" constant="-2" id="AbZ-R1-uip"/>
<constraint firstItem="eBo-CT-x9g" firstAttribute="top" secondItem="1Kw-mC-GdR" secondAttribute="bottom" constant="8" id="AqY-Nn-a6x"/>
<constraint firstItem="vQF-Eq-KWL" firstAttribute="leading" secondItem="YV1-WY-lTn" secondAttribute="leading" constant="18" id="I0k-GE-QJ0"/> <constraint firstItem="vQF-Eq-KWL" firstAttribute="leading" secondItem="YV1-WY-lTn" secondAttribute="leading" constant="18" id="I0k-GE-QJ0"/>
<constraint firstItem="KxJ-Qv-kA7" firstAttribute="top" secondItem="1Kw-mC-GdR" secondAttribute="bottom" constant="36" id="JYe-UB-gvm"/>
<constraint firstItem="YV1-WY-lTn" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="78U-Dh-WFs" secondAttribute="trailing" symbolic="YES" id="KQY-U5-hvm"/> <constraint firstItem="YV1-WY-lTn" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="78U-Dh-WFs" secondAttribute="trailing" symbolic="YES" id="KQY-U5-hvm"/>
<constraint firstItem="1Kw-mC-GdR" firstAttribute="top" secondItem="SSh-qK-Te0" secondAttribute="bottom" constant="8" id="Ktz-1f-c23"/> <constraint firstItem="1Kw-mC-GdR" firstAttribute="top" secondItem="SSh-qK-Te0" secondAttribute="bottom" constant="8" id="Ktz-1f-c23"/>
<constraint firstItem="m4m-IH-dYv" firstAttribute="leading" secondItem="YV1-WY-lTn" secondAttribute="leading" constant="16" id="Ky9-D3-Q8g"/> <constraint firstItem="m4m-IH-dYv" firstAttribute="leading" secondItem="YV1-WY-lTn" secondAttribute="leading" constant="16" id="Ky9-D3-Q8g"/>
<constraint firstItem="vQF-Eq-KWL" firstAttribute="top" secondItem="m4m-IH-dYv" secondAttribute="bottom" constant="8" id="NnL-pe-PyE"/> <constraint firstItem="vQF-Eq-KWL" firstAttribute="top" secondItem="m4m-IH-dYv" secondAttribute="bottom" constant="8" id="NnL-pe-PyE"/>
<constraint firstItem="eBo-CT-x9g" firstAttribute="leading" secondItem="1Kw-mC-GdR" secondAttribute="leading" id="P95-3L-FTz"/>
<constraint firstItem="YV1-WY-lTn" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="eBo-CT-x9g" secondAttribute="trailing" symbolic="YES" id="S0r-tt-H4L"/>
<constraint firstItem="YV1-WY-lTn" firstAttribute="trailing" secondItem="SSh-qK-Te0" secondAttribute="trailing" constant="138" id="SoA-lc-Ayp"/> <constraint firstItem="YV1-WY-lTn" firstAttribute="trailing" secondItem="SSh-qK-Te0" secondAttribute="trailing" constant="138" id="SoA-lc-Ayp"/>
<constraint firstItem="m4m-IH-dYv" firstAttribute="top" secondItem="KxJ-Qv-kA7" secondAttribute="bottom" constant="2" id="cXc-j4-79C"/> <constraint firstItem="m4m-IH-dYv" firstAttribute="top" secondItem="KxJ-Qv-kA7" secondAttribute="bottom" constant="2" id="cXc-j4-79C"/>
<constraint firstItem="78U-Dh-WFs" firstAttribute="leading" secondItem="YV1-WY-lTn" secondAttribute="leading" constant="18" id="cc2-xi-9qt"/> <constraint firstItem="78U-Dh-WFs" firstAttribute="leading" secondItem="YV1-WY-lTn" secondAttribute="leading" constant="18" id="cc2-xi-9qt"/>
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSContactsUsageDescription</key>
<string>Voy a spamear a tus contactos</string>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
...@@ -22,6 +20,8 @@ ...@@ -22,6 +20,8 @@
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSContactsUsageDescription</key>
<string>Voy a spamear a tus contactos</string>
<key>UIApplicationSceneManifest</key> <key>UIApplicationSceneManifest</key>
<dict> <dict>
<key>UIApplicationSupportsMultipleScenes</key> <key>UIApplicationSupportsMultipleScenes</key>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</dict> </dict>
</dict> </dict>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>Main</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main</string> <string>Main</string>
<key>UIRequiredDeviceCapabilities</key> <key>UIRequiredDeviceCapabilities</key>
......
...@@ -21,7 +21,7 @@ class SingleContactViewController: UIViewController { ...@@ -21,7 +21,7 @@ class SingleContactViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
if let contact = selectedContact{ if let contact = selectedContact {
title = "\(contact.givenName) \(contact.familyName)" title = "\(contact.givenName) \(contact.familyName)"
contactFullname.text = "\(contact.givenName) \(contact.familyName)" contactFullname.text = "\(contact.givenName) \(contact.familyName)"
if let phones = contact.phoneNumbers.first { if let phones = contact.phoneNumbers.first {
...@@ -48,6 +48,10 @@ class SingleContactViewController: UIViewController { ...@@ -48,6 +48,10 @@ class SingleContactViewController: UIViewController {
} }
@IBAction func callButton(_ sender: Any) { @IBAction func callButton(_ sender: Any) {
guard let number = URL(string: "tel://" + (selectedContact!.phoneNumbers.first?.value.stringValue)!) else { return }
UIApplication.shared.open(number)
} }
@IBAction func callSpecificNumber(_ sender: Any) {
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment