Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Commit 51d3aef

Browse files
author
Ignacio Romero Zurbuchen
committed
Updates sample project to open a new view from the left button for testing purposes
1 parent 1b29e23 commit 51d3aef

3 files changed

Lines changed: 46 additions & 5 deletions

File tree

Examples/Messenger-Shared/MessageViewController.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ - (BOOL)forceTextInputbarAdjustmentForResponder:(UIResponder *)responder
376376
- (void)didChangeKeyboardStatus:(SLKKeyboardStatus)status
377377
{
378378
// Notifies the view controller that the keyboard changed status.
379+
380+
NSLog(@"didChangeKeyboardStatus : %ld", status);
379381
}
380382

381383
- (void)textWillUpdate
@@ -397,6 +399,12 @@ - (void)didPressLeftButton:(id)sender
397399
// Notifies the view controller when the left button's action has been triggered, manually.
398400

399401
[super didPressLeftButton:sender];
402+
403+
UIViewController *vc = [UIViewController new];
404+
vc.view.backgroundColor = [UIColor whiteColor];
405+
vc.title = @"Details";
406+
407+
[self.navigationController pushViewController:vc animated:YES];
400408
}
401409

402410
- (void)didPressRightButton:(id)sender

Examples/Messenger-Swift/Base.lproj/Main.storyboard

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="jPN-Ft-lgW">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="jPN-Ft-lgW">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
66
</dependencies>
77
<scenes>
8-
<!--Message View Controller-->
8+
<!--Message Thread-->
99
<scene sceneID="tne-QT-ifu">
1010
<objects>
11-
<viewController id="BYZ-38-t0r" customClass="MessageViewController" customModule="Messenger_Swift" customModuleProvider="target" sceneMemberID="viewController">
11+
<viewController title="Message Thread" id="BYZ-38-t0r" customClass="MessageViewController" customModule="Messenger_Swift" customModuleProvider="target" sceneMemberID="viewController">
1212
<layoutGuides>
1313
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
1414
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@@ -19,11 +19,32 @@
1919
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
2020
</view>
2121
<navigationItem key="navigationItem" id="Kuo-HA-7nc"/>
22+
<connections>
23+
<segue destination="kwe-Wv-66Y" kind="show" identifier="Push" id="rAO-Fs-P9l"/>
24+
</connections>
2225
</viewController>
2326
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
2427
</objects>
2528
<point key="canvasLocation" x="1213" y="478"/>
2629
</scene>
30+
<!--Message Detail-->
31+
<scene sceneID="EBE-UJ-9Eg">
32+
<objects>
33+
<viewController title="Message Detail" id="kwe-Wv-66Y" sceneMemberID="viewController">
34+
<layoutGuides>
35+
<viewControllerLayoutGuide type="top" id="08R-wf-6EQ"/>
36+
<viewControllerLayoutGuide type="bottom" id="9ks-NF-Vcp"/>
37+
</layoutGuides>
38+
<view key="view" contentMode="scaleToFill" id="KMe-76-E1y">
39+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
40+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
41+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
42+
</view>
43+
</viewController>
44+
<placeholder placeholderIdentifier="IBFirstResponder" id="Qla-sV-EqK" userLabel="First Responder" sceneMemberID="firstResponder"/>
45+
</objects>
46+
<point key="canvasLocation" x="1977" y="478"/>
47+
</scene>
2748
<!--Navigation Controller-->
2849
<scene sceneID="Tsc-df-QmC">
2950
<objects>

Examples/Messenger-Swift/MessageViewController.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,16 @@ extension MessageViewController {
354354

355355
// Notifies the view controller that the keyboard changed status.
356356
override func didChangeKeyboardStatus(status: SLKKeyboardStatus) {
357-
// So something
357+
switch status {
358+
case .WillShow:
359+
print("Will Show")
360+
case .DidShow:
361+
print("Did Show")
362+
case .WillHide:
363+
print("Will Hide")
364+
case .DidHide:
365+
print("Did Hide")
366+
}
358367
}
359368

360369
// Notifies the view controller that the text will update.
@@ -370,6 +379,9 @@ extension MessageViewController {
370379
// Notifies the view controller when the left button's action has been triggered, manually.
371380
override func didPressLeftButton(sender: AnyObject!) {
372381
super.didPressLeftButton(sender)
382+
383+
self.dismissKeyboard(true)
384+
self.performSegueWithIdentifier("Push", sender: nil)
373385
}
374386

375387
// Notifies the view controller when the right button's action has been triggered, manually or by using the keyboard return key.

0 commit comments

Comments
 (0)