小编max*_*ell的帖子

Apple Developer帐户错误:生成的最大证书数(开发)

添加新的开发人员证书需要做什么?

在Apple Developer帐户中,我想创建一个新的开发证书.

但我收到错误:" 生成的最大证书数 ".

以前我有10个开发证书,并想再添加一个.

我删掉了:

  • 4个旧开发证书(现有6个有效开发证书);
  • 2生产证书(现有1个有效生产证书);

  • 旧应用ID;

  • 旧设备;

  • 旧钥匙.

此外,所有配置文件(开发和分发)都具有活动状态.

但我仍然得到这个错误.

在此输入图像描述

ios apple-developer

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

如何快速制作可扩展的集合视图?

在此处输入图片说明

我有 2 个集合视图部分,当第一次加载这个 VC 时,两个部分(室内和室外)最初只会显示 3 个项目。

但是在用户按下“更多”按钮后,室内或室外的每个部分都会展开并显示所有可用的项目,如下图

在此处输入图片说明

我试图制作代码,但似乎有时它可以扩展,有时它不扩展(仍然显示 3 个项目)。

这是主控制器中的代码:

class FacilitiesVC: UIViewController {

    @IBOutlet weak var collectionView: UICollectionView!

    var facilitiesCategoryData = [[String:Any]]()
    var outdoorFacilitiesIsExpanded = false
    var indoorFacilitiesIsExpanded = false

    override func viewDidLoad() {
        super.viewDidLoad()

        getIndoorOutdoorFacilitiesData()
    }

}

extension FacilitiesVC {

    // MARK: - Helper Methods

    func getIndoorOutdoorFacilitiesData() {

        let facilitiesData = FacilitiesCategoryLibrary.fetchFacilitiesCategory()
        var indoorFacilities = [FacilitiesCategory]()
        var outdoorFacilities = [FacilitiesCategory]()

        // distinguishing between indoor and outdoor data
        for facData in facilitiesData {

            if facData.type == "Indoor …
Run Code Online (Sandbox Code Playgroud)

ios uicollectionview uicollectionviewcell swift

5
推荐指数
0
解决办法
5181
查看次数

如果用户第一次拒绝 swift 如何再次请求许可(RunTime)

我拒绝位置权限第一次应用程序启动,当用户单击位置按钮时,我想显示请求权限的警报对话框。

这是我的 sudo 代码

单击位置按钮

if dont have location permission {
   ask for permission
} else {
  get current location
}
Run Code Online (Sandbox Code Playgroud)

这是我的代码。请检查我代码中的注释。希望您理解我的问题。提前致谢。

@IBAction func getCurrentLocationButtonClick(_ sender: UIButton) {
///////////How to implement that sudo code/////////////////////////////
///////////Why This method is not calling for second time /////////////
//        locationManager.desiredAccuracy = kCLLocationAccuracyBest
//        locationManager.requestWhenInUseAuthorization()
//        locationManager.requestLocation()
/////////////////////////////////////////////////////
          locationManager.startUpdatingLocation()   
   }


override func viewWillAppear(_ animated: Bool) {
    locationManager.delegate = self
    locationManager.desiredAccuracy = kCLLocationAccuracyBest
    locationManager.requestWhenInUseAuthorization()
    locationManager.requestLocation()
}

extension NotificationCenterViewController : CLLocationManagerDelegate {

    func locationManager(_ manager: CLLocationManager, didChangeAuthorization …
Run Code Online (Sandbox Code Playgroud)

user-permissions ios swift

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

在 Firestore for Swift 中按时间戳传递和过滤项目

我试图Timestamp在我的应用程序中通过 Firestore中的今天日期。我得到今天的日期是这样的

formatter.dateFormat = "MMMM d, yyyy"
let result = formatter.string(from: date)
print("Today date is \(result)")
let startDate = result + " " + "07:00:00"
let endDate = result + " " + "23:00:00"
Run Code Online (Sandbox Code Playgroud)

我必须从早上 7 点到下午 23:00 传递今天的日期,并将这些日期存储在startDate和 中endDate。现在我在这样的Firestore查询中传递这些时间:-

self.db.collection("Locations").whereField("userid", isEqualTo: "\(selectedUserID)").whereField("createddatetime", isGreaterThanOrEqualTo: "\(startDate)").whereField("createddatetime", isLessThanOrEqualTo: "\(endDate)").getDocuments()
Run Code Online (Sandbox Code Playgroud)

但我的快照没有得到任何结果。我怎样才能做到这一点。请帮忙?

在此处输入图片说明

ios firebase swift google-cloud-firestore

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

在随机颜色数组中替换属性 CGColorGetComponents(在 swift 4 中不可用)

如何在这个随机颜色数组中替换 CGColorGetComponents 属性(在 swift 4 中不可用)?

fileprivate func hexyColor(color: UIColor) -> String {

    let components = CGColorGetComponents(color.cgColor)
    var hex = ""

    for i in 0...2 {
        let int = Int(components[i] * 255)
        let hexCode = String(int, radix: 16)

        if hexCode.count < 2 {
            hex = hex + "0\(hexCode)"
        } else {
            hex = hex + hexCode
        }
    }

    return "#\(hex)"
}
Run Code Online (Sandbox Code Playgroud)

谢谢提前回复:)

ios swift

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

删除用户从 Swift 4 的文件目录中选择的文件?

嗨,我有以下代码可以作为函数从文件目录中删除文件。但是当传递单个文件名字符串时它似乎工作了几次但是当我将它用作函数并传递文件名时,它不起作用。代码如下。我在 Swift 4.1 中使用 Xcode 9.2

//USAGE
//User Clicks on a delete button and that will present an Alert Dialog with a list of files and user clicks on the file he/she would like to delete
/////////////////////////////////////////////////////
@IBAction func deleteConfigAction(_ sender: Any) {
    //---
    //---

    //Another function is called to list all files in the files directory and then store it into a string variable
    var file1: String = "Empty"

    //Calling another function to load all files present
    var userFilesPresent …
Run Code Online (Sandbox Code Playgroud)

file ios swift

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

以编程方式对 UIButton 进行 1:1 宽度:高度约束

如何在 swift 中以编程方式将 UIButton 上的宽高比约束设置为 1:1 的宽:高比?此图像在 Interface Builder 中显示了我想通过代码实现的目标。

我在 Interface Builder 中的要求

aspect-ratio ios autolayout swift

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

当 UICollectionViewCell 不在视野中时尝试暂停视频

我正在使用从 Firebase 加载的 URL 填充集合视图。但是当我退出视图或向上滚动集合视图时,我无法让视频暂停。当我使用导航控制器返回时,我仍然可以听到后台播放的视频。然后当我再次进入视图时,视频开始播放,但第一个从未完成。

这是我的视图控制器。有小费吗?谢谢你!我还是 Swift 的新手,所以请原谅我的无知。

import UIKit
import AVKit
import AVFoundation
import Firebase
import FirebaseDatabase
import SDWebImage

class ComedyViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {

    var avPlayer = AVPlayer()
    var avPlayerLayer = AVPlayerLayer()

    @IBOutlet weak var comedyCollectionView: UICollectionView!

    var comedyVideoArray = [ComedyModel]()

    var comedyDBRef: DatabaseReference! {
        return Database.database().reference().child("comedy")
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        loadComedyDB()
    }


    func loadComedyDB() {
        comedyDBRef.observe(DataEventType.value, with: { (snapshot) in

            if snapshot.childrenCount > 0 {
                self.comedyVideoArray.removeAll()

                for comedyData in snapshot.children.allObjects as! [DataSnapshot] {
                    let comedyObject …
Run Code Online (Sandbox Code Playgroud)

xcode avplayer uicollectionview uicollectionviewcell swift

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

在Swift 4中同步3个线程

我有3个线程从互联网上下载数据.

func thread1() {
    DispatchQueue.global().async {
        // do something from json
    }
}

func thread2() {
    DispatchQueue.global().async {
        // do something from json
    }
}

func thread3() {
    DispatchQueue.global().async {
        // download img
    }
}


func finishFunction() {
    print("Finish")
}
Run Code Online (Sandbox Code Playgroud)

我想在完成线程1,2和3后启动finishFunction函数.如何做到这一点?

grand-central-dispatch ios swift

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