This file contains hidden or 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
public struct CalculateCalendarLogic { | |
/** | |
* | |
* 祝日になる日を判定する | |
* (引数) year: Int, month: Int, day: Int, weekdayIndex: Int | |
* weekdayIndexはWeekdayのenumに該当する値(0...6)が入る | |
* ※1. カレンダーロジックの参考:http://p-ho.net/index.php?page=2s2 | |
* ※2. 書き方(タプル)の参考:http://blog.kitoko552.com/entry/2015/06/17/213553 | |
* ※3. [Swift] 関数における引数/戻り値とタプルの関係:http://dev.classmethod.jp/smartphone/swift-function-tupsle/ |
This file contains hidden or 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
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
if let navigationController = navigationController as? ScrollingNavigationController { | |
navigationController.followScrollView(articleTableView, delay: 44.0) | |
//MEMO: ScrollingNavigationControllerDelegateを利用する際に必要な宣言 | |
//navigationController.scrollingNavbarDelegate = self | |
} | |
} |
This file contains hidden or 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
import Foundation | |
import UIKit | |
class FlipDismissCustomTransition: NSObject { | |
//トランジション(実行)の秒数 | |
fileprivate let duration: TimeInterval = 0.72 | |
//ディレイ(遅延)の秒数 | |
fileprivate let delay: TimeInterval = 0.00 |
This file contains hidden or 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
import Foundation | |
import UIKit | |
import SwiftyJSON | |
struct Article { | |
//メンバ変数(取得したJSONレスポンスのKeyに対応する値が入る) | |
let id: Int | |
let thumbnailUrl: String | |
let title: String |
This file contains hidden or 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
/** | |
* アプリコンテンツ用のコンポーネント | |
*/ | |
import React, { Component } from 'react'; | |
//react-native-router-fluxのインポート宣言(Actionを使用) | |
import { Router, Scene } from 'react-native-router-flux'; | |
//自作コンポーネント |
This file contains hidden or 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
/** | |
* アルバム一覧用のコンポーネント | |
*/ | |
import React, { Component } from 'react'; | |
import { ScrollView } from 'react-native'; | |
//HTTP通信用のライブラリ'axios'のインポート宣言 | |
import axios from 'axios'; | |
//アルバム詳細用の共通コンポーネントのインポート宣言 |
This file contains hidden or 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
//レシピを登録する時のアクション | |
@IBAction func saveRecipeAction(_ sender: UIButton) { | |
//キーボードを閉じる | |
view.endEditing(true) | |
//ボタンを非活性状態にする | |
closeButton.isEnabled = false | |
saveButton.isEnabled = false |
This file contains hidden or 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
enum APIKey: String { | |
case foresquare_clientid = "自分のクライアントID" | |
case foresquare_clientsecret = "自分のシークレット" | |
} |
This file contains hidden or 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
import UIKit | |
import RxDataSources | |
//ラーメンデータ定義用の構造体(Model層) | |
struct Ramen { | |
//取得データに関する定義 | |
let name: String | |
let taste: String | |
let imageId: String |
This file contains hidden or 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
//「もっと他の画像を見る」ボタンのアクション | |
@IBAction func moreImageAction(_ sender: UIButton) { | |
transitionClosure!(nil) | |
} | |
//サムネイル画像のTapGesture発動時に実行されるメソッド | |
func tapGesture(sender: UITapGestureRecognizer) { | |
let targetNumber: Int = (sender.view?.tag)! | |
transitionClosure!(targetNumber) | |
} |