Post

Replies

Boosts

Views

Activity

Reply to How can I pass a function pointer in Swift?
I would have to pass a pointer to the function buttonAction Seems you may be mistaking something. In target-action pattern of UIKit, you need to pass a pair of target and action. And the action is not a function pointer, but is a selector. So, you can write something like this: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() makeButton(vControl: self, action: #selector(self.buttonAction(sender:))) } @objc func buttonAction(sender: UIButton!) { print("Button tapped") } } func makeButton(vControl: ViewController, action: Selector) { let button = UIButton(frame: CGRect(x: 100, y: 100, width: 100, height: 50)) button.backgroundColor = .green button.setTitle("Test Button", for: .normal) button.addTarget(vControl, action: action, for: .touchUpInside) vControl.view.addSubview(button) }
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to Xcode Build Alerts
Xcode 13 uses system notifications for events like Build Succeeds or Build Failed. You can customize the Notification through System Preferences: And Xcode Preferences: Though, I have not succeeded to show Notifications as Banners till now.
Oct ’21
Reply to App crashes at WKWebView's 'load' method
Thanks for showing more context. But you have not shown that you are using such many pods. As you may know, many pods are well-known as to cause problems at each time iOS or Xcode updates. I have tried with the exact code and URL you have shown, which causes no issues both on iOS 15 simulator or on an actual device of iOS 15.0.1. class ViewController: UIViewController { @IBOutlet weak var webView: WKWebView! let stringUrl = "https://developer.apple.com/" override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. if let url = URL(string: stringUrl) { webView.load(URLRequest(url: url)) } } } So, it is very likely that some still hidden parts of your code or any of your pods are causing the issue. Are you sure you are using WKWebView in a usual manner? For example, calling load(_:) while the webView is not visible may be considered to be an illegal usage by the recent iOS.
Oct ’21
Reply to Betting App
As far as I know, no one who are responsible about reviewing and approval process of App Store has never answered here in the dev forums. So, you may need to consider all the description in the App Store Review Guidelines. About gambling apps, it has a strict description about legality: 5.3 Gaming, Gambling, and Lotteries (There are other descriptions about gambling or real money, you may need to check all of them by yourself.) 5. Legal 5.3 Gaming, Gambling, and Lotteries Gaming, gambling, and lotteries can be tricky to manage and tend to be one of the most regulated offerings on the App Store. Only include this functionality if you’ve fully vetted your legal obligations everywhere you make your app available and are prepared for extra time during the review process. Some things to keep in mind: 5.3.1 Sweepstakes and contests must be sponsored by the developer of the app. 5.3.2 Official rules for sweepstakes, contests, and raffles must be presented in the app and make clear that Apple is not a sponsor or involved in the activity in any manner. 5.3.3 Apps may not use in-app purchase to purchase credit or currency for use in conjunction with real money gaming of any kind, and may not enable people to purchase lottery or raffle tickets or initiate fund transfers in the app. 5.3.4 Apps that offer real money gaming (e.g. sports betting, poker, casino games, horse racing) or lotteries must have necessary licensing and permissions in the locations where the app is used, must be geo-restricted to those locations, and must be free on the App Store. Illegal gambling aids, including card counters, are not permitted on the App Store.Lottery apps must have consideration, chance, and a prize. If you think you can fulfill all the requirements shown in the documentations or announcements of Apple's, there might be a chance your app would be approved for App Store.
Oct ’21