├── .gitignore ├── Podfile ├── Podfile.lock ├── README.md ├── SampleFirebase.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── ShinokiRyosei.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ShinokiRyosei.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── SampleFirebase.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── ShinokiRyosei.xcuserdatad │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── SampleFirebase ├── AppDelegate.swift ├── Controllers │ ├── ListViewController.swift │ ├── LoginViewController.swift │ ├── ProfileViewController.swift │ ├── SignupViewController.swift │ └── ViewController.swift ├── CustomCell │ ├── ListTableViewCell.swift │ └── ListTableViewCell.xib ├── Defaults-master │ ├── Default-568h@2x.png │ ├── Default-667h@2x.png │ └── Default-736h@3x.png ├── Resources │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ └── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard ├── Utility.swift └── plists │ ├── GoogleService-Info.plist │ └── Info.plist ├── SampleFirebaseTests ├── Info.plist └── SampleFirebaseTests.swift └── SampleFirebaseUITests ├── Info.plist └── SampleFirebaseUITests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | ### https://raw.github.com/github/gitignore/44763e48a4f085c3ab2d2e57192e65573889d6d0/swift.gitignore 2 | 3 | # Xcode 4 | # 5 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 6 | GlobalVariable.swift 7 | ## Build generated 8 | build/ 9 | DerivedData/ 10 | 11 | ## Various settings 12 | *.pbxuser 13 | !default.pbxuser 14 | *.mode1v3 15 | !default.mode1v3 16 | *.mode2v3 17 | !default.mode2v3 18 | *.perspectivev3 19 | !default.perspectivev3 20 | xcuserdata/ 21 | 22 | ## Other 23 | *.moved-aside 24 | *.xcuserstate 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | *.dSYM.zip 30 | *.dSYM 31 | 32 | ## Playgrounds 33 | timeline.xctimeline 34 | playground.xcworkspace 35 | 36 | # Swift Package Manager 37 | # 38 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 39 | # Packages/ 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | 69 | 70 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '8.0' 3 | # Uncomment this line if you're using Swift 4 | use_frameworks! 5 | platform :ios, '10.0' 6 | 7 | target 'SampleFirebase' do 8 | 9 | pod 'Firebase' 10 | pod 'Firebase/Database' 11 | pod 'Firebase/Auth' 12 | pod 'Firebase/Messaging' 13 | pod 'Firebase/Storage' 14 | pod 'FontAwesome.swift' 15 | pod 'FBSDKLoginKit' 16 | pod 'FBSDKCoreKit' 17 | pod 'FBSDKShareKit' 18 | pod 'TwitterKit' 19 | pod 'Fabric' 20 | end 21 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Bolts (1.9.0): 3 | - Bolts/AppLinks (= 1.9.0) 4 | - Bolts/Tasks (= 1.9.0) 5 | - Bolts/AppLinks (1.9.0): 6 | - Bolts/Tasks 7 | - Bolts/Tasks (1.9.0) 8 | - Fabric (1.9.0) 9 | - FBSDKCoreKit (4.41.0): 10 | - Bolts (~> 1.9) 11 | - FBSDKLoginKit (4.41.0): 12 | - FBSDKCoreKit 13 | - FBSDKShareKit (4.41.0): 14 | - FBSDKCoreKit 15 | - Firebase (5.18.0): 16 | - Firebase/Core (= 5.18.0) 17 | - Firebase/Auth (5.18.0): 18 | - Firebase/CoreOnly 19 | - FirebaseAuth (= 5.4.0) 20 | - Firebase/Core (5.18.0): 21 | - Firebase/CoreOnly 22 | - FirebaseAnalytics (= 5.7.0) 23 | - Firebase/CoreOnly (5.18.0): 24 | - FirebaseCore (= 5.3.1) 25 | - Firebase/Database (5.18.0): 26 | - Firebase/CoreOnly 27 | - FirebaseDatabase (= 5.1.0) 28 | - Firebase/Messaging (5.18.0): 29 | - Firebase/CoreOnly 30 | - FirebaseMessaging (= 3.3.2) 31 | - Firebase/Storage (5.18.0): 32 | - Firebase/CoreOnly 33 | - FirebaseStorage (= 3.1.0) 34 | - FirebaseAnalytics (5.7.0): 35 | - FirebaseCore (~> 5.3) 36 | - FirebaseInstanceID (~> 3.6) 37 | - GoogleAppMeasurement (= 5.7.0) 38 | - GoogleUtilities/AppDelegateSwizzler (~> 5.2) 39 | - GoogleUtilities/MethodSwizzler (~> 5.2) 40 | - GoogleUtilities/Network (~> 5.2) 41 | - "GoogleUtilities/NSData+zlib (~> 5.2)" 42 | - nanopb (~> 0.3) 43 | - FirebaseAnalyticsInterop (1.2.0) 44 | - FirebaseAuth (5.4.0): 45 | - FirebaseAuthInterop (~> 1.0) 46 | - FirebaseCore (~> 5.2) 47 | - GoogleUtilities/Environment (~> 5.2) 48 | - GTMSessionFetcher/Core (~> 1.1) 49 | - FirebaseAuthInterop (1.0.0) 50 | - FirebaseCore (5.3.1): 51 | - GoogleUtilities/Logger (~> 5.2) 52 | - FirebaseDatabase (5.1.0): 53 | - FirebaseAuthInterop (~> 1.0) 54 | - FirebaseCore (~> 5.2) 55 | - leveldb-library (~> 1.18) 56 | - FirebaseInstanceID (3.7.0): 57 | - FirebaseCore (~> 5.2) 58 | - GoogleUtilities/Environment (~> 5.2) 59 | - GoogleUtilities/UserDefaults (~> 5.2) 60 | - FirebaseMessaging (3.3.2): 61 | - FirebaseAnalyticsInterop (~> 1.1) 62 | - FirebaseCore (~> 5.2) 63 | - FirebaseInstanceID (~> 3.6) 64 | - GoogleUtilities/Environment (~> 5.3) 65 | - GoogleUtilities/Reachability (~> 5.3) 66 | - GoogleUtilities/UserDefaults (~> 5.3) 67 | - Protobuf (~> 3.1) 68 | - FirebaseStorage (3.1.0): 69 | - FirebaseAuthInterop (~> 1.0) 70 | - FirebaseCore (~> 5.2) 71 | - GTMSessionFetcher/Core (~> 1.1) 72 | - FontAwesome.swift (1.6.0) 73 | - GoogleAppMeasurement (5.7.0): 74 | - GoogleUtilities/AppDelegateSwizzler (~> 5.2) 75 | - GoogleUtilities/MethodSwizzler (~> 5.2) 76 | - GoogleUtilities/Network (~> 5.2) 77 | - "GoogleUtilities/NSData+zlib (~> 5.2)" 78 | - nanopb (~> 0.3) 79 | - GoogleUtilities/AppDelegateSwizzler (5.5.0): 80 | - GoogleUtilities/Environment 81 | - GoogleUtilities/Logger 82 | - GoogleUtilities/Network 83 | - GoogleUtilities/Environment (5.5.0) 84 | - GoogleUtilities/Logger (5.5.0): 85 | - GoogleUtilities/Environment 86 | - GoogleUtilities/MethodSwizzler (5.5.0): 87 | - GoogleUtilities/Logger 88 | - GoogleUtilities/Network (5.5.0): 89 | - GoogleUtilities/Logger 90 | - "GoogleUtilities/NSData+zlib" 91 | - GoogleUtilities/Reachability 92 | - "GoogleUtilities/NSData+zlib (5.5.0)" 93 | - GoogleUtilities/Reachability (5.5.0): 94 | - GoogleUtilities/Logger 95 | - GoogleUtilities/UserDefaults (5.5.0): 96 | - GoogleUtilities/Logger 97 | - GTMSessionFetcher/Core (1.2.1) 98 | - leveldb-library (1.20) 99 | - nanopb (0.3.901): 100 | - nanopb/decode (= 0.3.901) 101 | - nanopb/encode (= 0.3.901) 102 | - nanopb/decode (0.3.901) 103 | - nanopb/encode (0.3.901) 104 | - Protobuf (3.7.0) 105 | - TwitterCore (3.2.0) 106 | - TwitterKit (3.4.2): 107 | - TwitterCore (>= 3.2.0) 108 | 109 | DEPENDENCIES: 110 | - Fabric 111 | - FBSDKCoreKit 112 | - FBSDKLoginKit 113 | - FBSDKShareKit 114 | - Firebase 115 | - Firebase/Auth 116 | - Firebase/Database 117 | - Firebase/Messaging 118 | - Firebase/Storage 119 | - FontAwesome.swift 120 | - TwitterKit 121 | 122 | SPEC REPOS: 123 | https://github.com/cocoapods/specs.git: 124 | - Bolts 125 | - Fabric 126 | - FBSDKCoreKit 127 | - FBSDKLoginKit 128 | - FBSDKShareKit 129 | - Firebase 130 | - FirebaseAnalytics 131 | - FirebaseAnalyticsInterop 132 | - FirebaseAuth 133 | - FirebaseAuthInterop 134 | - FirebaseCore 135 | - FirebaseDatabase 136 | - FirebaseInstanceID 137 | - FirebaseMessaging 138 | - FirebaseStorage 139 | - FontAwesome.swift 140 | - GoogleAppMeasurement 141 | - GoogleUtilities 142 | - GTMSessionFetcher 143 | - leveldb-library 144 | - nanopb 145 | - Protobuf 146 | - TwitterCore 147 | - TwitterKit 148 | 149 | SPEC CHECKSUMS: 150 | Bolts: ac6567323eac61e203f6a9763667d0f711be34c8 151 | Fabric: f988e33c97f08930a413e08123064d2e5f68d655 152 | FBSDKCoreKit: 974810fe3806173f3777c68062fa8ed6fa59b59d 153 | FBSDKLoginKit: 159a5c2eebe6a0774c3b128f5085128679233d2b 154 | FBSDKShareKit: 79dfd0c51f1a241f33e219fcc39e7cc69534b900 155 | Firebase: 02f3281965c075426141a0ce1277e9de6649cab9 156 | FirebaseAnalytics: 23851fe602c872130a2c5c55040b302120346cc2 157 | FirebaseAnalyticsInterop: efbe45c8385ec626e29f9525e5ebd38520dfb6c1 158 | FirebaseAuth: d85d052354447f30b4b2a805ab91b511458b56a6 159 | FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc 160 | FirebaseCore: 52f851b30e11360f1e67cf04b1edfebf0a47a2d3 161 | FirebaseDatabase: 23acb0c53cd4d4070a427b60100b2e4aaa97c45d 162 | FirebaseInstanceID: bd6fc5a258884e206fd5c474ebe4f5b00e21770e 163 | FirebaseMessaging: d740150547f7686b33799f6489f5b69a4706631b 164 | FirebaseStorage: 29075f874c2b3cf61e5221a62c4ceefc809e5412 165 | FontAwesome.swift: 71a422e7b209ee940c7c21a5d13964ecf2897ca4 166 | GoogleAppMeasurement: 6cf307834da065863f9faf4c0de0a936d81dd832 167 | GoogleUtilities: 6481e6318c5fcabaaa8513ef8120f329055d7c10 168 | GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca 169 | leveldb-library: 08cba283675b7ed2d99629a4bc5fd052cd2bb6a5 170 | nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 171 | Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a 172 | TwitterCore: 8cbc9ad34d91c63a0035ea05bfbfc0d7ca72a28c 173 | TwitterKit: 5e4f41d70b9abdb41df5467f52d7aa2c0fd26ebb 174 | 175 | PODFILE CHECKSUM: 42302304e0134c36a171aa96c3074f06530e34c8 176 | 177 | COCOAPODS: 1.6.1 178 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Firebase Sampler 2 | 3 | ## 概要 4 | 2016年5月からアップデートされたFirebaseで、Auth Database Push通知を実装しています。 5 | 6 | ### 開発環境 7 | Xcode 8.0 8 | 9 | OS X 10.11.5 10 | 11 | Firebase 3.7.1 12 | 13 | Firebase Database 3.7.1 14 | 15 | Firebase Auth 3.0.5 16 | 17 | ## 仕様 18 | ### 画面構成 19 | SignupViewControllerあるいは、LoginViewControllerが最初の画面となります。ログイン状態なら、そのままListViewControllerに遷移するようになっています。データの追加はListViewControllerの右上のプラスボタンからViewControllerに遷移することで、textfieldから文字をPOSTすることができます。 20 | 21 | ### Auth 22 | EmailとPasswordでユーザー認証が可能になっています。 23 | 24 | ### Database 25 | #### CREATE 26 | ViewControllerクラスのcreate()という関数でtextfieldに打ち込んだ文字をユーザーのTokenと日時と一緒に送信しています。 27 | 28 | DatabaseのDB設計としては、 29 | ユーザーのTokenをIDとして、そこからViewControllerのcreate()関数で送られたデータをコレクションとして保存しています。 30 | 31 | #### READ 32 | ListViewControllerのread()関数で自身のPOSTしたデータのみを読み込んでいます。 33 | 34 | それぞれをTableViewで表示しています。 35 | 36 | FIRDataEventTypeをValueにすることで、すべての変化に対して対応しています 37 | 38 | 39 | 40 | #### UPDATE 41 | ViewControllerのupdate関数でデータベース上の該当のデータを更新しています。 42 | 43 | isCreateで更新か作成かをBoolで判断しています。 44 | post関数でisCreateがどちらかによってcreateとupdateを切り替えてます 45 | 46 | #### DELETE 47 | ListViewControllerに実装しているdelete関数をtableview(tableview:commitEditingStyle)の中で呼び出し、NSIndexPathを渡すことで、該当するデータをDatabaseから削除しています。 48 | 49 | 50 | ### Push通知 51 | Firebaseのコンソールからプッシュ通知を送ることができます。また、未読のプッシュ通知の数はバッジで表示します。 52 | 53 | 未読かどうか、プッシュ通知の一覧をTableViewで表示する機能などは今後実装予定です。 54 | 55 | ## Pull Request 56 | まだまだ理解ができていない部分が多いので、プルリクエスト大歓迎です。 57 | プルリクエストお待ちしております。 58 | -------------------------------------------------------------------------------- /SampleFirebase.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 390928A31CF30E7500493172 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 390928A21CF30E7500493172 /* GoogleService-Info.plist */; }; 11 | 390E15B61D1A837C008FDEDD /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 390E15B51D1A837C008FDEDD /* ProfileViewController.swift */; }; 12 | 39176FC71D2BA808003C8DB2 /* GlobalVariable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39176FC61D2BA808003C8DB2 /* GlobalVariable.swift */; }; 13 | 391E6C011D4373CD00C2CF8D /* Utility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391E6C001D4373CD00C2CF8D /* Utility.swift */; }; 14 | 392767531C7AD9AF00A5DB93 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392767521C7AD9AF00A5DB93 /* AppDelegate.swift */; }; 15 | 392767551C7AD9AF00A5DB93 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392767541C7AD9AF00A5DB93 /* ViewController.swift */; }; 16 | 392767581C7AD9AF00A5DB93 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 392767561C7AD9AF00A5DB93 /* Main.storyboard */; }; 17 | 3927675A1C7AD9AF00A5DB93 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 392767591C7AD9AF00A5DB93 /* Assets.xcassets */; }; 18 | 3927675D1C7AD9AF00A5DB93 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3927675B1C7AD9AF00A5DB93 /* LaunchScreen.storyboard */; }; 19 | 3928EE8C1CED74050065A9EF /* SignupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3928EE8B1CED74050065A9EF /* SignupViewController.swift */; }; 20 | 3940EE671CE8409900293067 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3940EE661CE8409900293067 /* LoginViewController.swift */; }; 21 | 395A40A31C81437A00ED11C5 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 395A40A01C81437A00ED11C5 /* Default-568h@2x.png */; }; 22 | 395A40A41C81437A00ED11C5 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 395A40A11C81437A00ED11C5 /* Default-667h@2x.png */; }; 23 | 395A40A51C81437A00ED11C5 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 395A40A21C81437A00ED11C5 /* Default-736h@3x.png */; }; 24 | 395A40AA1C81500D00ED11C5 /* ListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395A40A81C81500D00ED11C5 /* ListTableViewCell.swift */; }; 25 | 395A40AB1C81500D00ED11C5 /* ListTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 395A40A91C81500D00ED11C5 /* ListTableViewCell.xib */; }; 26 | 395A40AE1C8151DD00ED11C5 /* ListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395A40AD1C8151DD00ED11C5 /* ListViewController.swift */; }; 27 | 6431D06EBCC5BCEFB5B35F7D /* Pods_SampleFirebase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0E841C4AFCAF12003CAE50B /* Pods_SampleFirebase.framework */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 04468F72978B9AF5F328D20B /* Pods_SampleFirebaseUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleFirebaseUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 22D580FFB9D9CBC518BF511A /* Pods-SampleFirebase.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleFirebase.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SampleFirebase/Pods-SampleFirebase.debug.xcconfig"; sourceTree = ""; }; 33 | 390928A21CF30E7500493172 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 34 | 390E15B51D1A837C008FDEDD /* ProfileViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileViewController.swift; sourceTree = ""; }; 35 | 39176FC61D2BA808003C8DB2 /* GlobalVariable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalVariable.swift; sourceTree = ""; }; 36 | 391E6C001D4373CD00C2CF8D /* Utility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utility.swift; sourceTree = ""; }; 37 | 3927674F1C7AD9AF00A5DB93 /* SampleFirebase.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleFirebase.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 392767521C7AD9AF00A5DB93 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 392767541C7AD9AF00A5DB93 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 40 | 392767571C7AD9AF00A5DB93 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | 392767591C7AD9AF00A5DB93 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | 3927675C1C7AD9AF00A5DB93 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 43 | 3927675E1C7AD9AF00A5DB93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 392767671C7AD9AF00A5DB93 /* SampleFirebaseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleFirebaseTests.swift; sourceTree = ""; }; 45 | 392767691C7AD9AF00A5DB93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 392767721C7AD9AF00A5DB93 /* SampleFirebaseUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleFirebaseUITests.swift; sourceTree = ""; }; 47 | 392767741C7AD9AF00A5DB93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 3928EE8B1CED74050065A9EF /* SignupViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignupViewController.swift; sourceTree = ""; }; 49 | 3940EE661CE8409900293067 /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; 50 | 395A40A01C81437A00ED11C5 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 51 | 395A40A11C81437A00ED11C5 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = ""; }; 52 | 395A40A21C81437A00ED11C5 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = ""; }; 53 | 395A40A81C81500D00ED11C5 /* ListTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListTableViewCell.swift; sourceTree = ""; }; 54 | 395A40A91C81500D00ED11C5 /* ListTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ListTableViewCell.xib; sourceTree = ""; }; 55 | 395A40AD1C8151DD00ED11C5 /* ListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListViewController.swift; sourceTree = ""; }; 56 | 54910877D65260CE531370A0 /* Pods_SampleFirebaseTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleFirebaseTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 6F2A0EB4F8895D1C0A421D8A /* Pods-SampleFirebase.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleFirebase.release.xcconfig"; path = "Pods/Target Support Files/Pods-SampleFirebase/Pods-SampleFirebase.release.xcconfig"; sourceTree = ""; }; 58 | F0E841C4AFCAF12003CAE50B /* Pods_SampleFirebase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleFirebase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 3927674C1C7AD9AF00A5DB93 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 6431D06EBCC5BCEFB5B35F7D /* Pods_SampleFirebase.framework in Frameworks */, 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | /* End PBXFrameworksBuildPhase section */ 71 | 72 | /* Begin PBXGroup section */ 73 | 392767461C7AD9AF00A5DB93 = { 74 | isa = PBXGroup; 75 | children = ( 76 | 5B09693A60C54B69D3957206 /* Frameworks */, 77 | D40A4DD98AEB0D4C07AF9308 /* Pods */, 78 | 392767501C7AD9AF00A5DB93 /* Products */, 79 | 392767511C7AD9AF00A5DB93 /* SampleFirebase */, 80 | 392767661C7AD9AF00A5DB93 /* SampleFirebaseTests */, 81 | 392767711C7AD9AF00A5DB93 /* SampleFirebaseUITests */, 82 | ); 83 | sourceTree = ""; 84 | }; 85 | 392767501C7AD9AF00A5DB93 /* Products */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 3927674F1C7AD9AF00A5DB93 /* SampleFirebase.app */, 89 | ); 90 | name = Products; 91 | sourceTree = ""; 92 | }; 93 | 392767511C7AD9AF00A5DB93 /* SampleFirebase */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 3928EE8D1CED742D0065A9EF /* Controllers */, 97 | 395A40AC1C81509200ED11C5 /* CustomCell */, 98 | 395A409F1C81437A00ED11C5 /* Defaults-master */, 99 | 39C186FD1E1405DD00B70042 /* Resources */, 100 | 39C186FE1E1405E900B70042 /* plists */, 101 | 392767521C7AD9AF00A5DB93 /* AppDelegate.swift */, 102 | 39176FC61D2BA808003C8DB2 /* GlobalVariable.swift */, 103 | 391E6C001D4373CD00C2CF8D /* Utility.swift */, 104 | ); 105 | path = SampleFirebase; 106 | sourceTree = ""; 107 | }; 108 | 392767661C7AD9AF00A5DB93 /* SampleFirebaseTests */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 392767691C7AD9AF00A5DB93 /* Info.plist */, 112 | 392767671C7AD9AF00A5DB93 /* SampleFirebaseTests.swift */, 113 | ); 114 | path = SampleFirebaseTests; 115 | sourceTree = ""; 116 | }; 117 | 392767711C7AD9AF00A5DB93 /* SampleFirebaseUITests */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 392767741C7AD9AF00A5DB93 /* Info.plist */, 121 | 392767721C7AD9AF00A5DB93 /* SampleFirebaseUITests.swift */, 122 | ); 123 | path = SampleFirebaseUITests; 124 | sourceTree = ""; 125 | }; 126 | 3928EE8D1CED742D0065A9EF /* Controllers */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 395A40AD1C8151DD00ED11C5 /* ListViewController.swift */, 130 | 3940EE661CE8409900293067 /* LoginViewController.swift */, 131 | 390E15B51D1A837C008FDEDD /* ProfileViewController.swift */, 132 | 3928EE8B1CED74050065A9EF /* SignupViewController.swift */, 133 | 392767541C7AD9AF00A5DB93 /* ViewController.swift */, 134 | ); 135 | path = Controllers; 136 | sourceTree = ""; 137 | }; 138 | 395A409F1C81437A00ED11C5 /* Defaults-master */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 395A40A01C81437A00ED11C5 /* Default-568h@2x.png */, 142 | 395A40A11C81437A00ED11C5 /* Default-667h@2x.png */, 143 | 395A40A21C81437A00ED11C5 /* Default-736h@3x.png */, 144 | ); 145 | path = "Defaults-master"; 146 | sourceTree = ""; 147 | }; 148 | 395A40AC1C81509200ED11C5 /* CustomCell */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 395A40A81C81500D00ED11C5 /* ListTableViewCell.swift */, 152 | 395A40A91C81500D00ED11C5 /* ListTableViewCell.xib */, 153 | ); 154 | path = CustomCell; 155 | sourceTree = ""; 156 | }; 157 | 39C186FD1E1405DD00B70042 /* Resources */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 392767591C7AD9AF00A5DB93 /* Assets.xcassets */, 161 | 3927675B1C7AD9AF00A5DB93 /* LaunchScreen.storyboard */, 162 | 392767561C7AD9AF00A5DB93 /* Main.storyboard */, 163 | ); 164 | path = Resources; 165 | sourceTree = ""; 166 | }; 167 | 39C186FE1E1405E900B70042 /* plists */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | 390928A21CF30E7500493172 /* GoogleService-Info.plist */, 171 | 3927675E1C7AD9AF00A5DB93 /* Info.plist */, 172 | ); 173 | path = plists; 174 | sourceTree = ""; 175 | }; 176 | 5B09693A60C54B69D3957206 /* Frameworks */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | F0E841C4AFCAF12003CAE50B /* Pods_SampleFirebase.framework */, 180 | 54910877D65260CE531370A0 /* Pods_SampleFirebaseTests.framework */, 181 | 04468F72978B9AF5F328D20B /* Pods_SampleFirebaseUITests.framework */, 182 | ); 183 | name = Frameworks; 184 | sourceTree = ""; 185 | }; 186 | D40A4DD98AEB0D4C07AF9308 /* Pods */ = { 187 | isa = PBXGroup; 188 | children = ( 189 | 22D580FFB9D9CBC518BF511A /* Pods-SampleFirebase.debug.xcconfig */, 190 | 6F2A0EB4F8895D1C0A421D8A /* Pods-SampleFirebase.release.xcconfig */, 191 | ); 192 | name = Pods; 193 | sourceTree = ""; 194 | }; 195 | /* End PBXGroup section */ 196 | 197 | /* Begin PBXNativeTarget section */ 198 | 3927674E1C7AD9AF00A5DB93 /* SampleFirebase */ = { 199 | isa = PBXNativeTarget; 200 | buildConfigurationList = 392767771C7AD9AF00A5DB93 /* Build configuration list for PBXNativeTarget "SampleFirebase" */; 201 | buildPhases = ( 202 | 00C20E086138C66F37594915 /* [CP] Check Pods Manifest.lock */, 203 | 3927674B1C7AD9AF00A5DB93 /* Sources */, 204 | 3927674C1C7AD9AF00A5DB93 /* Frameworks */, 205 | 3927674D1C7AD9AF00A5DB93 /* Resources */, 206 | E5068566E956F69A837FB52B /* [CP] Embed Pods Frameworks */, 207 | BE4C9EB81836302F7F253FE7 /* [CP] Copy Pods Resources */, 208 | ); 209 | buildRules = ( 210 | ); 211 | dependencies = ( 212 | ); 213 | name = SampleFirebase; 214 | productName = SampleFirebase; 215 | productReference = 3927674F1C7AD9AF00A5DB93 /* SampleFirebase.app */; 216 | productType = "com.apple.product-type.application"; 217 | }; 218 | /* End PBXNativeTarget section */ 219 | 220 | /* Begin PBXProject section */ 221 | 392767471C7AD9AF00A5DB93 /* Project object */ = { 222 | isa = PBXProject; 223 | attributes = { 224 | LastSwiftUpdateCheck = 0720; 225 | LastUpgradeCheck = 0930; 226 | ORGANIZATIONNAME = ShinokiRyosei; 227 | TargetAttributes = { 228 | 3927674E1C7AD9AF00A5DB93 = { 229 | CreatedOnToolsVersion = 7.2.1; 230 | DevelopmentTeam = 3Q4MHTP27C; 231 | LastSwiftMigration = 0820; 232 | ProvisioningStyle = Automatic; 233 | SystemCapabilities = { 234 | com.apple.Push = { 235 | enabled = 1; 236 | }; 237 | }; 238 | }; 239 | }; 240 | }; 241 | buildConfigurationList = 3927674A1C7AD9AF00A5DB93 /* Build configuration list for PBXProject "SampleFirebase" */; 242 | compatibilityVersion = "Xcode 3.2"; 243 | developmentRegion = English; 244 | hasScannedForEncodings = 0; 245 | knownRegions = ( 246 | en, 247 | Base, 248 | ); 249 | mainGroup = 392767461C7AD9AF00A5DB93; 250 | productRefGroup = 392767501C7AD9AF00A5DB93 /* Products */; 251 | projectDirPath = ""; 252 | projectRoot = ""; 253 | targets = ( 254 | 3927674E1C7AD9AF00A5DB93 /* SampleFirebase */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | 3927674D1C7AD9AF00A5DB93 /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 3927675D1C7AD9AF00A5DB93 /* LaunchScreen.storyboard in Resources */, 265 | 390928A31CF30E7500493172 /* GoogleService-Info.plist in Resources */, 266 | 395A40A31C81437A00ED11C5 /* Default-568h@2x.png in Resources */, 267 | 3927675A1C7AD9AF00A5DB93 /* Assets.xcassets in Resources */, 268 | 392767581C7AD9AF00A5DB93 /* Main.storyboard in Resources */, 269 | 395A40A41C81437A00ED11C5 /* Default-667h@2x.png in Resources */, 270 | 395A40A51C81437A00ED11C5 /* Default-736h@3x.png in Resources */, 271 | 395A40AB1C81500D00ED11C5 /* ListTableViewCell.xib in Resources */, 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | /* End PBXResourcesBuildPhase section */ 276 | 277 | /* Begin PBXShellScriptBuildPhase section */ 278 | 00C20E086138C66F37594915 /* [CP] Check Pods Manifest.lock */ = { 279 | isa = PBXShellScriptBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | inputPaths = ( 284 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 285 | "${PODS_ROOT}/Manifest.lock", 286 | ); 287 | name = "[CP] Check Pods Manifest.lock"; 288 | outputPaths = ( 289 | "$(DERIVED_FILE_DIR)/Pods-SampleFirebase-checkManifestLockResult.txt", 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | shellPath = /bin/sh; 293 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 294 | showEnvVarsInLog = 0; 295 | }; 296 | BE4C9EB81836302F7F253FE7 /* [CP] Copy Pods Resources */ = { 297 | isa = PBXShellScriptBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | inputPaths = ( 302 | "${PODS_ROOT}/Target Support Files/Pods-SampleFirebase/Pods-SampleFirebase-resources.sh", 303 | "${PODS_ROOT}/TwitterKit/iOS/TwitterKit.framework/TwitterKitResources.bundle", 304 | ); 305 | name = "[CP] Copy Pods Resources"; 306 | outputPaths = ( 307 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TwitterKitResources.bundle", 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | shellPath = /bin/sh; 311 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SampleFirebase/Pods-SampleFirebase-resources.sh\"\n"; 312 | showEnvVarsInLog = 0; 313 | }; 314 | E5068566E956F69A837FB52B /* [CP] Embed Pods Frameworks */ = { 315 | isa = PBXShellScriptBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | ); 319 | inputPaths = ( 320 | "${PODS_ROOT}/Target Support Files/Pods-SampleFirebase/Pods-SampleFirebase-frameworks.sh", 321 | "${BUILT_PRODUCTS_DIR}/Bolts/Bolts.framework", 322 | "${BUILT_PRODUCTS_DIR}/FBSDKCoreKit/FBSDKCoreKit.framework", 323 | "${BUILT_PRODUCTS_DIR}/FBSDKLoginKit/FBSDKLoginKit.framework", 324 | "${BUILT_PRODUCTS_DIR}/FBSDKShareKit/FBSDKShareKit.framework", 325 | "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework", 326 | "${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework", 327 | "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", 328 | "${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework", 329 | "${PODS_ROOT}/TwitterCore/iOS/TwitterCore.framework", 330 | "${PODS_ROOT}/TwitterKit/iOS/TwitterKit.framework", 331 | "${BUILT_PRODUCTS_DIR}/leveldb-library/leveldb.framework", 332 | "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", 333 | ); 334 | name = "[CP] Embed Pods Frameworks"; 335 | outputPaths = ( 336 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Bolts.framework", 337 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKCoreKit.framework", 338 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKLoginKit.framework", 339 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKShareKit.framework", 340 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FontAwesome_swift.framework", 341 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework", 342 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", 343 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", 344 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwitterCore.framework", 345 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwitterKit.framework", 346 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/leveldb.framework", 347 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | shellPath = /bin/sh; 351 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SampleFirebase/Pods-SampleFirebase-frameworks.sh\"\n"; 352 | showEnvVarsInLog = 0; 353 | }; 354 | /* End PBXShellScriptBuildPhase section */ 355 | 356 | /* Begin PBXSourcesBuildPhase section */ 357 | 3927674B1C7AD9AF00A5DB93 /* Sources */ = { 358 | isa = PBXSourcesBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | 3928EE8C1CED74050065A9EF /* SignupViewController.swift in Sources */, 362 | 392767551C7AD9AF00A5DB93 /* ViewController.swift in Sources */, 363 | 391E6C011D4373CD00C2CF8D /* Utility.swift in Sources */, 364 | 395A40AE1C8151DD00ED11C5 /* ListViewController.swift in Sources */, 365 | 392767531C7AD9AF00A5DB93 /* AppDelegate.swift in Sources */, 366 | 390E15B61D1A837C008FDEDD /* ProfileViewController.swift in Sources */, 367 | 3940EE671CE8409900293067 /* LoginViewController.swift in Sources */, 368 | 39176FC71D2BA808003C8DB2 /* GlobalVariable.swift in Sources */, 369 | 395A40AA1C81500D00ED11C5 /* ListTableViewCell.swift in Sources */, 370 | ); 371 | runOnlyForDeploymentPostprocessing = 0; 372 | }; 373 | /* End PBXSourcesBuildPhase section */ 374 | 375 | /* Begin PBXVariantGroup section */ 376 | 392767561C7AD9AF00A5DB93 /* Main.storyboard */ = { 377 | isa = PBXVariantGroup; 378 | children = ( 379 | 392767571C7AD9AF00A5DB93 /* Base */, 380 | ); 381 | name = Main.storyboard; 382 | path = .; 383 | sourceTree = ""; 384 | }; 385 | 3927675B1C7AD9AF00A5DB93 /* LaunchScreen.storyboard */ = { 386 | isa = PBXVariantGroup; 387 | children = ( 388 | 3927675C1C7AD9AF00A5DB93 /* Base */, 389 | ); 390 | name = LaunchScreen.storyboard; 391 | path = .; 392 | sourceTree = ""; 393 | }; 394 | /* End PBXVariantGroup section */ 395 | 396 | /* Begin XCBuildConfiguration section */ 397 | 392767751C7AD9AF00A5DB93 /* Debug */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ALWAYS_SEARCH_USER_PATHS = NO; 401 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 402 | CLANG_CXX_LIBRARY = "libc++"; 403 | CLANG_ENABLE_MODULES = YES; 404 | CLANG_ENABLE_OBJC_ARC = YES; 405 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 406 | CLANG_WARN_BOOL_CONVERSION = YES; 407 | CLANG_WARN_COMMA = YES; 408 | CLANG_WARN_CONSTANT_CONVERSION = YES; 409 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 410 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 411 | CLANG_WARN_EMPTY_BODY = YES; 412 | CLANG_WARN_ENUM_CONVERSION = YES; 413 | CLANG_WARN_INFINITE_RECURSION = YES; 414 | CLANG_WARN_INT_CONVERSION = YES; 415 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 416 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 417 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 418 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 419 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 420 | CLANG_WARN_STRICT_PROTOTYPES = YES; 421 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 422 | CLANG_WARN_UNREACHABLE_CODE = YES; 423 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 424 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Ryosei Shinoki (L6HQQDT63H)"; 425 | COPY_PHASE_STRIP = NO; 426 | DEBUG_INFORMATION_FORMAT = dwarf; 427 | ENABLE_STRICT_OBJC_MSGSEND = YES; 428 | ENABLE_TESTABILITY = YES; 429 | GCC_C_LANGUAGE_STANDARD = gnu99; 430 | GCC_DYNAMIC_NO_PIC = NO; 431 | GCC_NO_COMMON_BLOCKS = YES; 432 | GCC_OPTIMIZATION_LEVEL = 0; 433 | GCC_PREPROCESSOR_DEFINITIONS = ( 434 | "DEBUG=1", 435 | "$(inherited)", 436 | ); 437 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 438 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 439 | GCC_WARN_UNDECLARED_SELECTOR = YES; 440 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 441 | GCC_WARN_UNUSED_FUNCTION = YES; 442 | GCC_WARN_UNUSED_VARIABLE = YES; 443 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 444 | MTL_ENABLE_DEBUG_INFO = YES; 445 | ONLY_ACTIVE_ARCH = YES; 446 | SDKROOT = iphoneos; 447 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 448 | }; 449 | name = Debug; 450 | }; 451 | 392767761C7AD9AF00A5DB93 /* Release */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | ALWAYS_SEARCH_USER_PATHS = NO; 455 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 456 | CLANG_CXX_LIBRARY = "libc++"; 457 | CLANG_ENABLE_MODULES = YES; 458 | CLANG_ENABLE_OBJC_ARC = YES; 459 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 460 | CLANG_WARN_BOOL_CONVERSION = YES; 461 | CLANG_WARN_COMMA = YES; 462 | CLANG_WARN_CONSTANT_CONVERSION = YES; 463 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 464 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 465 | CLANG_WARN_EMPTY_BODY = YES; 466 | CLANG_WARN_ENUM_CONVERSION = YES; 467 | CLANG_WARN_INFINITE_RECURSION = YES; 468 | CLANG_WARN_INT_CONVERSION = YES; 469 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 470 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 471 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 472 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 473 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 474 | CLANG_WARN_STRICT_PROTOTYPES = YES; 475 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 476 | CLANG_WARN_UNREACHABLE_CODE = YES; 477 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 478 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 479 | COPY_PHASE_STRIP = NO; 480 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 481 | ENABLE_NS_ASSERTIONS = NO; 482 | ENABLE_STRICT_OBJC_MSGSEND = YES; 483 | GCC_C_LANGUAGE_STANDARD = gnu99; 484 | GCC_NO_COMMON_BLOCKS = YES; 485 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 486 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 487 | GCC_WARN_UNDECLARED_SELECTOR = YES; 488 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 489 | GCC_WARN_UNUSED_FUNCTION = YES; 490 | GCC_WARN_UNUSED_VARIABLE = YES; 491 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 492 | MTL_ENABLE_DEBUG_INFO = NO; 493 | SDKROOT = iphoneos; 494 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 495 | VALIDATE_PRODUCT = YES; 496 | }; 497 | name = Release; 498 | }; 499 | 392767781C7AD9AF00A5DB93 /* Debug */ = { 500 | isa = XCBuildConfiguration; 501 | baseConfigurationReference = 22D580FFB9D9CBC518BF511A /* Pods-SampleFirebase.debug.xcconfig */; 502 | buildSettings = { 503 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; 504 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 505 | CODE_SIGN_IDENTITY = "iPhone Developer: Ryosei Shinoki (L6HQQDT63H)"; 506 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 507 | DEVELOPMENT_TEAM = 3Q4MHTP27C; 508 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 509 | INFOPLIST_FILE = SampleFirebase/plists/Info.plist; 510 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 511 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 512 | PRODUCT_BUNDLE_IDENTIFIER = com.litech.SampleFirebase; 513 | PRODUCT_NAME = "$(TARGET_NAME)"; 514 | PROVISIONING_PROFILE = ""; 515 | PROVISIONING_PROFILE_SPECIFIER = ""; 516 | SWIFT_VERSION = 4.2; 517 | }; 518 | name = Debug; 519 | }; 520 | 392767791C7AD9AF00A5DB93 /* Release */ = { 521 | isa = XCBuildConfiguration; 522 | baseConfigurationReference = 6F2A0EB4F8895D1C0A421D8A /* Pods-SampleFirebase.release.xcconfig */; 523 | buildSettings = { 524 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; 525 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 526 | CODE_SIGN_IDENTITY = "iPhone Developer"; 527 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 528 | DEVELOPMENT_TEAM = 3Q4MHTP27C; 529 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 530 | INFOPLIST_FILE = SampleFirebase/plists/Info.plist; 531 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 532 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 533 | PRODUCT_BUNDLE_IDENTIFIER = com.litech.SampleFirebase; 534 | PRODUCT_NAME = "$(TARGET_NAME)"; 535 | PROVISIONING_PROFILE = ""; 536 | SWIFT_VERSION = 4.2; 537 | }; 538 | name = Release; 539 | }; 540 | /* End XCBuildConfiguration section */ 541 | 542 | /* Begin XCConfigurationList section */ 543 | 3927674A1C7AD9AF00A5DB93 /* Build configuration list for PBXProject "SampleFirebase" */ = { 544 | isa = XCConfigurationList; 545 | buildConfigurations = ( 546 | 392767751C7AD9AF00A5DB93 /* Debug */, 547 | 392767761C7AD9AF00A5DB93 /* Release */, 548 | ); 549 | defaultConfigurationIsVisible = 0; 550 | defaultConfigurationName = Release; 551 | }; 552 | 392767771C7AD9AF00A5DB93 /* Build configuration list for PBXNativeTarget "SampleFirebase" */ = { 553 | isa = XCConfigurationList; 554 | buildConfigurations = ( 555 | 392767781C7AD9AF00A5DB93 /* Debug */, 556 | 392767791C7AD9AF00A5DB93 /* Release */, 557 | ); 558 | defaultConfigurationIsVisible = 0; 559 | defaultConfigurationName = Release; 560 | }; 561 | /* End XCConfigurationList section */ 562 | }; 563 | rootObject = 392767471C7AD9AF00A5DB93 /* Project object */; 564 | } 565 | -------------------------------------------------------------------------------- /SampleFirebase.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SampleFirebase.xcodeproj/project.xcworkspace/xcuserdata/ShinokiRyosei.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s11y/Firebase-Sampler/3d86a0e959a062413bc13c04524da2b3996c3cd1/SampleFirebase.xcodeproj/project.xcworkspace/xcuserdata/ShinokiRyosei.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SampleFirebase.xcodeproj/xcuserdata/ShinokiRyosei.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SampleFirebase.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 3927674E1C7AD9AF00A5DB93 16 | 17 | primary 18 | 19 | 20 | 392767621C7AD9AF00A5DB93 21 | 22 | primary 23 | 24 | 25 | 3927676D1C7AD9AF00A5DB93 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SampleFirebase.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SampleFirebase.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SampleFirebase.xcworkspace/xcuserdata/ShinokiRyosei.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SampleFirebase/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SampleFirebase 4 | // 5 | // Created by ShinokiRyosei on 2016/02/22. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import FBSDKCoreKit 11 | import FBSDKLoginKit 12 | import Firebase 13 | import FirebaseDatabase 14 | import Fabric 15 | import TwitterKit 16 | 17 | @UIApplicationMain 18 | class AppDelegate: UIResponder, UIApplicationDelegate { 19 | 20 | var window: UIWindow? 21 | 22 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 23 | //プッシュ通知形式などを登録 24 | let notificationSetting = UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: nil) 25 | application.registerUserNotificationSettings(notificationSetting) 26 | application.registerForRemoteNotifications() 27 | 28 | FirebaseApp.configure() //Firebaseとコネクト 29 | Database.database().isPersistenceEnabled = true //ローカルにデータベースを構築する設定 30 | 31 | return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) 32 | } 33 | 34 | func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { 35 | return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation) 36 | } 37 | 38 | func applicationWillResignActive(_ application: UIApplication) { 39 | 40 | } 41 | 42 | func applicationDidEnterBackground(_ application: UIApplication) { 43 | 44 | } 45 | 46 | func applicationWillEnterForeground(_ application: UIApplication) { 47 | 48 | } 49 | 50 | func applicationDidBecomeActive(_ application: UIApplication) { 51 | FBSDKAppEvents.activateApp() 52 | } 53 | 54 | func applicationWillTerminate(_ application: UIApplication) { 55 | 56 | } 57 | 58 | 59 | //以下、プッシュ通知 60 | func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { 61 | UIApplication.shared.applicationIconBadgeNumber = UIApplication.shared.applicationIconBadgeNumber + 1 62 | 63 | completionHandler(UIBackgroundFetchResult.newData) 64 | } 65 | 66 | func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { 67 | print("error...\(error.localizedDescription)") 68 | } 69 | 70 | func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) { 71 | if notificationSettings.types != .none { 72 | application.registerForRemoteNotifications() 73 | } 74 | } 75 | 76 | // func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { 77 | // let tokenChars = UnsafePointer(deviceToken.bytes) 78 | // var tokenString = "" 79 | // 80 | // for i in 0 ..< deviceToken.count { 81 | // tokenString += String(format: "%02.2hhx", arguments: [tokenChars[i]]) 82 | // 83 | // FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.unknown) 84 | // } 85 | // } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /SampleFirebase/Controllers/ListViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ListViewController.swift 3 | // SampleFirebase 4 | // 5 | // Created by ShinokiRyosei on 2016/02/27. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Firebase //Firebaseをインポート 11 | 12 | class ListViewController: UIViewController { 13 | 14 | @IBOutlet weak var table: UITableView! //送信したデータを表示するTableView 15 | 16 | var contentArray: [DataSnapshot] = [] //Fetchしたデータを入れておく配列、この配列をTableViewで表示 17 | 18 | let ref = Database.database().reference() //Firebaseのルートを宣言しておく 19 | 20 | var selectedSnap: DataSnapshot? 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | //データを読み込むためのメソッド 25 | self.read() 26 | 27 | //TableViewCellをNib登録、カスタムクラスを作成 28 | table.register(UINib(nibName: "ListTableViewCell", bundle: nil), forCellReuseIdentifier: "ListCell") 29 | 30 | table.delegate = self //デリゲートをセット 31 | table.dataSource = self //デリゲートをセット 32 | } 33 | 34 | override func viewWillAppear(_ animated: Bool) { 35 | super.viewWillAppear(animated) 36 | 37 | //Cellの高さを調節 38 | table.estimatedRowHeight = 56 39 | table.rowHeight = UITableView.automaticDimension 40 | } 41 | 42 | override func viewDidDisappear(_ animated: Bool) { 43 | super.viewDidDisappear(animated) 44 | //画面が消えたときに、Firebaseのデータ読み取りのObserverを削除しておく 45 | ref.removeAllObservers() 46 | } 47 | 48 | //ViewControllerへの遷移のボタン 49 | @IBAction func didSelectAdd() { 50 | self.transition() 51 | } 52 | 53 | func read() { 54 | //FIRDataEventTypeを.Valueにすることにより、なにかしらの変化があった時に、実行 55 | //今回は、childでユーザーIDを指定することで、ユーザーが投稿したデータの一つ上のchildまで指定することになる 56 | ref.child((Auth.auth().currentUser?.uid)!).observe(.value, with: {(snapShots) in 57 | if snapShots.children.allObjects is [DataSnapshot] { 58 | print("snapShots.children...\(snapShots.childrenCount)") //いくつのデータがあるかプリント 59 | 60 | print("snapShot...\(snapShots)") //読み込んだデータをプリント 61 | 62 | self.reload(snapShots) 63 | } 64 | }) 65 | } 66 | 67 | //読み込んだデータは最初すべてのデータが一つにまとまっているので、それらを分割して、配列に入れる 68 | func reload(_ snap: DataSnapshot) { 69 | if snap.exists() { 70 | print(snap) 71 | //FIRDataSnapshotが存在するか確認 72 | contentArray.removeAll() 73 | //1つになっているFIRDataSnapshotを分割し、配列に入れる 74 | for item in snap.children { 75 | contentArray.append(item as! DataSnapshot) 76 | } 77 | // ローカルのデータベースを更新 78 | ref.child((Auth.auth().currentUser?.uid)!).keepSynced(true) 79 | //テーブルビューをリロード 80 | table.reloadData() 81 | } 82 | } 83 | 84 | func delete(at indexPath: IndexPath) { 85 | ref.child((Auth.auth().currentUser?.uid)!).child(contentArray[indexPath.row].key).removeValue() 86 | contentArray.remove(at: indexPath.row) 87 | } 88 | 89 | //timestampで保存されている投稿時間を年月日に表示形式を変換する 90 | func getDate(_ number: TimeInterval) -> String { 91 | let date = Date(timeIntervalSince1970: number) 92 | let formatter = DateFormatter() 93 | formatter.dateFormat = "yyyy/MM/dd HH:mm" 94 | return formatter.string(from: date) 95 | } 96 | //ViewControllerへの遷移 97 | func transition() { 98 | self.performSegue(withIdentifier: "toView", sender: self) 99 | } 100 | 101 | func didSelectRow(at indexPath: IndexPath) { 102 | //ルートからのchildをユーザーのIDに指定 103 | //ユーザーIDからのchildを選択されたCellのデータのIDに指定 104 | self.selectedSnap = contentArray[indexPath.row] 105 | self.transition() 106 | } 107 | 108 | 109 | 110 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 111 | if segue.identifier == "toView" { 112 | let view = segue.destination as! ViewController 113 | if let snap = self.selectedSnap { 114 | view.selectedSnap = snap 115 | } 116 | } 117 | } 118 | 119 | func query() { 120 | //dateをキーに順に並べる 121 | ///ref.child((FIRAuth.auth()?.currentUser?.uid)!).queryOrderedByChild("date").observeEventType(.Value, withBlock: { (snap) in 122 | // print(snap) 123 | //}) 124 | 125 | 126 | //"content"の中に、"MIB"という単語があるかを調べる 127 | ref.child((Auth.auth().currentUser?.uid)!).queryOrdered(byChild: "content").queryEqual(toValue: "MIB").observe(.value, with: { (snap) in 128 | print(snap) 129 | }) 130 | } 131 | 132 | } 133 | 134 | 135 | extension ListViewController: UITableViewDataSource { 136 | 137 | //セルの数 138 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 139 | 140 | return contentArray.count 141 | } 142 | 143 | //返すセルを決める 144 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 145 | //xibとカスタムクラスで作成したCellのインスタンスを作成 146 | let cell = table.dequeueReusableCell(withIdentifier: "ListCell") as! ListTableViewCell 147 | 148 | //配列の該当のデータをitemという定数に代入 149 | let item = contentArray[indexPath.row] 150 | //itemの中身を辞書型に変換 151 | let content = item.value as! Dictionary 152 | //contentという添字で保存していた投稿内容を表示 153 | cell.contentLabel.text = String(describing: content["content"]!) 154 | //dateという添字で保存していた投稿時間をtimeという定数に代入 155 | let time = content["date"] as! TimeInterval 156 | //getDate関数を使って、時間をtimestampから年月日に変換して表示 157 | cell.postDateLabel.text = self.getDate(time/1000) 158 | 159 | return cell 160 | } 161 | } 162 | 163 | 164 | extension ListViewController: UITableViewDelegate { 165 | 166 | //スワイプ削除のメソッド 167 | func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { 168 | //デリートボタンを追加 169 | if editingStyle == .delete { 170 | //選択されたCellのIndexPathを渡し、データをFirebase上から削除するためのメソッド 171 | self.delete(at: indexPath) 172 | //TableView上から削除 173 | table.deleteRows(at: [indexPath], with: .fade) 174 | } 175 | } 176 | 177 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 178 | self.didSelectRow(at: indexPath) 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /SampleFirebase/Controllers/LoginViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.swift 3 | // SampleFirebase 4 | // 5 | // Created by ShinokiRyosei on 2016/05/15. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Firebase //Firebaseをインポート 11 | import FirebaseAuth 12 | import FontAwesome_swift 13 | 14 | class LoginViewController: UIViewController { 15 | 16 | @IBOutlet var emailTextField: UITextField! // Emailを打つためのTextField 17 | 18 | @IBOutlet var passwordTextField: UITextField! //Passwordを打つためのTextField 19 | 20 | override func viewDidLoad() { 21 | super.viewDidLoad() 22 | 23 | emailTextField.delegate = self //デリゲートをセット 24 | passwordTextField.delegate = self //デリゲートをセット 25 | passwordTextField.isSecureTextEntry = true // 文字を非表示に 26 | } 27 | 28 | //ログインボタン 29 | @IBAction func didRegisterUser() { 30 | //ログインのためのメソッド 31 | login() 32 | } 33 | 34 | //ログインのためのメソッド 35 | func login() { 36 | //EmailとPasswordのTextFieldに文字がなければ、その後の処理をしない 37 | guard let email = emailTextField.text else { return } 38 | guard let password = passwordTextField.text else { return } 39 | 40 | //signInWithEmailでログイン 41 | //第一引数にEmail、第二引数にパスワードを取ります 42 | Auth.auth().signIn(withEmail: email, password: password, completion: { (authResults, error) in 43 | //エラーがないことを確認 44 | if error == nil { 45 | if let user = authResults?.user { 46 | // バリデーションが完了しているか確認。完了ならそのままログイン 47 | if user.isEmailVerified { 48 | // 完了済みなら、ListViewControllerに遷移 49 | self.transitionToView() 50 | }else { 51 | // 完了していない場合は、アラートを表示 52 | self.presentValidateAlert() 53 | } 54 | } 55 | }else { 56 | print("error...\(String(describing: error?.localizedDescription))") 57 | } 58 | }) 59 | } 60 | 61 | // メールのバリデーションが完了していない場合のアラートを表示 62 | func presentValidateAlert() { 63 | let alert = UIAlertController(title: "メール認証", message: "メール認証を行ってください", preferredStyle: .alert) 64 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) 65 | self.present(alert, animated: true, completion: nil) 66 | } 67 | 68 | //ログイン完了後に、ListViewControllerへの遷移のためのメソッド 69 | func transitionToView() { 70 | self.performSegue(withIdentifier: "toVC", sender: self) 71 | } 72 | } 73 | 74 | 75 | extension LoginViewController: UITextFieldDelegate { 76 | 77 | //Returnキーを押すと、キーボードを隠す 78 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 79 | textField.resignFirstResponder() 80 | return true 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /SampleFirebase/Controllers/ProfileViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProfileViewController.swift 3 | // SampleFirebase 4 | // 5 | // Created by ShinokiRyosei on 2016/06/22. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import FirebaseStorage 11 | import FirebaseAuth 12 | 13 | class ProfileViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { 14 | 15 | @IBOutlet var profileImageView: UIImageView! 16 | 17 | @IBOutlet var emailLabel: UILabel! 18 | 19 | var imagePicker: UIImagePickerController! 20 | 21 | let ref = Storage.storage().reference() 22 | 23 | var uploadImage: UIImage! 24 | 25 | override func viewDidLoad() { 26 | super.viewDidLoad() 27 | 28 | self.updateProfileImageView() 29 | imagePicker = UIImagePickerController() 30 | imagePicker.delegate = self 31 | } 32 | 33 | override func viewWillAppear(_ animated: Bool) { 34 | super.viewWillAppear(animated) 35 | self.read() 36 | } 37 | 38 | @IBAction func didSelectPlus() { 39 | self.presentActionSheet() 40 | } 41 | 42 | @IBAction func didSelectLogout() { 43 | self.logout() 44 | } 45 | 46 | func presentActionSheet() { 47 | let alert = UIAlertController(title: "写真を選択", message: "どちらから選択しますか?", preferredStyle: .actionSheet) 48 | let library = UIAlertAction(title: "ライブラリ", style: .default) { (action) in 49 | self.presentPhotoLibrary() 50 | } 51 | 52 | let camera = UIAlertAction(title: "カメラ", style: .default) { (action) in 53 | self.presentCamera() 54 | } 55 | 56 | alert.addAction(library) 57 | alert.addAction(camera) 58 | self.present(alert, animated: true, completion: nil) 59 | } 60 | 61 | func presentPhotoLibrary() { 62 | if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) { 63 | imagePicker.sourceType = .photoLibrary 64 | self.present(imagePicker, animated: true, completion: nil) 65 | } 66 | } 67 | 68 | func presentCamera() { 69 | if UIImagePickerController.isSourceTypeAvailable(.camera) { 70 | imagePicker.sourceType = .camera 71 | self.present(imagePicker, animated: true, completion: nil) 72 | } 73 | } 74 | 75 | func create(uploadImage image: UIImage) { 76 | let uploadData: Data = image.pngData()! 77 | ref.child((Auth.auth().currentUser?.uid)!).putData(uploadData, metadata: nil) { (data, error) in 78 | if error != nil { 79 | print("\(String(describing: error?.localizedDescription))") 80 | }else { 81 | 82 | } 83 | } 84 | } 85 | 86 | func read() { 87 | let gsReference = Storage.storage().reference(forURL: "gs://sampledrud.appspot.com") 88 | gsReference.child((Auth.auth().currentUser?.uid)!).getData(maxSize: 1 * 1028 * 1028) { (data, error) in 89 | if error != nil { 90 | print("\(String(describing: error?.localizedDescription))") 91 | }else { 92 | self.uploadImage = UIImage(data: data!) 93 | self.profileImageView.image = self.uploadImage 94 | } 95 | } 96 | } 97 | 98 | func changeEmail() { 99 | 100 | } 101 | 102 | func changePassword() { 103 | 104 | } 105 | 106 | func exitFromService() { 107 | 108 | } 109 | 110 | func logout() { 111 | do { 112 | //do-try-catchの中で、FIRAuth.auth()?.signOut()を呼ぶだけで、ログアウトが完了 113 | try Auth.auth().signOut() 114 | 115 | //先頭のNavigationControllerに遷移 116 | let storyboard = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "Nav") 117 | self.present(storyboard, animated: true, completion: nil) 118 | } catch let error as NSError { 119 | print("\(error.localizedDescription)") 120 | } 121 | 122 | } 123 | 124 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { 125 | 126 | if let image: UIImage = info[.originalImage] as? UIImage { 127 | 128 | uploadImage = image 129 | profileImageView.image = uploadImage 130 | self.create(uploadImage: uploadImage) 131 | } 132 | picker.dismiss(animated: true, completion: nil) 133 | } 134 | 135 | 136 | func updateProfileImageView() { 137 | profileImageView.layer.cornerRadius = profileImageView.layer.bounds.width/2 138 | profileImageView.layer.masksToBounds = true 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /SampleFirebase/Controllers/SignupViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SignupViewController.swift 3 | // SampleFirebase 4 | // 5 | // Created by ShinokiRyosei on 2016/05/19. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Firebase //Firebaseをインポート 11 | import FirebaseAuth 12 | import FBSDKLoginKit 13 | import TwitterKit 14 | import FontAwesome_swift 15 | 16 | class SignupViewController: UIViewController { 17 | 18 | @IBOutlet var emailTextField: UITextField! // Emailを打つためのTextField 19 | 20 | @IBOutlet var passwordTextField: UITextField! //Passwordを打つためのTextField 21 | 22 | @IBOutlet var facebookButton: UIButton! 23 | 24 | override func viewDidLoad() { 25 | super.viewDidLoad() 26 | 27 | emailTextField.delegate = self //デリゲートをセット 28 | passwordTextField.delegate = self //デリゲートをセット 29 | passwordTextField.isSecureTextEntry = true // 文字を非表示に 30 | 31 | self.layoutFacebookButton() 32 | } 33 | 34 | override func viewWillAppear(_ animated: Bool) { 35 | super.viewWillAppear(animated) 36 | //ログインしていれば、遷移 37 | //FIRAuthがユーザー認証のためのフレーム 38 | //checkUserVerifyでチェックして、ログイン済みなら画面遷移 39 | if self.checkUserVerify() { 40 | self.transitionToView() 41 | } 42 | } 43 | 44 | //サインアップボタン 45 | @IBAction func willSignup() { 46 | //サインアップのための関数 47 | signup() 48 | } 49 | //ログイン画面への遷移ボタン 50 | @IBAction func willTransitionToLogin() { 51 | transitionToLogin() 52 | } 53 | 54 | @IBAction func willLoginWithFacebook() { 55 | self.loginWithFacebook() 56 | } 57 | //Signupのためのメソッド 58 | func signup() { 59 | //emailTextFieldとpasswordTextFieldに文字がなければ、その後の処理をしない 60 | guard let email = emailTextField.text else { return } 61 | guard let password = passwordTextField.text else { return } 62 | //FIRAuth.auth()?.createUserWithEmailでサインアップ 63 | //第一引数にEmail、第二引数にパスワード 64 | Auth.auth().createUser(withEmail: email, password: password, completion: { (authResult, error) in 65 | //エラーなしなら、認証完了 66 | if error == nil{ 67 | // メールのバリデーションを行う 68 | authResult?.user.sendEmailVerification(completion: { (error) in 69 | if error == nil { 70 | // エラーがない場合にはそのままログイン画面に飛び、ログインしてもらう 71 | self.transitionToLogin() 72 | }else { 73 | print("\(String(describing: error?.localizedDescription))") 74 | } 75 | }) 76 | }else { 77 | 78 | print("\(String(describing: error?.localizedDescription))") 79 | } 80 | }) 81 | } 82 | // Facebookでユーザー認証するためのメソッド 83 | func loginWithFacebook() { 84 | let facebookLogin = FBSDKLoginManager() 85 | facebookLogin.logIn(withReadPermissions: ["email", "public_profile"], from: self) { (facebookResult, facebookError) in 86 | if facebookError != nil { 87 | print("\(String(describing: facebookError?.localizedDescription))") 88 | }else if (facebookResult?.isCancelled)! { 89 | print("facebook login was cancelled") 90 | }else { 91 | print("else is processed") 92 | let credial: AuthCredential = FacebookAuthProvider.credential(withAccessToken: FBSDKAccessToken.current().tokenString) 93 | print(FBSDKAccessToken.current().tokenString) 94 | print("credial...\(credial)") 95 | self.firebaseLoginWithCredial(credial) 96 | } 97 | } 98 | } 99 | 100 | @IBAction func loginWithTwitter(_ sender: TWTRLogInButton) { 101 | sender.logInCompletion = { (session: TWTRSession?, err: NSError?) in 102 | if let session = session { 103 | let credential = TwitterAuthProvider.credential(withToken: session.authToken, secret: session.authTokenSecret) 104 | Auth.auth().signInAndRetrieveData(with: credential, completion: { dataResult, error in 105 | if let err = error { 106 | print(err) 107 | return 108 | } 109 | }) 110 | } 111 | } as! TWTRLogInCompletion 112 | } 113 | 114 | func firebaseLoginWithCredial(_ credial: AuthCredential) { 115 | if Auth.auth().currentUser != nil { 116 | print("current user is not nil") 117 | Auth.auth().currentUser?.linkAndRetrieveData(with: credial, completion: { dataResult, error in 118 | if error != nil { 119 | print("error happens") 120 | print("error reason...\(String(describing: error))") 121 | }else { 122 | print("sign in with credential") 123 | Auth.auth().signInAndRetrieveData(with: credial, completion: { dataResult, error in 124 | if error != nil { 125 | print("\(String(describing: error?.localizedDescription))") 126 | }else { 127 | print("Logged in") 128 | } 129 | }) 130 | } 131 | }) 132 | }else { 133 | print("current user is nil") 134 | Auth.auth().signInAndRetrieveData(with: credial) { dataResult, error in 135 | if error != nil { 136 | print("\(String(describing: error))") 137 | }else { 138 | print("Logged in") 139 | } 140 | } 141 | } 142 | } 143 | // ログイン済みかどうかと、メールのバリデーションが完了しているか確認 144 | func checkUserVerify() -> Bool { 145 | guard let user = Auth.auth().currentUser else { return false } 146 | return user.isEmailVerified 147 | } 148 | 149 | //ログイン画面への遷移 150 | func transitionToLogin() { 151 | self.performSegue(withIdentifier: "toLogin", sender: self) 152 | } 153 | //ListViewControllerへの遷移 154 | func transitionToView() { 155 | self.performSegue(withIdentifier: "toView", sender: self) 156 | } 157 | 158 | func layoutFacebookButton() { 159 | facebookButton.setTitle(String.fontAwesomeIcon(name: .facebookSquare), for: .normal) 160 | facebookButton.titleLabel?.font = UIFont.fontAwesome(ofSize: 24, style: FontAwesomeStyle.solid) 161 | } 162 | } 163 | 164 | 165 | extension SignupViewController: UITextFieldDelegate { 166 | 167 | //Returnキーを押すと、キーボードを隠す 168 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 169 | textField.resignFirstResponder() 170 | return true 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /SampleFirebase/Controllers/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SampleFirebase 4 | // 5 | // Created by ShinokiRyosei on 2016/02/22. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Firebase //Firebaseをインポート 11 | 12 | class ViewController: UIViewController { 13 | 14 | let ref = Database.database().reference() //FirebaseDatabaseのルートを指定 15 | 16 | @IBOutlet var textField: UITextField! //投稿のためのTextField 17 | 18 | var isCreate = true //データの作成か更新かを判定、trueなら作成、falseなら更新 19 | 20 | var selectedSnap: DataSnapshot! //ListViewControllerからのデータの受け取りのための変数 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | 25 | textField.delegate = self //デリゲートをセット 26 | } 27 | 28 | override func viewWillAppear(_ animated: Bool) { 29 | super.viewWillAppear(animated) 30 | //selectedSnapがnilならその後の処理をしない 31 | guard let snap = self.selectedSnap else { return } 32 | 33 | //受け取ったselectedSnapを辞書型に変換 34 | let item = snap.value as! Dictionary 35 | //textFieldに受け取ったデータのcontentを表示 36 | textField.text = item["content"] as? String 37 | //isCreateをfalseにし、更新するためであることを明示 38 | isCreate = false 39 | } 40 | 41 | //投稿ボタン 42 | @IBAction func post(_ sender: UIButton) { 43 | if isCreate { 44 | //投稿のためのメソッド 45 | create() 46 | }else { 47 | //更新するためのメソッド 48 | update() 49 | } 50 | _ = self.navigationController?.popViewController(animated: true) 51 | 52 | } 53 | //データの送信のメソッド 54 | func create() { 55 | //textFieldになにも書かれてない場合は、その後の処理をしない 56 | guard let text = textField.text else { return } 57 | 58 | //ロートからログインしているユーザーのIDをchildにしてデータを作成 59 | //childByAutoId()でユーザーIDの下に、IDを自動生成してその中にデータを入れる 60 | //setValueでデータを送信する。第一引数に送信したいデータを辞書型で入れる 61 | //今回は記入内容と一緒にユーザーIDと時間を入れる 62 | //FIRServerValue.timestamp()で現在時間を取る 63 | self.ref.child((Auth.auth().currentUser?.uid)!).childByAutoId().setValue(["user": (Auth.auth().currentUser?.uid)!, "content": text, "date": ServerValue.timestamp()]) 64 | } 65 | 66 | //更新のためのメソッド 67 | func update() { 68 | //ルートからのchildをユーザーIDに指定 69 | //ユーザーIDからのchildを受け取ったデータのIDに指定 70 | //updateChildValueを使って更新 71 | ref.keepSynced(true) 72 | ref.child((Auth.auth().currentUser?.uid)!).child("\(self.selectedSnap.key)").updateChildValues(["user": (Auth.auth().currentUser?.uid)!,"content": self.textField.text!, "date": ServerValue.timestamp()]) 73 | } 74 | } 75 | 76 | 77 | extension ViewController: UITextFieldDelegate { 78 | 79 | //Returnキーを押すと、キーボードを隠す 80 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 81 | textField.resignFirstResponder() 82 | return true 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /SampleFirebase/CustomCell/ListTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ListTableViewCell.swift 3 | // SampleFirebase 4 | // 5 | // Created by ShinokiRyosei on 2016/02/27. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ListTableViewCell: UITableViewCell { 12 | 13 | @IBOutlet var contentLabel: UILabel! 14 | @IBOutlet var postDateLabel: UILabel! 15 | 16 | override func awakeFromNib() { 17 | super.awakeFromNib() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SampleFirebase/CustomCell/ListTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /SampleFirebase/Defaults-master/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s11y/Firebase-Sampler/3d86a0e959a062413bc13c04524da2b3996c3cd1/SampleFirebase/Defaults-master/Default-568h@2x.png -------------------------------------------------------------------------------- /SampleFirebase/Defaults-master/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s11y/Firebase-Sampler/3d86a0e959a062413bc13c04524da2b3996c3cd1/SampleFirebase/Defaults-master/Default-667h@2x.png -------------------------------------------------------------------------------- /SampleFirebase/Defaults-master/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s11y/Firebase-Sampler/3d86a0e959a062413bc13c04524da2b3996c3cd1/SampleFirebase/Defaults-master/Default-736h@3x.png -------------------------------------------------------------------------------- /SampleFirebase/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /SampleFirebase/Resources/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SampleFirebase/Resources/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 71 | 79 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 164 | 172 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | -------------------------------------------------------------------------------- /SampleFirebase/Utility.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utility.swift 3 | // SampleFirebase 4 | // 5 | // Created by ShinokiRyosei on 2016/07/23. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class Utility: NSObject { 12 | 13 | func showAlert(_ title: String, message: String, onViewController viewcontroller: UIViewController, buttonTitle button: String) { 14 | let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) 15 | let defaultAction = UIAlertAction(title: button, style: .default, handler: nil) 16 | alert.addAction(defaultAction) 17 | viewcontroller.present(alert, animated: true, completion: nil) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SampleFirebase/plists/GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AD_UNIT_ID_FOR_BANNER_TEST 6 | ca-app-pub-3940256099942544/2934735716 7 | AD_UNIT_ID_FOR_INTERSTITIAL_TEST 8 | ca-app-pub-3940256099942544/4411468910 9 | CLIENT_ID 10 | 753006925836-0kmh4c7ktrn1qdvg4u2p6i8dt9nu62e4.apps.googleusercontent.com 11 | REVERSED_CLIENT_ID 12 | com.googleusercontent.apps.753006925836-0kmh4c7ktrn1qdvg4u2p6i8dt9nu62e4 13 | API_KEY 14 | AIzaSyDmOuRBs6oSQqjolqHAAU79DqAsy5h1Nkg 15 | GCM_SENDER_ID 16 | 753006925836 17 | PLIST_VERSION 18 | 1 19 | BUNDLE_ID 20 | com.litech.SampleFirebase 21 | PROJECT_ID 22 | sampledrud 23 | STORAGE_BUCKET 24 | sampledrud.appspot.com 25 | IS_ADS_ENABLED 26 | 27 | IS_ANALYTICS_ENABLED 28 | 29 | IS_APPINVITE_ENABLED 30 | 31 | IS_GCM_ENABLED 32 | 33 | IS_SIGNIN_ENABLED 34 | 35 | GOOGLE_APP_ID 36 | 1:753006925836:ios:ddf18c1a35d0d0a0 37 | DATABASE_URL 38 | https://sampledrud.firebaseio.com 39 | 40 | -------------------------------------------------------------------------------- /SampleFirebase/plists/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | CFBundleURLTypes 36 | 37 | 38 | CFBundleURLSchemes 39 | 40 | fb524435181084570 41 | 42 | 43 | 44 | FacebookAppID 45 | 524435181084570 46 | FacebookDisplayName 47 | Firebase-Sampler 48 | LSApplicationQueriesSchemes 49 | 50 | fbapi 51 | fb-messenger-api 52 | fbauth2 53 | fbshareextension 54 | 55 | Fabric 56 | 57 | APIKey 58 | ffb0837d378dee94035af754a0b5138773605654 59 | Kits 60 | 61 | 62 | KitInfo 63 | 64 | consumerKey 65 | Oi3QBSGLMnaJy65nqaP3blKvS 66 | consumerSecret 67 | fVf3iUGFOJuluLPVJ3rb1uLpiHGA3loZaMZ2CEF410Urpt69V3 68 | 69 | KitName 70 | Twitter 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /SampleFirebaseTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SampleFirebaseTests/SampleFirebaseTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SampleFirebaseTests.swift 3 | // SampleFirebaseTests 4 | // 5 | // Created by ShinokiRyosei on 2016/02/22. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import SampleFirebase 11 | 12 | class SampleFirebaseTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /SampleFirebaseUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SampleFirebaseUITests/SampleFirebaseUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SampleFirebaseUITests.swift 3 | // SampleFirebaseUITests 4 | // 5 | // Created by ShinokiRyosei on 2016/02/22. 6 | // Copyright © 2016年 ShinokiRyosei. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SampleFirebaseUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------