Hi,
How do I show a share sheet in a child view. UIApplication.shared.windows.first?.rootViewController?.present(activityVC, animated: true, completion: nil) doesn't work.
Thanks in advanced!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
I am trying to use mapkit auto completion in my SwiftUI project and whenever I run the view, I get a bunch of errors such as:
2022-02-12 19:45:59.095462-0800 Pickt[64199:2417526] [SearchAttribution] No matching attribution source found for com.timeout
2022-02-12 19:45:59.095595-0800 Pickt[64199:2417526] [SearchAttribution] No matching attribution source found for com.theculturetrip
2022-02-12 19:45:59.095822-0800 Pickt[64199:2417526] [SearchAttribution] No matching attribution source found for com.redtri
2022-02-12 19:45:59.095909-0800 Pickt[64199:2417526] [SearchAttribution] No matching attribution source found for com.fotospot
2022-02-12 19:45:59.096549-0800 Pickt[64199:2417526] [SearchAttribution] Error loading attribution info for identifier com.timeout from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for com.timeout" UserInfo={NSDebugDescription=No matching attribution source found for com.timeout}
2022-02-12 19:45:59.096679-0800 Pickt[64199:2417526] [SearchAttribution] Error loading attribution info for identifier com.theculturetrip from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for com.theculturetrip" UserInfo={NSDebugDescription=No matching attribution source found for com.theculturetrip}
2022-02-12 19:45:59.096761-0800 Pickt[64199:2417526] [SearchAttribution] Error loading attribution info for identifier com.redtri from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for com.redtri" UserInfo={NSDebugDescription=No matching attribution source found for com.redtri}
2022-02-12 19:45:59.096837-0800 Pickt[64199:2417526] [SearchAttribution] Error loading attribution info for identifier com.fotospot from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for com.fotospot" UserInfo={NSDebugDescription=No matching attribution source found for com.fotospot}
and then the auto complete breaks until I dismiss and reload the view.
Full Code
I am in desperate need of help, thx in advance!
Hey,
Whenever I upload a build to App Store Connect, I get an Invalid Binary with the error:
One or more dynamic libraries that are referenced by your app are not present in the dylib search path
Here are all the frameworks in my project:
And here is my Cocoapods:
Thx in advanced!
Edit
Here is my output from running otool -L:
otool -L Output
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
Frameworks
Swift Packages
Hi All,
I am trying to add an UIHostingViewController to my UIViewController, to cover the screen. Unfortunately, I keep getting this error (Thread 1: "NSLayoutConstraint for <_TtGC7SwiftUI19UIHostingControllerV5Pickt10ViewRouter_: 0x7fa32a37c3f0>: Constraint items must each be a view or layout guide.") from my code:
let controller = UIHostingController(rootView: ViewRouter(join: join, create: create, showPicker: showPicker, setMock: setMock))
controller.view.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(controller.view)
view.addConstraints([
NSLayoutConstraint(item: controller,
attribute: .top,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: .top,
multiplier: 1,
constant: 0),
NSLayoutConstraint(item: controller,
attribute: .leading,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: .leading,
multiplier: 1,
constant: 0),
NSLayoutConstraint(item: controller,
attribute: .trailing,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: .trailing,
multiplier: 1,
constant: 0),
NSLayoutConstraint(item: controller,
attribute: .bottom,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: .bottom,
multiplier: 1,
constant: 0)
])
Hi,
I keep getting the error "Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols" on lines 99 and 100, here is the code:
import SwiftUI
import Intents
import UserNotifications
class Riddles {
static var text = String()
static var isWednesday = Bool()
static func largeWidget() {
Riddles.checkWeekday()
let userDefaults = UserDefaults(suiteName: "group.SetRiddle")
if Riddles.isWednesday == false {
if userDefaults?.value(forKey: "currentRiddle") != nil || userDefaults?.value(forKey: "previousRiddle") != nil {
Riddles.text = "\(UserDefaults(suiteName: "group.SetRiddle")?.value(forKey: "currentRiddle") as! String) \n\n\(UserDefaults(suiteName: "group.SetRiddle")?.value(forKey: "previousRiddle") as! String)"
}else{
Riddles.text = "Please open app to display riddle"
}
}else {
Riddles.text = "Please open app to display riddle"
}
}
static func mediumWidget() {
Riddles.checkWeekday()
let userDefaults = UserDefaults(suiteName: "group.SetRiddle")
if Riddles.isWednesday == true {
if userDefaults?.value(forKey: "currentRiddle") != nil {
Riddles.text = UserDefaults(suiteName: "group.SetRiddle")?.value(forKey: "currentRiddle") as! String
}else{
Riddles.text = "Please open app to display riddle"
}
}else {
Riddles.text = "Please open app to display riddle"
}
}
static func checkWeekday() {
let today = Date()
let calendar = Calendar(identifier: .gregorian)
let components = calendar.dateComponents([.weekday], from: today)
if components.weekday == 4 {
Riddles.isWednesday = true
}else {
Riddles.isWednesday = false
}
}
}
struct Provider: IntentTimelineProvider {
func placeholder(in context: Context) -> SimpleEntry {
SimpleEntry(date: Date(), text: "", configuration: ConfigurationIntent())
}
func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) {
let entry = SimpleEntry(date: Date(), text: "", configuration: configuration)
completion(entry)
}
func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
var entries: [SimpleEntry] = []
// Generate a timeline consisting of five entries an hour apart, starting from the current date.
let currentDate = Date()
for hourOffset in 0 ..< 5 {
let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)!
let entry = SimpleEntry(date: entryDate, text: "", configuration: configuration)
entries.append(entry)
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
}
struct SimpleEntry: TimelineEntry {
let date: Date
let text: String
let configuration: ConfigurationIntent
}
struct RiddleWidgetEntryView : View {
var entry: Provider.Entry
@Environment(\.widgetFamily) var family: WidgetFamily
@ViewBuilder
var body: some View {
switch family {
case .systemMedium: Riddles.mediumWidget()
case .systemLarge: Riddles.largeWidget()
}
ZStack {
Text(Riddles.text)
.foregroundColor(.black)
.font(Font.system(size: 20))
}
}
}
@main
struct RiddleWidget: Widget {
let kind: String = "RiddleWidget"
var body: some WidgetConfiguration {
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in
RiddleWidgetEntryView(entry: entry)
}
.configurationDisplayName("My Widget")
.description("This is an example widget.")
.supportedFamilies([.systemMedium, .systemLarge])
}
}
struct RiddleWidget_Previews: PreviewProvider {
static var previews: some View {
RiddleWidgetEntryView(entry: SimpleEntry(date: Date(), text: "This Weeks Riddle: ", configuration: ConfigurationIntent()))
.previewContext(WidgetPreviewContext(family: .systemSmall))
}
}
Thanks in advance
Hi, I have this code in a designated file called IAP Manager to handle all things related to in-app purchases.
import StoreKit
import Foundation
final class IAPManager: NSObject, SKProductsRequestDelegate, SKPaymentTransactionObserver {
static let shared = IAPManager()
private var products = [SKProduct]()
private var productBeingPurchased: SKProduct?
enum Product: String, CaseIterable {
case removeAds = "JokesRUs.RemoveAds"
}
public func fetchProducts() {
let request = SKProductsRequest(productIdentifiers: Set(Product.allCases.compactMap(({ $0.rawValue }))))
request.delegate = self
request.start()
}
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
products = response.products
}
func request(_ request: SKRequest, didFailWithError error: Error) {
guard request is SKProductsRequest else {
return
}
print("Product fetch request failed")
}
public func purchase(product: Product) {
guard SKPaymentQueue.canMakePayments() else {
return
}
guard let storeKitProduct = products.first(where: { $0.productIdentifier == product.rawValue }) else {
return
}
let paymentRequest = SKPayment(product: storeKitProduct)
SKPaymentQueue.default().add(self)
SKPaymentQueue.default().add(paymentRequest)
}
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
transactions.forEach({ transaction in
switch transaction.transactionState {
case .purchasing:
//No op
break
case .purchased:
handlePurchase(transaction.payment.productIdentifier)
break
case .failed:
break
case .restored:
break
case .deferred:
break
@unknown default:
break
}
})
}
private func handlePurchase(_ id: String) {
UserDefaults.standard.setValue(true, forKey: id)
print(id)
}
}
And then I have this code to call it:
IAPManager.shared.purchase(product: .removeAds)
The problem is I can't figure out how to get the price for the location from StoreKit.
Thanks in advance!
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
Swift
StoreKit
Xcode
Hi,
I am using Mac in Cloud, because I don't have a mac, and I am unable to load my app on to my phone, therefore I am trying to use testflight. The problem is my app is unpublished and the buttons for in-app aren't working. Any ideas.
Thanks in advance!
PS: The in-app purchase status is waiting for upload.
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
In-App Purchase
iPhone
StoreKit Test
TestFlight
Hi,
In my app, I do all the validation locally and the documentation doesn't explain how to restore purchases when the app restores everything locally. Here is my code. Thank you for your time.
Code - https://developer.apple.com/forums/content/attachment/f7000d1d-5901-4758-8b91-d4f2b3dc5a3f
Hi,
Whenever I am extracting Xcode 13 beta 1, it gets stuck at the end. Has anyone else had this issue?
Hi,
How do I save to the iCloud Keychain from my app? I can't seem to find anything anywhere that isn't the equivalent of UserDefaults.
I just launched my app on the App Store and the in app purchases aren't working. Any Ideas?
Code
Thanks in advanced!
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
StoreKit
Swift
I have this one view that seems to be much lower than it is supposed to be. Can someone please tell me what I am doing wrong?
Code
Here is a link to the image(I was having trouble uploading directly) https://drive.google.com/file/d/16HIhPCrXtybbh9JD7QRbc5ccBVj9Dhiq/view?usp=sharing
Hi!
I am trying to record the AVAudioPlayer's output so I can play it back to the user. I can't find anything online, but I am sure that it's possible, maybe with AVEngine? Please help asap!