小编A.G*_*A.G的帖子

如何在swift中制作可扩展和可折叠的UITableView(父级和子级单元格)?

我希望有一个UITableView能够在点击单元格时展开和折叠的东西.

在此输入图像描述

当我加载页面时,我希望像这样展开Tableview,并通过单击标题来折叠和展开(请参阅日期).

任何帮助表示赞赏.

iphone xcode uitableview ios swift

3
推荐指数
1
解决办法
6050
查看次数

如何编写GraphQL查询

我有一个工作web graphql查询:

{
  me{
    ... on Student{

      profile {
        fullName
        emailId
        mobileNumber
        civilId
        address
        city
        state
        country
        zipCode
        userProfilePic
        userCategory
        createdAt
        updatedAt
      }

    }

  }
}
Run Code Online (Sandbox Code Playgroud)

它返回特定学生的个人资料详细信息.我使用变异记录并获取用户的令牌.

我想创建一个graphql文件(例如StudentProfile.graphql),以便使用Apollo客户端进行获取请求(类似于http.get).

我提出此请求以获取graphql查询.

func fetchStudentProfileDetails(){

        let tokenString = "Bearer " +  "....my token ..."

        print(tokenString)


        let newApollo: ApolloClient = {
            let configuration = URLSessionConfiguration.default
            // Add additional headers as needed
            configuration.httpAdditionalHeaders = ["Authorization": tokenString]

            let url = URL(string: "http://52.88.217.19/graphql")!

            return ApolloClient(networkTransport: HTTPNetworkTransport(url: url, configuration: configuration))
        }()



        newApollo.fetch(query: StudentProfileQuery()) { (result, error) in

            self.profileDetailsTextView.text = …
Run Code Online (Sandbox Code Playgroud)

authorization token facebook-graph-api swift graphql

1
推荐指数
1
解决办法
1511
查看次数