Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Mission1 1 hamada #25

Open
wants to merge 3 commits 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
19 changes: 13 additions & 6 deletions hamada/iOS-client/My1DayApp/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7531" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="pQh-c6-WXV">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="pQh-c6-WXV">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<scenes>
<!--Root View Controller-->
Expand All @@ -18,18 +18,25 @@
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="6IH-Ch-NUR" id="Ucl-m3-jPt">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rB6-1N-vrf">
<rect key="frame" x="5" y="5" width="60" height="60"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="メッセージ" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RPy-Rd-KYT">
<rect key="frame" x="78" y="13" width="234" height="21"/>
<rect key="frame" x="78" y="16" width="234" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rB6-1N-vrf">
<rect key="frame" x="8" y="5" width="60" height="60"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="date" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mS6-Ae-wTV">
<rect key="frame" x="76" y="40" width="244" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<outlet property="dateLabel" destination="mS6-Ae-wTV" id="vob-0Y-goS"/>
<outlet property="iconImageView" destination="rB6-1N-vrf" id="qKn-zx-yfW"/>
<outlet property="messageLabel" destination="RPy-Rd-KYT" id="6X3-KT-Lfn"/>
</connections>
Expand Down
7 changes: 6 additions & 1 deletion hamada/iOS-client/My1DayApp/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ class Message {
let body: String!
let icon: UIImage?
// Mission1-1. created_at 用のインスタンス変数を追加
let date: String!


init?(dictionary: [String: AnyObject]) {
// Mission1-1 Dictionary から key:created_at の値を取得
if let identifier = dictionary["id"] as? Int, body = dictionary["body"] as? String, icon = dictionary["icon"] as? String{

if let identifier = dictionary["id"] as? Int, body = dictionary["body"] as? String, icon = dictionary["icon"] as? String, date = dictionary["created_at"] as? String{
self.identifier = identifier
self.body = body
self.icon = ImageHelper.imageWithBase64EncodedString(icon)
// Mission1-1 Dictionary から取得した値を created_at 用のインスタンス変数に追加
self.date = date
} else {
self.identifier = nil
self.body = nil
self.icon = nil
// Mission1-1 インスタンス変数を nil で初期化
self.date = nil
return nil
}
}
Expand Down
2 changes: 2 additions & 0 deletions hamada/iOS-client/My1DayApp/MessageTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class MessageTableViewCell: UITableViewCell {
@IBOutlet weak private var iconImageView: UIImageView!
@IBOutlet weak private var messageLabel: UILabel!
// Mission1-1 UILabel のインスタンス変数を追加
@IBOutlet weak var dateLabel: UILabel!

override func prepareForReuse() {
self.iconImageView.image = nil
Expand All @@ -23,5 +24,6 @@ class MessageTableViewCell: UITableViewCell {
self.iconImageView.image = message.icon
self.messageLabel.text = message.body
// Mission1-1 UILabel のインスタンス変数に created_at の値を代入
self.dateLabel.text = message.date
}
}
4 changes: 2 additions & 2 deletions hamada/web-client/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ <h4 class="modal-title" id="myModalLabel">投稿</h4>
<p><textarea class="form-control message-body" rows="3"></textarea></p>
</div>
<div class="modal-footer">
<!-- 画像投稿Form
画像投稿Form
<p class="image-result"><p>
<input type="file" id="image-form">
<button type="button" class="btn btn-primary post-message">投稿する</button>
-->

</div>
</div>
</div>
Expand Down
Empty file modified hamada/web-server/log/api.log
100644 → 100755
Empty file.