Skip to content

Commit

Permalink
Merge branch 'master' into feature/swift-2.0
Browse files Browse the repository at this point in the history
Conflicts:
	Swift-SMART
  • Loading branch information
p2 committed Jul 28, 2015
2 parents 694caa0 + b8ba02f commit c8b96f0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
**.mode?v?
**.perspectivev?
**.xccheckout
**.xcscmblueprint
xcuserdata

8 changes: 4 additions & 4 deletions SoF-MedList/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14D113c" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14F6a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
Expand Down Expand Up @@ -31,8 +31,8 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="0XM-y9-sOw">
<rect key="frame" x="20" y="326" width="335" height="17"/>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="0XM-y9-sOw">
<rect key="frame" x="20" y="325" width="335" height="17"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" size="system"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
Expand Down
38 changes: 21 additions & 17 deletions SoF-MedList/MasterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,33 @@ class MasterViewController: UITableViewController
self.patient = patient

if nil != error {
if NSURLErrorDomain != error!.domain || NSURLErrorCancelled != error!.code {
UIAlertView(title: "Patient Selection Failed", message: error!.localizedDescription, delegate: self, cancelButtonTitle: "OK").show()
dispatch_async(dispatch_get_main_queue()) {
if NSURLErrorDomain != error!.domain || NSURLErrorCancelled != error!.code {
UIAlertView(title: "Patient Selection Failed", message: error!.localizedDescription, delegate: self, cancelButtonTitle: "OK").show()
}
self.connectButtonTitle = nil
}
self.connectButtonTitle = nil
}
else if let pat = patient {

// fetch patient's medications
app.findMeds(pat) { meds, error in
if nil != error {
UIAlertView(title: "Error Fetching Meds", message: error!.localizedDescription, delegate: nil, cancelButtonTitle: "OK").show()
}
else {
self.medications = meds ?? []
self.tableView.reloadData()
}

// finally, change the "connect" button
if pat.name?.count > 0 && pat.name![0].given?.count > 0 {
self.connectButtonTitle = pat.name![0].given![0]
}
else {
self.connectButtonTitle = "Unnamed"
dispatch_async(dispatch_get_main_queue()) {
if nil != error {
UIAlertView(title: "Error Fetching Meds", message: error!.localizedDescription, delegate: nil, cancelButtonTitle: "OK").show()
}
else {
self.medications = meds ?? []
self.tableView.reloadData()
}

// finally, change the "connect" button
if pat.name?.count > 0 && pat.name![0].given?.count > 0 {
self.connectButtonTitle = pat.name![0].given![0]
}
else {
self.connectButtonTitle = "Unnamed"
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Swift-SMART

0 comments on commit c8b96f0

Please sign in to comment.