Post

Replies

Boosts

Views

Activity

Reply to How can this be resolved - load_eligibility_plist: Failed to open //private/var/db/os_eligibility/eligibility.plist: Operation not permitted(1)
class CSGView: UIView { var line0: UIBezierPath? var line1: UIBezierPath? var circleLayerLeft: CAShapeLayer? var circleLayerRight: CAShapeLayer? override func draw(_ rect: CGRect) { line0?.stroke() line1?.stroke() } } private func addConstraints() { let CSChoicesYpos = Int.random(in: 1...3) if CSChoicesYpos == 1 { CSGCardChoicesY1 = 100 CSGCardChoicesY2 = 200 CSGCardChoicesY3 = 300 } if CSChoicesYpos == 2 { CSGCardChoicesY1 = 200 CSGCardChoicesY2 = 300 CSGCardChoicesY3 = 100 } if CSChoicesYpos == 3 { CSGCardChoicesY1 = 300 CSGCardChoicesY2 = 100 CSGCardChoicesY3 = 200 } let CSgraphicuserinterface = CSGView() let CSChoiceACard = CSGView() let CSChoiceBCard = CSGView() let CSChoiceCCard = CSGView() CSgraphicuserinterface.translatesAutoresizingMaskIntoConstraints = false CSgraphicuserinterface.addSubview(CSChoiceACard) CSgraphicuserinterface.addSubview(CSChoiceBCard) CSgraphicuserinterface.addSubview(CSChoiceCCard) CSgraphicuserinterface.addSubview(CSCorrectButton) CSgraphicuserinterface.addSubview(CSInCorrectButton1) CSgraphicuserinterface.addSubview(CSInCorrectButton2) constraints.append(CSgraphicuserinterface.widthAnchor.constraint(equalTo: view.safeAreaLayoutGuide.widthAnchor)) constraints.append(CSgraphicuserinterface.heightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.heightAnchor)) constraints.append(CSgraphicuserinterface.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor)) constraints.append(CSgraphicuserinterface.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor)) constraints.append(CSChoiceACard.widthAnchor.constraint(equalToConstant: 180)) constraints.append(CSChoiceACard.heightAnchor.constraint(equalToConstant: 79)) constraints.append(CSChoiceACard.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor, constant: CGFloat(CSGCardChoicesX))) constraints.append(CSChoiceACard.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor, constant: CGFloat(CSGCardChoicesY1))) constraints.append(CSChoiceBCard.widthAnchor.constraint(equalToConstant: 180)) constraints.append(CSChoiceBCard.heightAnchor.constraint(equalToConstant: 79)) constraints.append(CSChoiceBCard.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor, constant: CGFloat(CSGCardChoicesX))) constraints.append(CSChoiceBCard.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor, constant: CGFloat(CSGCardChoicesY2))) constraints.append(CSChoiceCCard.widthAnchor.constraint(equalToConstant: 180)) constraints.append(CSChoiceCCard.heightAnchor.constraint(equalToConstant: 79)) constraints.append(CSChoiceCCard.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor, constant: CGFloat(CSGCardChoicesX))) constraints.append(CSChoiceCCard.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor, constant: CGFloat(CSGCardChoicesY3))) constraints.append(CSCorrectButton.widthAnchor.constraint(equalToConstant: 184)) constraints.append(CSCorrectButton.heightAnchor.constraint(equalToConstant: 83)) constraints.append(CSCorrectButton.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor, constant: CGFloat(CSGCardChoicesX))) constraints.append(CSCorrectButton.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor, constant: CGFloat(CSGCardChoicesY1))) constraints.append(CSInCorrectButton1.widthAnchor.constraint(equalToConstant: 184)) constraints.append(CSInCorrectButton1.heightAnchor.constraint(equalToConstant: 83)) constraints.append(CSInCorrectButton1.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor, constant: CGFloat(CSGCardChoicesX))) constraints.append(CSInCorrectButton1.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor, constant: CGFloat(CSGCardChoicesY2))) constraints.append(CSInCorrectButton2.widthAnchor.constraint(equalToConstant: 184)) constraints.append(CSInCorrectButton2.heightAnchor.constraint(equalToConstant: 83)) constraints.append(CSInCorrectButton2.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor, constant: CGFloat(CSGCardChoicesX))) constraints.append(CSInCorrectButton2.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor, constant: CGFloat(CSGCardChoicesY3))) NSLayoutConstraint.activate(constraints) The buttons have been tested using TopAnchor, BottomAnchor, LeadingAnchor, TrailingAnchor as well.
Topic: Design SubTopic: General
Apr ’25
Reply to How can this be resolved - load_eligibility_plist: Failed to open //private/var/db/os_eligibility/eligibility.plist: Operation not permitted(1)
I do not call viewWillNeedLayout after change. I will provide a code snippet as soon as I can tonight. I constrain to the safearealayout guide because it’s can change depending on which layout you use….ie..iPhone 16max, iPhone 16 Pro, iPhone SE…etc. Even when I use Auto Layout Constraints, my button behavior reacts the same.
Topic: Design SubTopic: General
Apr ’25