キリンメモ(サブ)

BUMP OF CHICKEN 星野源が大好き大学生

iosを始めて5週目のまとめ

 ios (Xcode 7.2を使用してます)で習ったことをまとめてみました。

 プログラミングっぽく//(コメントアウト)で小タイトルつけてみた。

/*Agenda------------------------------------------------------------------------------ */

//webViewとは

//UserDefaultとは

//ジェスチャーレコグナイザーとは

//APIとは

//JSONとは

//セグエ(Modal)とは

//ナビゲーションコントローラー(Push)とは

//タブバーコントローラー

//AppDelegate.swift

//Table view

//delegate と dataSource の違い

//modal とpushの違い

-------------------------------------------------------------------------------------------

//webViewとは

f:id:geta206:20160208231608p:plain

X codeでいうとこんな感じ。

webサイトが表示されますよということ。

コードの例----------------------------------------------------------

@IBOutlet weak var myWebView: UIWebView!

    override func viewDidLoad() {

        super.viewDidLoad()

 

            var myURL = NSURL(string: "http://www.apple.com")

                //urlになり得る特別な文字

            var myURLReg = NSURLRequest(URL:myURL!)

        //!もしかしたらURLnullがあると

                myWebView.loadRequest(myURLReg)

------------------------------------------------------------------------------------

   

//UserDefaultとは

 

f:id:geta206:20160208232950p:plain

Textの中のデータを保持する。(データとは[aaaa]のこと)

少しコードの補足。

//即反映させる

コードを書くのは機械の気分次第で反映されるからだ。

------------------------------------------------------------------------------------

//ジェスチャーレコグナイザーとは

英語にすると

GestureRecognizer

f:id:geta206:20160208234534p:plain

 要は  画像ピンクの範囲で上にフリックしたら「↑↑↑↑」と表示される。

 

--------------------------------------------------------------------------------------

//APIとは    Application Programming Interface

 

 APIとは、あるコンピュータプログラムソフトウェア)の機能や管理するデータなどを、外部の他のプログラムから呼び出して利用するための手順やデータ形式などを定めた規約のこと。

 

個々のソフトウェアの開発者が毎回すべての機能をゼロから開発するのは困難で無駄が多いため、多くのソフトウェアが共通して利用する機能は、OSミドルウェアなどの形でまとめて提供されている。そのような汎用的な機能を呼び出して利用するための手続きを定めたものがAPIで、個々の開発者はAPIに従って機能を呼び出す短いプログラムを記述するだけで、自分でプログラミングすることなくその機能を利用したソフトウェアを作成することができる。

http://e-words.jp/w/API.html 引用元

要は 機能,データを他のプログラムで呼び出して使うときの規約(ルール)。

 

 --------------------------------------------------------------------------------------------

//JSONとは

webアプリケーション間で受け渡しに使うデータの書き方。 

 

JSONとは JavaScript Object Notation の略で、要するに「JavaScriptの中でオブジェクトを記述する書式」

非エンジニアに贈る「具体例でさらっと学ぶJSON」 | Developers.IO 引用元

上記のサイトに詳しく書かれています。

JSONデータの例----------------------------------------------------------

["データ","hoge"]                                                           配列型

{"関東":{"餅":"切り餅","Key":"値","月見団子":"丸型"}} 辞書型
 [{辞書データ},{辞書データ}]           辞書配列型

{"キー":{辞書データ},"キー":{辞書データ}}       辞書の辞書型

-------------------------------------------------------------------------------------------

//セグエ(Modal)とは

下記に詳しく説明がされています。わかりやすい。

Swiftでセグエを利用した画面遷移 - Qiita

 

・画面遷移のこと。 (次の画面へ移動)

例 ボタンをタップすると次の画面へ移動する。

f:id:geta206:20160209003419j:plain

 

--------------------------------------------------------------------------------------------

//ナビゲーションコントローラー(Push)とは

f:id:geta206:20160209004902p:plain

 

これがあるとセグレ(画面移動)よりも機能を多く使うことができる。

ほぼセグレと機能は一緒。

-------------------------------------------------------------------------------------------

//タブバーコントローラー

f:id:geta206:20160209005600p:plain

メニューとか在庫一覧とか書かれている機能のこと。ボタンを押すと画面が切り替わる。セグレと機能は一緒。表示方法が違うだけ。

------------------------------------------------------------------------------------------

//AppDelegate.swift

 アプリをつくった段階でデフォルトでつくられるファイルのひとつ。アプリ全体のライフタイムイベントを管理するためのクラス。

【iOS】AppDelegate.swiftってなにしてんの? - Qiita 引用元

 

・データの受け渡し。 AのデータをBに移動する。

 

--------------------------------------------------------------------------------------------

//Table view

 

f:id:geta206:20160209010404j:plain

・データリストを表示する部品。

コードの例

// 行数
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
 
// 表示するセルの中身
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = UITableViewCell(style: .Default, reuseIdentifier: "myCell")
cell.textLabel!.text = "\(indexPath.row)行目"
return cell
 
}
 
// 選択された時に行う処理
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
print("\(indexPath.row)行目を選択")
}
 
// ステータスバーを非表示にする
override func prefersStatusBarHidden() -> Bool {
return true
}

--------------------------------------------------------------------------------------------

//delegate と dataSource の違い

  delegate

  view Controller の命令を聞いて実行する。   

 

  detaSource

 データソースの入手元になる 接続先。

 住所みたいなイメージなのかな。

 

 ・ TableViewをタップすると値を表示させる仕組み。

 ------------------------------------------------------------------------------------------

//modal とpushの違い

modal  画面の上に重ねていく

push      画面を切り替える

 

世の中の3つの恋愛の形について。[バレンタインデー企画]

世の中には大きく分けて3つの恋愛があるらしい。

1つ目 不平等の恋愛 要はどちらかが上から目線。 

2つ目 平等の恋愛  世界で一番多い恋愛の形。

3つ目 理想の恋愛  お互いに尊敬しあい何不自由なく暮らす。

 

 3つの説明をする前に例を挙げる。

   相手が食べた物が机の上に散らかったままです。

   この時のセリフは、

   男性の心の場合「自分で食べた物片付けろ」

   女性の心の場合「机の上に物が置いてあるから片付けてほしい」

 

 この時のセリフが男性で相手の返事が女性的返しの仕方であれば。

 1番目の恋愛の形になる。 要は上下関係ができている。

 

 2番目の場合だと 相手も自分も返事の仕方が「男性」または「女性」の返し方。

          お互いに平等の立場でできている。

          他の例を挙げると 片方が浮気すれば自分も浮気する

                           ようなイメージ。

 

   3番目の場合だと そもそもそのような争いは起こらない。

          それは相手の思いをお互いに尊重し合っているから。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

補足説明。

 

1つ目について。

 ・DVとかに多い

2つ目

  ・マンネリ化すると起こりやすい。

3つ目

  ・少数派。

p.s.

セブのキムタク様 お話ありがとうございました。

jollibeeのキャラクターについての英文。[メモ書き]

Jollibee, a large bee mascot dressed in a blazer, shirt, and chef's hat introduced by the brand in 1980.
 
⚠️optimism is positive thinking.
 
It  was designed to symbolize Filipino optimism. "The bee hops around and produces sweet things for life, and is happy even though it is busy," Tony Tan explains.
 
Mr.Yum and was introduced in 1989.Then , it was changed to yum in 2008. It represents the burger.   
Twirle was introdued in 1988.it represents the desserts.
popo was introdued in 1985.it represents the French fries.
finally, hetty was introdued in 1984.it represents the spaghetti.
 

jollibeeの歴史をwikiを使って簡単にまとめてみた。

Jollibee Foods Corporation (also called JFC and popularly known simply as Jollibee), is a Filipino multinational chain of fast food restaurants headquartered in Pasig. JFC is the owner of the popular fast food brand Jollibee, dubbed as Asia's answer to McDonald's in the fast food burger business.

With the success of its flagship brand, JFC acquired some of its competitors in the fast food business in the Philippines and abroad such as ChowkingGreenwich PizzaRed RibbonMang Inasal, and Burger King Philippines.3 As of January 2015, JFC had a total of more than 3,000 stores worldwide,4 with system-wide retail sales totaling 82.1 billion pesos for the fiscal year 2011.

————————————————————————————history

In 1975,At first,founder of jollbee Mr. Tony Tan Caktiong an his familiy opend a Magnolia Ice Cream. In 1978, Then the family decided changing the business form ice cream to hot dogs.
1981
Jollibee experienced rapid growth. It was able to withstand the entry of McDonald's in the Philippines in 1981 by focusing on the specific tastes of the Filipino market, which differed from the American fast food company.
1881 part 2
  the chain opened successful milestone stores in the following years: its 100th branch in Davao in 1991; its 300th store in Balagtas, Bulacan in 1998;its 500th store in Basilan in 2004;  its 800th store in Malaybalay CityBukidnon on October 18, 2013.
But, as of january 2015 there were more than 3000 stores around the world.
-------------------------------------------------------------------------------