Post

Replies

Boosts

Views

Activity

Quick Look Preview Extension
I'm trying to add a quick look preview extension to my app. But I can't find any reference on this On a earlier thread (https://developer.apple.com/forums/thread/704155) everyone seems to misunderstand my question. I MEAN THE QUICK LOOK YOU CAN TOGGLE IN FINDER THAT WILL SHOW YOU A PREVIEW OF A DOCUEMNT I don't want to add the tag QuickLook because that's not I want to do.
1
0
751
Feb ’24
Weird UI layout in SwiftUI .swipeActions
OK after I'm done with my last issue I came across some weird UI layout this is really a serious issue because afterward it looks like this😂 why? I've never met this kind of issue before in my same code before upgrading to Ventura code: List { ...                 Section {                     ForEach(data) { datum in                         TableRow(data: datum)                             .swipeActions {                             Button(role: .destructive) {                                 data.delete(datum)                             } label: {                                 Label("Delete", systemImage: "trash")                             }                         }                     }                 } ... }
1
0
620
Jun ’22
Export SwiftUI View
I know this is a strange and easy question. but JUST CANT FIND ANY REFERENCE aaaaaaaa I'm using SwiftUI and wants to export to PDF (best I can find Creating PDFs on MacOS without UIKit) export to image export to HTML export to everything possible etc BONUS print the page I can only find UIKit support and they are all outdated. AND IF POSSIBLE how to integrate ShareLink to share these(PDF, Image, HTML, etc) and write them onto disk using NSSavePane? even better how to do this on a of the platforms (I know I'm greedy😂) Thanks for any help🙏
0
0
848
Jun ’22
No idea
I have a structure TodoItem struct TodoItem: Codable, Hashable, Identifiable {     var id: UUID = UUID()     var item: String     var done: Bool = false } And I have an array of them, and I’d like to find out a way to calculate(in a array) how many are done; that is, myArray.count / itemsDone .count is easy, itemsDone can be achieved like this: extension Array where Element == TodoItem {     var itemsDone: Double {         var done: Double = 0         for i in self {             if i.done { done += 1 }         }         return done     } } but it didn’t. struct ContentView: View { @State var todos: [TodoItem] … ProgressView(value: todos.itemsDone / todos.count) // Error My Playground won’t let me copy the error(no idea why) and my family’s iPad is in Chinese so one is Chinese. I’ll try it on Xcode and see if I can find out more. will update with the error. EDiT nor will this work: ProgressView(value: todos.itemsDone, total: todos.count)
5
0
770
Jul ’22
Pass on Binding
I have this: struct TableRow: View { @Binding var data: TodoItem var body: some View { ... } } and this: List {     ForEach(data) { datum in         TableRow(data: ???) // <- what goes here?             .swipeActions {                 Button(role: .destructive) {                     data.delete(datum)                 } label: {                     Label("Delete", systemImage: "trash")                 }           }     } }
1
0
389
Jun ’22
I have a bug in Regex(maybe)
Feedback is filed. Trying to look into the Core.swift. diagnostics: Unsupported: 'Consumer for unconverted(_StringProcessing.DSLTree._AST.Atom(ast:  ---------------------------------------- CrashReportError: Fatal Error in Core.swift UtilityScript crashed due to fatalError in Core.swift at line 77. 'try!' expression unexpectedly raised an error: Unsupported: 'Consumer for unconverted(_StringProcessing.DSLTree._AST.Atom(ast:  ))' Process: UtilityScript[3141] Date/Time: 2022-07-02 03:56:17 +0000 Log File: <none> Application Specific Information:     dyld [         dyld config: DYLD_LIBRARY_PATH=/Users/wangkeshijian/Library/Developer/Xcode/DerivedData/UtilityScript-frovasvohxblobefzbrrwtvqtyuu/Build/Intermediates.noindex/Previews/UtilityScript/Products/Debug DYLD_FRAMEWORK_PATH=/Users/wangkeshijian/Library/Developer/Xcode/DerivedData/UtilityScript-frovasvohxblobefzbrrwtvqtyuu/Build/Intermediates.noindex/Previews/UtilityScript/Products/Debug     ]     libswiftCore.dylib [         _StringProcessing/Core.swift:77: Fatal error: 'try!' expression unexpectedly raised an error: Unsupported: 'Consumer for unconverted(_StringProcessing.DSLTree._AST.Atom(ast:  ))'         /AppleInternal/Library/BuildRoots/0cc5e7ad-e86f-11ec-ac50-3e2aa58faa6a/Library/Caches/com.apple.xbs/Sources/swiftlang_overlay_Platform/swift-experimental-string-processing/Sources/_StringProcessing/ConsumerInterface.swift:200     ]
1
0
865
Jul ’22
Strange cursor
macOS Ventura 13 beta 2 I'm coming over with a really strange issue with my cursor. It'd move toward the right-down by itself one pixel a time: right down right down It really freaked me out *laugh* I'll try attaching a video. FB submitted.
1
0
463
Jul ’22
Preview Crash (Shooed I fille a bug?)
I've just bought a M2 MacBook Pro, and my Timer app is giving me strange crash logs. Here's my code: struct ContentView: View {     @State var process: Any? = nil     @AppStorage("time") var time = 0     @State var timePassed = 0     @State var timer: Timer.TimerPublisher = Timer.publish(every: 1, on: .main, in: .common)     @State var cacheSecondsString: String  = String(UserDefaults.standard.integer(forKey: "time"))     @State var startTheTimer: Bool = false     var body: some View {         ZStack {             TimerView(time: $timePassed, total: $time).padding()             VStack {                 TextField("Time...", text: $cacheSecondsString)                     .font(.system(size: 35, weight: .light, design: .rounded))                     .multilineTextAlignment(.center)                     .onSubmit {                         time = Int(cacheSecondsString) ?? time                         cacheSecondsString = String(time)                     }                     .textFieldStyle(.plain)                     .padding()                     .fixedSize()                 Button {                     withAnimation {                         startTheTimer.toggle()                     }                 } label: {                     Label(startTheTimer ? "Stop" : "Start", systemImage: startTheTimer "stop.fill" : "clock").foregroundColor(.accentColor)                 }.buttonStyle(.plain).padding()             }         }.onChange(of: startTheTimer) { start in             if start {                 process = timer.connect()             } else {                 (process! as! Cancellable).cancel()             }         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()             .previewDevice("iPad Air (5th generation)")     } } When I sort of "run" the preview (pressing on the play.circle button on top of my preview and press the button the second to deactivate my timer, a crash dialog appear, the standard one macOS uses when any process crashed, but the preview didn't crash.
1
0
494
Aug ’22
Quick Look Preview Extension
I'm trying to add a quick look preview extension to my app. But I can't find any reference on this On a earlier thread (https://developer.apple.com/forums/thread/704155) everyone seems to misunderstand my question. I MEAN THE QUICK LOOK YOU CAN TOGGLE IN FINDER THAT WILL SHOW YOU A PREVIEW OF A DOCUEMNT I don't want to add the tag QuickLook because that's not I want to do.
Replies
1
Boosts
0
Views
751
Activity
Feb ’24
Beta Icon
How could I create an icon with an alpha/beta/dev badge? like this⬇️
Replies
0
Boosts
0
Views
517
Activity
May ’22
Can I sth else then structures in JSON?
How can I make it work? jsonString = """ ["foo", "bar"] """ let decoder = JSONDecoder var whatIWant = decoder.decode(Array<String>.self, jsonString) for i in whatIWant { print(i) } EDIT: Minor syntax mistake ignore this thread sorry everyone
Replies
1
Boosts
0
Views
395
Activity
May ’22
Weird UI layout in SwiftUI .swipeActions
OK after I'm done with my last issue I came across some weird UI layout this is really a serious issue because afterward it looks like this😂 why? I've never met this kind of issue before in my same code before upgrading to Ventura code: List { ...                 Section {                     ForEach(data) { datum in                         TableRow(data: datum)                             .swipeActions {                             Button(role: .destructive) {                                 data.delete(datum)                             } label: {                                 Label("Delete", systemImage: "trash")                             }                         }                     }                 } ... }
Replies
1
Boosts
0
Views
620
Activity
Jun ’22
Export SwiftUI View
I know this is a strange and easy question. but JUST CANT FIND ANY REFERENCE aaaaaaaa I'm using SwiftUI and wants to export to PDF (best I can find Creating PDFs on MacOS without UIKit) export to image export to HTML export to everything possible etc BONUS print the page I can only find UIKit support and they are all outdated. AND IF POSSIBLE how to integrate ShareLink to share these(PDF, Image, HTML, etc) and write them onto disk using NSSavePane? even better how to do this on a of the platforms (I know I'm greedy😂) Thanks for any help🙏
Replies
0
Boosts
0
Views
848
Activity
Jun ’22
No idea
I have a structure TodoItem struct TodoItem: Codable, Hashable, Identifiable {     var id: UUID = UUID()     var item: String     var done: Bool = false } And I have an array of them, and I’d like to find out a way to calculate(in a array) how many are done; that is, myArray.count / itemsDone .count is easy, itemsDone can be achieved like this: extension Array where Element == TodoItem {     var itemsDone: Double {         var done: Double = 0         for i in self {             if i.done { done += 1 }         }         return done     } } but it didn’t. struct ContentView: View { @State var todos: [TodoItem] … ProgressView(value: todos.itemsDone / todos.count) // Error My Playground won’t let me copy the error(no idea why) and my family’s iPad is in Chinese so one is Chinese. I’ll try it on Xcode and see if I can find out more. will update with the error. EDiT nor will this work: ProgressView(value: todos.itemsDone, total: todos.count)
Replies
5
Boosts
0
Views
770
Activity
Jul ’22
How can i monitor the decrease of an array’s count dynamically in SwiftUI?
⬆️ (for a bug fix on counting a array’s proportion of models that contains a certain value)
Replies
1
Boosts
0
Views
397
Activity
Jun ’22
Pass on Binding
I have this: struct TableRow: View { @Binding var data: TodoItem var body: some View { ... } } and this: List {     ForEach(data) { datum in         TableRow(data: ???) // <- what goes here?             .swipeActions {                 Button(role: .destructive) {                     data.delete(datum)                 } label: {                     Label("Delete", systemImage: "trash")                 }           }     } }
Replies
1
Boosts
0
Views
389
Activity
Jun ’22
TextField Source Editor
How can I achieve a source code editor in SwiftUI like Xcode, highlighting all the keywords and things like that. I've tried Regex + AttributedString... To hard... Anyone has any idea?
Replies
0
Boosts
0
Views
327
Activity
Jun ’22
How can i migrate a project from playground to Xcode or Xcode to playground(or, updating it using Xcode/playground)?
⬆️
Replies
1
Boosts
0
Views
837
Activity
Jun ’22
I have a bug in Regex(maybe)
Feedback is filed. Trying to look into the Core.swift. diagnostics: Unsupported: 'Consumer for unconverted(_StringProcessing.DSLTree._AST.Atom(ast:  ---------------------------------------- CrashReportError: Fatal Error in Core.swift UtilityScript crashed due to fatalError in Core.swift at line 77. 'try!' expression unexpectedly raised an error: Unsupported: 'Consumer for unconverted(_StringProcessing.DSLTree._AST.Atom(ast:  ))' Process: UtilityScript[3141] Date/Time: 2022-07-02 03:56:17 +0000 Log File: <none> Application Specific Information:     dyld [         dyld config: DYLD_LIBRARY_PATH=/Users/wangkeshijian/Library/Developer/Xcode/DerivedData/UtilityScript-frovasvohxblobefzbrrwtvqtyuu/Build/Intermediates.noindex/Previews/UtilityScript/Products/Debug DYLD_FRAMEWORK_PATH=/Users/wangkeshijian/Library/Developer/Xcode/DerivedData/UtilityScript-frovasvohxblobefzbrrwtvqtyuu/Build/Intermediates.noindex/Previews/UtilityScript/Products/Debug     ]     libswiftCore.dylib [         _StringProcessing/Core.swift:77: Fatal error: 'try!' expression unexpectedly raised an error: Unsupported: 'Consumer for unconverted(_StringProcessing.DSLTree._AST.Atom(ast:  ))'         /AppleInternal/Library/BuildRoots/0cc5e7ad-e86f-11ec-ac50-3e2aa58faa6a/Library/Caches/com.apple.xbs/Sources/swiftlang_overlay_Platform/swift-experimental-string-processing/Sources/_StringProcessing/ConsumerInterface.swift:200     ]
Replies
1
Boosts
0
Views
865
Activity
Jul ’22
Weather Bug (Should I submit FB?)
???
Replies
2
Boosts
0
Views
2.1k
Activity
Jul ’22
Strange cursor
macOS Ventura 13 beta 2 I'm coming over with a really strange issue with my cursor. It'd move toward the right-down by itself one pixel a time: right down right down It really freaked me out *laugh* I'll try attaching a video. FB submitted.
Replies
1
Boosts
0
Views
463
Activity
Jul ’22
Preview Crash (Shooed I fille a bug?)
I've just bought a M2 MacBook Pro, and my Timer app is giving me strange crash logs. Here's my code: struct ContentView: View {     @State var process: Any? = nil     @AppStorage("time") var time = 0     @State var timePassed = 0     @State var timer: Timer.TimerPublisher = Timer.publish(every: 1, on: .main, in: .common)     @State var cacheSecondsString: String  = String(UserDefaults.standard.integer(forKey: "time"))     @State var startTheTimer: Bool = false     var body: some View {         ZStack {             TimerView(time: $timePassed, total: $time).padding()             VStack {                 TextField("Time...", text: $cacheSecondsString)                     .font(.system(size: 35, weight: .light, design: .rounded))                     .multilineTextAlignment(.center)                     .onSubmit {                         time = Int(cacheSecondsString) ?? time                         cacheSecondsString = String(time)                     }                     .textFieldStyle(.plain)                     .padding()                     .fixedSize()                 Button {                     withAnimation {                         startTheTimer.toggle()                     }                 } label: {                     Label(startTheTimer ? "Stop" : "Start", systemImage: startTheTimer "stop.fill" : "clock").foregroundColor(.accentColor)                 }.buttonStyle(.plain).padding()             }         }.onChange(of: startTheTimer) { start in             if start {                 process = timer.connect()             } else {                 (process! as! Cancellable).cancel()             }         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()             .previewDevice("iPad Air (5th generation)")     } } When I sort of "run" the preview (pressing on the play.circle button on top of my preview and press the button the second to deactivate my timer, a crash dialog appear, the standard one macOS uses when any process crashed, but the preview didn't crash.
Replies
1
Boosts
0
Views
494
Activity
Aug ’22
Archive a iOS App
Because of some problems I turn again to Monterey in this thread, @ekimo says that to use ad hoc you need to archive a iOS App however: what did I did wrong?
Replies
0
Boosts
0
Views
296
Activity
Aug ’22