Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added languages menu action sheet picker; #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
PODFILE CHECKSUM: f55c7945c6cafdd0e4674ed3859d2883ff4754f5
PODS:
- ActionSheetPicker-3.0 (2.2.0)
- TPKeyboardAvoiding (1.3.1)

DEPENDENCIES:
- ActionSheetPicker-3.0
- TPKeyboardAvoiding

SPEC CHECKSUMS:
ActionSheetPicker-3.0: d11a4c12c6aaf704b8a3f56d179198c99f3e41e6
TPKeyboardAvoiding: 0d6af20e95e2850f4c621841225b59ec7d8dd852

PODFILE CHECKSUM: c087a623377874169a807524361739c9144e47a3

COCOAPODS: 1.3.1
14 changes: 13 additions & 1 deletion Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

664 changes: 558 additions & 106 deletions Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions reSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,12 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-reSwift/Pods-reSwift-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/ActionSheetPicker-3.0/ActionSheetPicker_3_0.framework",
"${BUILT_PRODUCTS_DIR}/TPKeyboardAvoiding/TPKeyboardAvoiding.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ActionSheetPicker_3_0.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TPKeyboardAvoiding.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
27 changes: 26 additions & 1 deletion reSwift/Controllers/TrendingListVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,32 @@
//

import UIKit
import ActionSheetPicker_3_0

class TrendingListVC: UIViewController {

@IBOutlet weak var languagesBtn: UIButton!
@IBOutlet weak var segmentFilter: UISegmentedControl!
@IBOutlet weak var trendingTV: UITableView!
@IBOutlet weak var languagesLabel: UILabel!

let languages: [String] = [
"All Languages",
"JavaScript",
"Java",
"C++",
"Python",
"PHP",
"C",
"C#",
"Ruby",
"Go",
"HTML",
"Swift",
"Objective-C",
"Scala",
"perl"
]

override func viewDidLoad() {
super.viewDidLoad()
Expand Down Expand Up @@ -43,7 +63,12 @@ class TrendingListVC: UIViewController {
}

@IBAction func languageBtnAction(sender: UIButton) {
print("Language button pressed")
ActionSheetMultipleStringPicker.show(withTitle: "Multiple String Picker", rows: [languages], initialSelection: [2], doneBlock: {
picker, indexes, values in
let index: Int = indexes!.first as! Int
self.languagesLabel.text = self.languages[index]
return
}, cancel: { ActionMultipleStringCancelBlock in return }, origin: sender)
}
}

Expand Down
10 changes: 7 additions & 3 deletions reSwift/Storyboards/TrendingList.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,24 @@
<rect key="frame" x="0.0" y="25" width="375" height="25"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="All Languages" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a9I-WX-6zO">
<rect key="frame" x="131" y="2.5" width="113.5" height="21"/>
<rect key="frame" x="124" y="4.5" width="127" height="16.5"/>
<fontDescription key="fontDescription" name="GothamPro" family="Gotham Pro" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="disclosure" translatesAutoresizingMaskIntoConstraints="NO" id="USX-zc-sqK">
<rect key="frame" x="246" y="11" width="11" height="6"/>
<rect key="frame" x="252.5" y="11" width="11" height="6"/>
<constraints>
<constraint firstAttribute="width" constant="11" id="8CD-OA-w5r"/>
<constraint firstAttribute="height" constant="6" id="Yih-tJ-xiU"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vpy-Hq-BdM">
<rect key="frame" x="70" y="-4.5" width="235" height="33"/>
<rect key="frame" x="70" y="-2.5" width="235" height="29"/>
<fontDescription key="fontDescription" name="GothamPro" family="Gotham Pro" pointSize="18"/>
<connections>
<action selector="languageBtnActionWithSender:" destination="veL-6d-Ybu" eventType="touchUpInside" id="gfO-Ct-BS0"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand Down Expand Up @@ -117,6 +120,7 @@
<nil key="simulatedTopBarMetrics"/>
<connections>
<outlet property="languagesBtn" destination="vpy-Hq-BdM" id="l1R-ny-wL7"/>
<outlet property="languagesLabel" destination="a9I-WX-6zO" id="RQb-mc-e3D"/>
<outlet property="segmentFilter" destination="juK-aL-Kqs" id="agn-Bq-HTs"/>
<outlet property="trendingTV" destination="iSx-pJ-Nb6" id="hWP-IZ-HWc"/>
</connections>
Expand Down