Skip to content

Commit

Permalink
#111 Timer screen is now popped from the nav. stack before pushing Po…
Browse files Browse the repository at this point in the history
…st design studio
  • Loading branch information
kperusko committed Feb 8, 2016
1 parent beb1637 commit a1be152
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 47 deletions.
46 changes: 13 additions & 33 deletions DesignStudioExpress/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@
<exclude reference="UuL-HU-r7C"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="131" y="0.0" width="140" height="18"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="UuL-HU-r7C"/>
</mask>
Expand Down Expand Up @@ -1085,9 +1084,6 @@ Sketching Templates</string>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="DS_Home_BG_image" translatesAutoresizingMaskIntoConstraints="NO" id="V2g-i0-bgJ">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="0.0" y="0.0" width="240" height="359"/>
</variation>
</imageView>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9A3-rP-t9M">
<rect key="frame" x="38" y="64" width="309" height="181"/>
Expand All @@ -1110,8 +1106,7 @@ Sketching Templates</string>
<exclude reference="OW9-1Z-xff"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="10" y="8" width="220" height="18"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="OW9-1Z-xff"/>
</mask>
Expand All @@ -1131,8 +1126,7 @@ Sketching Templates</string>
<exclude reference="YRJ-GS-qPG"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="0.0" y="120" width="240" height="120"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="tVh-d2-0s1"/>
<include reference="2tG-2K-jRN"/>
Expand All @@ -1153,8 +1147,7 @@ Sketching Templates</string>
<exclude reference="2U6-T9-iB6"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="-15" y="154" width="270" height="61"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="2U6-T9-iB6"/>
</mask>
Expand Down Expand Up @@ -2206,12 +2199,12 @@ Sketching Templates</string>
<exclude reference="5bm-S9-BNa"/>
<exclude reference="g3p-Za-2eu"/>
<exclude reference="ssH-jf-Pcn"/>
<exclude reference="dYb-Ss-973"/>
<exclude reference="DuM-wl-RtL"/>
<exclude reference="N10-bD-TaV"/>
<exclude reference="YV4-KG-kCJ"/>
<exclude reference="5H9-Jz-KNG"/>
<exclude reference="olu-cY-TST"/>
<exclude reference="dYb-Ss-973"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
Expand All @@ -2223,12 +2216,12 @@ Sketching Templates</string>
<include reference="5bm-S9-BNa"/>
<include reference="g3p-Za-2eu"/>
<include reference="ssH-jf-Pcn"/>
<include reference="dYb-Ss-973"/>
<include reference="DuM-wl-RtL"/>
<include reference="N10-bD-TaV"/>
<include reference="YV4-KG-kCJ"/>
<include reference="5H9-Jz-KNG"/>
<include reference="olu-cY-TST"/>
<include reference="dYb-Ss-973"/>
</mask>
</variation>
</view>
Expand Down Expand Up @@ -3538,8 +3531,7 @@ Sketching Templates</string>
<exclude reference="kFy-YO-Ana"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="55" y="44" width="130" height="29"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="subviews">
<include reference="hbr-94-lLC"/>
<include reference="rK7-HV-JTV"/>
Expand Down Expand Up @@ -3576,8 +3568,7 @@ Sketching Templates</string>
<exclude reference="bTH-hm-Ddj"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="23" y="119" width="194" height="120"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="bTH-hm-Ddj"/>
</mask>
Expand All @@ -3604,8 +3595,7 @@ Sketching Templates</string>
<exclude reference="MS1-q4-xo0"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="-60" y="75" width="360" height="40"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="1no-mU-II7"/>
<include reference="MS1-q4-xo0"/>
Expand All @@ -3625,8 +3615,7 @@ Sketching Templates</string>
<exclude reference="LAw-Kj-pd3"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="170" y="44" width="50" height="50"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="Kfi-xx-WJS"/>
<include reference="LAw-Kj-pd3"/>
Expand All @@ -3648,8 +3637,7 @@ Sketching Templates</string>
<exclude reference="Ytk-aQ-fYc"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="191" y="89" width="9" height="11"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="GU2-eD-3XH"/>
<include reference="Ytk-aQ-fYc"/>
Expand Down Expand Up @@ -4682,9 +4670,6 @@ Sketching Templates</string>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Settings_Image" translatesAutoresizingMaskIntoConstraints="NO" id="S9R-OE-sve">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="-8" y="-10" width="256" height="370"/>
</variation>
</imageView>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1vj-cu-Yk3">
<rect key="frame" x="5" y="97" width="390" height="183"/>
Expand All @@ -4707,8 +4692,7 @@ Sketching Templates</string>
<exclude reference="KDN-C7-8t5"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="70" y="0.0" width="100" height="18"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="KDN-C7-8t5"/>
</mask>
Expand All @@ -4724,9 +4708,6 @@ Sketching Templates</string>
<real key="value" value="0.27000000000000002"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="25" y="26" width="190" height="121"/>
</variation>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
Expand All @@ -4750,8 +4731,7 @@ Sketching Templates</string>
<exclude reference="zLs-33-OAG"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="0.0" y="120" width="240" height="120"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="Tci-bF-yKd"/>
<include reference="II6-at-pQW"/>
Expand Down
14 changes: 0 additions & 14 deletions DesignStudioExpress/Views/PostDesignStudioViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class PostDesignStudioViewController: UIViewControllerBase, UICollectionViewDele
override func viewDidLoad() {
super.viewDidLoad()

self.removeLastViewFromNavigation()

self.collectionView.registerClass(MHMediaPreviewCollectionViewCell.self, forCellWithReuseIdentifier: self.cellIdentifier)
}

Expand All @@ -36,18 +34,6 @@ class PostDesignStudioViewController: UIViewControllerBase, UICollectionViewDele
}
}

// to make back button always lead to the challenges screen
// remove all Timers and End screens from the nav stack
private func removeLastViewFromNavigation() {
let endIndex = (self.navigationController?.viewControllers.endIndex ?? 0) - 1
if endIndex > 0 {
let previousVC = self.navigationController?.viewControllers[endIndex-1]
if previousVC is TimerViewController || previousVC is EndActivityViewController {
self.navigationController?.viewControllers.removeAtIndex(endIndex-1)
}
}
}

private func prepareViewState() {
// set the title in the navbar
self.navigationItem.title = vm.designStudioTitle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ class UITabBarControllerBase: UITabBarController {
// add post view studio in the view hierarchy, so when the End design studio disappears
// we will see the post studio screen
if let postStudio = self.createPostDesignStudioViewController(notification) {
// remove the Timer screen from the stack first
self.dsNavController.popViewControllerAnimated(false)
self.dsNavController.viewControllers.append(postStudio)
}
}
Expand Down

0 comments on commit a1be152

Please sign in to comment.