Hello, always when i try to run my app and press the button then i get this error. Can somebody help me? Thanks
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBOutlet weak var calculatorLabel: UILabel!
var isTypingNumber = false
@IBAction func numberTapped(_ sender: UIButton) {
let number = sender.currentTitle!
if isTypingNumber {
calculatorLabel.text = calculatorLabel.text! + number
} else {
calculatorLabel.text = number
isTypingNumber = true
}
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hey I wanted to ask you how I can implement the Swipe back Gesture in Swift. So I want that the user start at the Home View Controller and then he can tap on the "happy number Rechner"-Button and then the calculator View Controller appears. Like the same way with the transitions in the Settings App of iOS. And if you swipe left the Home View should appear again. Thank you!
import UIKit
let alert = UIAlertController(title: "Warning",
message: "Your number is too big.",
preferredStyle: .alert)
class ViewController: UIViewController {
// Verbindungen zu Storyboard
@IBAction func rechnerEntry(_ sender: Any) {
}
@IBOutlet weak var resultLabel: UILabel!
@IBOutlet weak var buttons: UIButton!
@IBAction func clear(_ sender: Any) {
calculatorLabel.text = ""
number = 0
}
override func viewDidLoad() {
super.viewDidLoad()
buttons.backgroundColor = UIColor.gray
}
// Aufführung happyFuncs
func happyFunc(number: Int) -> Int {
var myNum = number
var sum = 0
while myNum > 0 {
let x = myNum % 10
sum += (x * x)
myNum /= 10
}
return sum
}
// happyCheckerFunc
func happyChecker(_ x: Int) -> Bool {
var alreadychecked: Set<Int> = Set()
var result = happyFunc(number: x)
while !alreadychecked.contains(result) {
if result == 1 {
resultLabel.text = "your number is a happy number"
return true
}
alreadychecked.insert(result)
result = happyFunc(number: result)
}
resultLabel.text = "your number is a unhappy number"
return false
}
// Eingabe Werte
var number = 0
var x = 0
@IBOutlet weak var calculatorLabel: UILabel!
var isTypingNumber = false
// Nummer getippt
@IBAction func numberTapped(_ sender: UIButton) {
let number = sender.currentTitle ?? (sender.titleLabel?.text ?? "0")
if isTypingNumber {
calculatorLabel.text = calculatorLabel.text! + number
} else {
calculatorLabel.text = number
isTypingNumber = true
}
}
// Überprüfung happy?
@IBAction func happycheck(_ sender: UIButton) {
number = Int(calculatorLabel.text!)!
x = number
if x > 9999999999999999 {
alert.addAction(UIAlertAction(title: "OK",
style: .default,
handler: { _ in
print("OK tap")
}))
present(alert, animated: true, completion: nil)
}
func happyFunc(number: Int) -> Int {
var myNum = number
var sum = 0
while myNum > 0 {
let x = myNum % 10
sum += (x * x)
myNum /= 10
}
return sum
}
func happyChecker(_ x: Int) -> Bool {
var alreadychecked: Set<Int> = Set()
var result = happyFunc(number: x)
while !alreadychecked.contains(result) {
if result == 1 {
resultLabel.text = "your number is a happy number"
return true
}
alreadychecked.insert(result)
result = happyFunc(number: result)
}
resultLabel.text = "your number is a unhappy number"
return false
}
happyChecker(x)
}
}
Hello,
I want that if the Switch is on that the Segmented Control is disabled. How can I do that? Thank you!
So here in storyboard everything is fine and looks good.
But if i run the App the 0-Button keeps looking ugly like that. I don't know why but the button does not display the corner radius and the color is different.
Thank you for helping!
// view controller of the Result Screen (second picture)
import ConfettiSwiftUI
import SwiftUI
import UIKit
class happyResultVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@State private var counter: Int = 0
func confetti() {
counter += 1
ConfettiCannon(counter: $counter)
}
if viewController.viewIfLoaded?.window != nil {
confetti()
}
So I'm trying that if the "happy number"-Result Screen opens that a animation of confetti appears. For that I am using ConfettiSwiftUI. Do you know if this is possible and how?
Thank you!
First I am formatting the whole Label:
let page3View = UIView(frame: CGRect(x: 0, y: self.view.bounds.height*2, width: self.view.bounds.width, height: self.view.bounds.height))
scrollView.addSubview(page3View)
label3.frame = CGRect(x: 0, y: 0, width: self.view.bounds.width - 40, height: 400)
label3.colorString(text: "Für das erste Beispiel nutzen wir die Zahl 13.",
coloredText: "13")
label3.center = self.view.center
label3.font = UIFont.systemFont(ofSize: 34, weight: .semibold)
label3.numberOfLines = 4
label3.textAlignment = .center
page3View.addSubview(label3)
For the red "13" I am using the following extension:
extension UILabel {
func colorString(text: String?, coloredText: String?, color: UIColor? = .red) {
let attributedString = NSMutableAttributedString(string: text!)
let range = (text! as NSString).range(of: coloredText!)
attributedString.setAttributes([NSAttributedString.Key.foregroundColor: color!],
range: range)
self.attributedText = attributedString
}}
But now I want that the "13" is in the "Snell Roundhand Bold" Font.
It should look like:
Hello,
I am trying to upload my App to TestFlight. I've uploaded it and after the Processing part of Apple this error occurred:
Fehlende Compliance = Lack of compliance
And if I tap the blue button next to it I can choose between this:
What type of encryption algorithm does your app use?
Encryption algorithms that are proprietary or not accepted as standard by international standards bodies (e.g., IEEE, IETF, ITU, etc.).
Standard encryption algorithms instead of, or in addition to, the encryption used or accessible in Apple's operating system
Both of the above algorithms
None of the above algorithms
also there is the message that I have to upload the Export compliance documentation.
I literally don't know that all of this stuff is. So if you can help me thank you.
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
iOS
App Review
App Store
App Store Connect
Hello,
I want a segmented Control or a button that changes the Appearance from light mode to dark mode. But I don't want that I have to change every label or button etc. with a if / else statement. Is that possible? Thank you!
Hello,
I tried to distribute the following app to the App Store.
My App Concept:
It‘s a „happy numbers“ app. The main function is that you can enter a number and check if the entered number is either happy or unhappy. There is an additional „Explanation“- part where the happy numbers are explained. My app is available in german and english and for light and dark mode. A info button exists too. There the user can find this text: „This app was developed as part of a project at the Oberschule an der Ronzelenstraße in Bremen. If you want to learn more about this topic, here are links to the topic and a mathematical proof that every number is either happy or unhappy.“
So as I said in the text this App is a project for a project work in my school. Its not a huge app but it has one main function and that’s my plan. It is not planned to add more features because the app has exactly this one purpose, the happy number checker, nothing more and nothing less.
—
Now I got rejected in the App Review Process because of 4.2.0. App Store Review Guidelines.
The App Store Review sent me this message:
„Hello,
Thank you for your response.
Regarding 4.2, we discovered that the usefulness of your app is limited by the minimal amount of content or features it includes.
To resolve this issue, it would be appropriate to review your app concept and incorporate different content and features that are in compliance with the App Store Review Guidelines by referring to the App Store Review Guidelines, as well as the iOS Developer Program License Agreement (PLA), and the Human Interface Guidelines.
Additionally, if you are considering implementing any of the following functionality, we recommend reviewing all associated reference material and other resources available on Apple Developer for any additional requirements.
Apple Developer
Apple Copyright and Trademark Guidelines
Game Center
iCloud
In-App Purchase
You may also choose to post a question in the Apple Developer Forums.
We look forward to reviewing your resubmitted app.
Best regards,
App Store Review“
Thats the latest message of them. They and I messaged multiple times but the messages are similar to that message. Now is my thing. How I explained I don’t want to add more features. If you could help me I would be so thankful.
julius
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
iOS
App Review
App Store
App Store Connect