2016-05-27 6 views
2

私はSwiftでiOSアプリケーションを開発中です。facebok sdk loginを既にダウンロードしていましたが、私はそれに精通しています。一方、私はカスタムテーブルビューを作成する必要がありますので、私はこれを行うためにEurekaフレームワークをダウンロードしました。eureka swiftフォームにfacebook sdk loginを追加するには?

新しいアカウントを登録するためにユーザーに情報を要求するテーブルがありますが、問題はテーブルビューの上部にFacebookログインオプションが必要だということですが、これを達成する方法はありません。プログラムでユーレカのテーブルビューを追加すると、ストーリーボードに表示されるので、方法を見つけてログインボタンを追加する必要があります。誰もこれを行う方法を知っていますか?おかげ

は、ここに私のテーブルコードです:

private func addLoginForm() { 
     self.form +++ Section() 
      <<< TextRow() { $0.placeholder = "Name" 
       $0.tag = "name" 
      } 
      +++ Section() 
      <<< TextRow() { $0.placeholder = "Email" 
       $0.tag = "email" 
      } 
      +++ Section() 
      <<< PhoneRow() {$0.placeholder = "Phone" 
       $0.tag = "phone" 
      } 
      +++ Section() 
      <<< PasswordRow() { $0.placeholder = "Password" 
       $0.tag = "password" 
      } 
      +++ Section() 
      <<< ButtonRow() { 
       $0.title = "Login" 
       $0.onCellSelection { cell, row in 

        self.evaluate() 

        }.cellSetup({ (cell, row) in 
         cell.backgroundColor = UIColor(red: 114.0/255, green: 3.0/255, blue: 194.0/255, alpha: 1.0) 
         cell.tintColor = UIColor.whiteColor() 
         row.cell.height = { 
          return 65 
         } 
        }) 
     } 

    } 

答えて

1

このように私は、フォーム内のセクションのヘッダーでFacebookのログインを追加することで解決策を設立:必要にも

form +++ Section() 
      { 
       var header = HeaderFooterView<FBSDKLoginButton>(HeaderFooterProvider.Class) 
       header.onSetupView = { (view: FBSDKLoginButton, section: Section) -> Void in 
        view.readPermissions = ["public_profile","email","user_friends"] 
        view.delegate = self 
       } 

       $0.header = header 
     } 

FBSDKLoginKitとFBSDKCoreKitをインポートします

0

セクションの代わりにテーブルビューにヘッダーを追加できます。

override func viewDidLoad() { 
    super.viewDidLoad() 

    ... 

    if let tableView = tableView { 
     tableView.tableHeaderView = yourFBHeaderView 
    } 

    ... 
} 
関連する問題