This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Side menu added to search page.
- Loading branch information
Showing
11 changed files
with
320 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+17.2 KB
(130%)
SteemitApp.xcworkspace/xcuserdata/mobvenburak.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
23 changes: 23 additions & 0 deletions
23
SteemitApp/Assets.xcassets/menuImage.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "menuImage.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "menuImage-1.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "menuImage-2.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// CategoryTableViewCell.swift | ||
// SteemitApp | ||
// | ||
// Created by Burak Tayfun on 2/18/18. | ||
// Copyright © 2018 Burak Tayfun. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class CategoryTableViewCell: UITableViewCell { | ||
|
||
@IBOutlet weak var headerLabel: UILabel! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
<device id="retina4_7" orientation="portrait"> | ||
<adaptation id="fullscreen"/> | ||
</device> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | ||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<customFonts key="customFonts"> | ||
<array key="Kefa.ttf"> | ||
<string>Kefa-Regular</string> | ||
</array> | ||
</customFonts> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="CategoryTableViewCell" id="KGk-i7-Jjw" customClass="CategoryTableViewCell" customModule="SteemitApp" customModuleProvider="target"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mb2-FJ-nUB"> | ||
<rect key="frame" x="16" y="0.0" width="288" height="43"/> | ||
<fontDescription key="fontDescription" name="Kefa-Regular" family="Kefa" pointSize="17"/> | ||
<color key="textColor" red="0.1450980392" green="0.83529411760000005" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DeP-wh-wez"> | ||
<rect key="frame" x="0.0" y="43" width="320" height="1"/> | ||
<color key="backgroundColor" red="0.19215686269999999" green="0.19215686269999999" blue="0.19215686269999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
<constraints> | ||
<constraint firstAttribute="height" constant="1" id="1M5-Kz-Dbv"/> | ||
</constraints> | ||
</view> | ||
</subviews> | ||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<constraints> | ||
<constraint firstItem="mb2-FJ-nUB" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="2OU-63-coh"/> | ||
<constraint firstItem="mb2-FJ-nUB" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" id="66d-BA-L3U"/> | ||
<constraint firstAttribute="trailing" secondItem="mb2-FJ-nUB" secondAttribute="trailing" constant="16" id="Csd-VQ-VUX"/> | ||
<constraint firstItem="DeP-wh-wez" firstAttribute="top" secondItem="mb2-FJ-nUB" secondAttribute="bottom" id="MBT-7a-OKL"/> | ||
<constraint firstAttribute="bottom" secondItem="DeP-wh-wez" secondAttribute="bottom" id="VAI-4A-kMj"/> | ||
<constraint firstAttribute="trailing" secondItem="DeP-wh-wez" secondAttribute="trailing" id="arf-Nj-XHI"/> | ||
<constraint firstItem="DeP-wh-wez" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="gBG-RM-0rR"/> | ||
</constraints> | ||
</tableViewCellContentView> | ||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> | ||
<connections> | ||
<outlet property="headerLabel" destination="mb2-FJ-nUB" id="xK3-j5-cz9"/> | ||
</connections> | ||
</tableViewCell> | ||
</objects> | ||
</document> |
50 changes: 50 additions & 0 deletions
50
SteemitApp/Custom View Controllers/SideMenuViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// SideMenuViewController.swift | ||
// SteemitApp | ||
// | ||
// Created by Burak Tayfun on 2/18/18. | ||
// Copyright © 2018 Burak Tayfun. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
protocol SideMenuViewControllerDelegate: class { | ||
func changePage(_ category: String) | ||
} | ||
|
||
class SideMenuViewController: UIViewController { | ||
|
||
@IBOutlet weak var categoriesTableView: UITableView! | ||
|
||
var categoryList = [String]() | ||
let categoryTableViewCellIdentifier = "CategoryTableViewCell" | ||
weak var delegate: SideMenuViewControllerDelegate? | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
categoriesTableView.register(UINib.init(nibName: categoryTableViewCellIdentifier, bundle: nil), forCellReuseIdentifier: categoryTableViewCellIdentifier) | ||
} | ||
} | ||
|
||
extension SideMenuViewController: UITableViewDataSource { | ||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
return categoryList.count | ||
} | ||
|
||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
let cell = tableView.dequeueReusableCell(withIdentifier: categoryTableViewCellIdentifier, for: indexPath) as! CategoryTableViewCell | ||
cell.headerLabel.text = categoryList[indexPath.row] | ||
|
||
return cell | ||
} | ||
} | ||
|
||
extension SideMenuViewController: UITableViewDelegate { | ||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
delegate?.changePage(categoryList[indexPath.row]) | ||
} | ||
|
||
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
return 60 | ||
} | ||
} |
Oops, something went wrong.