From c368610858e2d043d800f37201b69f0d8f913851 Mon Sep 17 00:00:00 2001 From: Moritz Walter <moritz.w@fu-berlin.de> Date: Sun, 20 Aug 2017 15:36:25 +0200 Subject: [PATCH] small Gamification changes --- enzevalos_iphone/Gamification.storyboard | 3 ++- .../GamificationStatusViewController.swift | 9 +++++++++ .../InviteFriendViewController.swift | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/enzevalos_iphone/Gamification.storyboard b/enzevalos_iphone/Gamification.storyboard index 29e295eb..ff26874d 100755 --- a/enzevalos_iphone/Gamification.storyboard +++ b/enzevalos_iphone/Gamification.storyboard @@ -206,7 +206,7 @@ <color key="trackTintColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> </progressView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="xx %" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GoG-8X-ar5"> - <rect key="frame" x="333.5" y="70.5" width="25.5" height="16"/> + <rect key="frame" x="333.5" y="72" width="25.5" height="14.5"/> <fontDescription key="fontDescription" type="system" pointSize="12"/> <nil key="textColor"/> <nil key="highlightedColor"/> @@ -542,6 +542,7 @@ </constraints> <state key="normal" title="Invite Friend"/> <connections> + <action selector="invitePressed:" destination="Wkg-91-waa" eventType="touchUpInside" id="lR2-IE-UOy"/> <segue destination="13h-dZ-sew" kind="show" identifier="send" id="RKN-iB-gAm"/> </connections> </button> diff --git a/enzevalos_iphone/GamificationStatusViewController.swift b/enzevalos_iphone/GamificationStatusViewController.swift index 0838d1e3..743d5acd 100755 --- a/enzevalos_iphone/GamificationStatusViewController.swift +++ b/enzevalos_iphone/GamificationStatusViewController.swift @@ -166,6 +166,15 @@ class GamificationStatusViewController: UIViewController, UITableViewDelegate, U func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: false) + if indexPath.row > 0 { + // hier die weiterleitung zu den accounteinstellungen einfügen + let alert = UIAlertController(title: NSLocalizedString("Information", comment: "Information title in Alert view") , message: NSLocalizedString("Function currently not implemented", comment: "information message in alert view gamification status view"), preferredStyle: .alert) + let ok = UIAlertAction(title: NSLocalizedString("Ok", comment: "Ok button"), style: .default , handler: nil) + alert.addAction(ok) + self.present(alert, animated: true, completion: nil) + + + } } diff --git a/enzevalos_iphone/InviteFriendViewController.swift b/enzevalos_iphone/InviteFriendViewController.swift index bec768a1..a7ee72ba 100755 --- a/enzevalos_iphone/InviteFriendViewController.swift +++ b/enzevalos_iphone/InviteFriendViewController.swift @@ -196,6 +196,22 @@ class InviteFriendViewController: UIViewController, UITableViewDataSource, UITab } } + + @IBAction func invitePressed(_ sender: Any) { + + if self.selectedContact != nil { + self.performSegue(withIdentifier: "send", sender: self) + } else { + let alert = UIAlertController(title: NSLocalizedString("Information", comment: "Information title in Alert view") , message: NSLocalizedString("Please select contact", comment: "information message in alert view"), preferredStyle: .alert) + let ok = UIAlertAction(title: NSLocalizedString("Ok", comment: "Ok button"), style: .default , handler: nil) + alert.addAction(ok) + self.present(alert, animated: true, completion: nil) + } + + } + + + // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation -- GitLab