Meet the Swift Algorithms and Collections packages

RSS for tag

Discuss the WWDC21 session Meet the Swift Algorithms and Collections packages.

Posts under wwdc21-10256 tag

17 Posts

Post

Replies

Boosts

Views

Activity

Cryptographic Message Syntax Services for swift
In Swift, I need to create a CMS to input a web service. In Android we used 'spongycastle' https://www.bouncycastle.org/docs/pkixdocs1.4/org/bouncycastle/cms/CMSSignedData.html But I did not find a sample or solution for Swift or objective C. I also read Apple related documents https://developer.apple.com/documentation/security/cryptographic_message_syntax_services#1677736 , but still nothing special. Does anyone have experience working with a specific solution for Swift or objective C code to do this? thank you.
4
0
1.8k
Aug ’23
Uploading app using Swift Playground
Hi everyone, I really need help right now and feel really stuck. I created an app using Swift Playground on my ipad since i dont have a Mac. App store connect requires me to submit a build but i couldn'd find any way to do that without Xcode, altool or transporter, which are all apps for the MAC. One alternative I thought of was that I could find someone who has a MAC and use xcode to create a build. However, I am unsure whether the Swift app can be opened on xcode and if yes how to do it.
1
0
1.2k
May ’22
Expected declaration
Hello, I've been attempting to generate this code, but the last line returns an Expected declaration Error. class AboutMe { let firstName: String let lastName: String let age: Int init(firstName: String, lastName: String, age: Int){ self.firstName = firstName self.lastName = lastName self.age = age } var me: String { return "First Name: \(firstName), / Last Name: \(lastName), / Age: \(age)" } let myInfo = AboutMe(firstName: "NAME", lastName: "NAME", age: 10) print(myInfo) }
3
0
916
May ’22
Why is it so hard to simply play an audio file in SwiftUI?
I'm building an app using SwiftUI, and am perplexed at why it seems so difficult to simply play an audio file that is in my assets. One would think it possible to write some code like: play(sound: "(name).m4a") but this seems unsupported. You must write elaborate, verbose code. Anyone comment on why it doesn't 'just work'? I understand that much more complex audio code requires more, but it seems that simply playing a file could be supported.
1
0
956
Mar ’22
M1 architecture issue
I have an M1 MacBook Air! I tried installing 'keras' and 'tensorflow' packages in Rstudio. However I got an error. Then, I tried creating a virtual env to work in it and my script did run for a couple of hours but then it's again back to the same error: Error in py_initialize(config$python, config$libpython, config$pythonhome, : /Users/mansichandra/mambaforge/envs/walnut/lib/libpython3.8.dylib - dlopen(/Users/mansichandra/mambaforge/envs/walnut/lib/libpython3.8.dylib, 10): no suitable image found. Did find: /Users/mansichandra/mambaforge/envs/walnut/lib/libpython3.8.dylib: mach-o, but wrong architecture /Users/mansichandra/mambaforge/envs/walnut/lib/libpython3.8.dylib: mach-o, but wrong architecture How can this be resolved because I'm pretty sure it's an architecture problem!!
2
0
3.4k
Mar ’22
JSONDecoder().decode failing on struct containing array(s)
I am attempting to parse data received from my server. The data is defined by the struct PlayerList (A), and includes 3 arrays, one being the list of Player's ( B ), and the others, String's. When I try to parse the main Struct (PlayerList), I get the error, "typeMismatch(Swift.Array,Swift.DecodingError.Context(codingPath:..." when calling JSONDecoder().decode() (C). If I change the data to just be the array of Players, the main struct has no array fields, and JSON.decode() works just fine. An article I read suggested making that top level struct a 1 element array, which I did, but it didn't help. Suggestions are most welcome.
2
0
707
Nov ’21
Swift How do I change the button background color when the button is highlighted
How do I change the button background color when the button is highlighted with swift,then I also want to know . How can I make this background color last for a period of time instead of clicking it to disappear immediately? For example, I want it to disappear 2 seconds after clicking. I checked some information and couldn't find a way. All I can think of is to write a click event, then change the background color of the button and set a time to change it back
0
0
460
Oct ’21
saving picked image to coredata with MVVM SWIFTUI
I am trying to get a picked image and put it into my core data record... something like .sheet(isPresented: $isShowPicker,content: imagePickerSave(image: $image)       projectVM.projectImage = image! but something like this seems better but doesnt compile     imagePickerSave(image: $projectVM.projectImage) where projectVM is my coredata record So how do I assign the imagepicker value in the view to a projectimage field in the coredata record? I am using MVVM, what approach should i using please? Mark
0
0
528
Aug ’21
Cryptographic Message Syntax Services for swift
In Swift, I need to create a CMS to input a web service. In Android we used 'spongycastle' https://www.bouncycastle.org/docs/pkixdocs1.4/org/bouncycastle/cms/CMSSignedData.html But I did not find a sample or solution for Swift or objective C. I also read Apple related documents https://developer.apple.com/documentation/security/cryptographic_message_syntax_services#1677736 , but still nothing special. Does anyone have experience working with a specific solution for Swift or objective C code to do this? thank you.
Replies
4
Boosts
0
Views
1.8k
Activity
Aug ’23
Uploading app using Swift Playground
Hi everyone, I really need help right now and feel really stuck. I created an app using Swift Playground on my ipad since i dont have a Mac. App store connect requires me to submit a build but i couldn'd find any way to do that without Xcode, altool or transporter, which are all apps for the MAC. One alternative I thought of was that I could find someone who has a MAC and use xcode to create a build. However, I am unsure whether the Swift app can be opened on xcode and if yes how to do it.
Replies
1
Boosts
0
Views
1.2k
Activity
May ’22
Expected declaration
Hello, I've been attempting to generate this code, but the last line returns an Expected declaration Error. class AboutMe { let firstName: String let lastName: String let age: Int init(firstName: String, lastName: String, age: Int){ self.firstName = firstName self.lastName = lastName self.age = age } var me: String { return "First Name: \(firstName), / Last Name: \(lastName), / Age: \(age)" } let myInfo = AboutMe(firstName: "NAME", lastName: "NAME", age: 10) print(myInfo) }
Replies
3
Boosts
0
Views
916
Activity
May ’22
Regarding Motion and fitness permission
when my app asks for motion and fitness permission to the user and the user denied that. If they go to setting and turn on that setting then my app forcefully restarts again. my question is why app restart again when we change motion and fitness settings?
Replies
0
Boosts
0
Views
938
Activity
Apr ’22
Core Data
Hi, please how can I save an array of Uiimages into core data as one of my attributes? And is it possible preload data into core data?
Replies
0
Boosts
0
Views
1.4k
Activity
Apr ’22
Why is it so hard to simply play an audio file in SwiftUI?
I'm building an app using SwiftUI, and am perplexed at why it seems so difficult to simply play an audio file that is in my assets. One would think it possible to write some code like: play(sound: "(name).m4a") but this seems unsupported. You must write elaborate, verbose code. Anyone comment on why it doesn't 'just work'? I understand that much more complex audio code requires more, but it seems that simply playing a file could be supported.
Replies
1
Boosts
0
Views
956
Activity
Mar ’22
M1 architecture issue
I have an M1 MacBook Air! I tried installing 'keras' and 'tensorflow' packages in Rstudio. However I got an error. Then, I tried creating a virtual env to work in it and my script did run for a couple of hours but then it's again back to the same error: Error in py_initialize(config$python, config$libpython, config$pythonhome, : /Users/mansichandra/mambaforge/envs/walnut/lib/libpython3.8.dylib - dlopen(/Users/mansichandra/mambaforge/envs/walnut/lib/libpython3.8.dylib, 10): no suitable image found. Did find: /Users/mansichandra/mambaforge/envs/walnut/lib/libpython3.8.dylib: mach-o, but wrong architecture /Users/mansichandra/mambaforge/envs/walnut/lib/libpython3.8.dylib: mach-o, but wrong architecture How can this be resolved because I'm pretty sure it's an architecture problem!!
Replies
2
Boosts
0
Views
3.4k
Activity
Mar ’22
How do I change screens if you click on a VStack?
I know you can detect presses on a VStack with onTapGesture? But how do I change to a different view with it?
Replies
1
Boosts
0
Views
536
Activity
Jan ’22
list of dependencies of a swift project
Is there an equivalent file listing all dependencies of a Swift project like requirements.txt or environment.yml for python or package.json for javascript ?
Replies
1
Boosts
0
Views
882
Activity
Dec ’21
Write, Create and Read Excel Files in Swift without using third party library
Can anyone please guide me to create library which aid me to read and write app data in Excel file
Replies
2
Boosts
0
Views
2.3k
Activity
Dec ’21
JSONDecoder().decode failing on struct containing array(s)
I am attempting to parse data received from my server. The data is defined by the struct PlayerList (A), and includes 3 arrays, one being the list of Player's ( B ), and the others, String's. When I try to parse the main Struct (PlayerList), I get the error, "typeMismatch(Swift.Array,Swift.DecodingError.Context(codingPath:..." when calling JSONDecoder().decode() (C). If I change the data to just be the array of Players, the main struct has no array fields, and JSON.decode() works just fine. An article I read suggested making that top level struct a 1 element array, which I did, but it didn't help. Suggestions are most welcome.
Replies
2
Boosts
0
Views
707
Activity
Nov ’21
UILabel with superscript text
How can make a UILabel look this way in Xcode12?
Replies
2
Boosts
0
Views
2.7k
Activity
Nov ’21
Show Blank Appicon on iPhone12&iOS15
My colleague's phone is the iPhone 12, just upgraded to iOS 15, the app icon does not show. But other colleagues' cell phones are good, how to solve this problem?
Replies
2
Boosts
0
Views
769
Activity
Oct ’21
Swift How do I change the button background color when the button is highlighted
How do I change the button background color when the button is highlighted with swift,then I also want to know . How can I make this background color last for a period of time instead of clicking it to disappear immediately? For example, I want it to disappear 2 seconds after clicking. I checked some information and couldn't find a way. All I can think of is to write a click event, then change the background color of the button and set a time to change it back
Replies
0
Boosts
0
Views
460
Activity
Oct ’21
saving picked image to coredata with MVVM SWIFTUI
I am trying to get a picked image and put it into my core data record... something like .sheet(isPresented: $isShowPicker,content: imagePickerSave(image: $image)       projectVM.projectImage = image! but something like this seems better but doesnt compile     imagePickerSave(image: $projectVM.projectImage) where projectVM is my coredata record So how do I assign the imagepicker value in the view to a projectimage field in the coredata record? I am using MVVM, what approach should i using please? Mark
Replies
0
Boosts
0
Views
528
Activity
Aug ’21
Third-Party Subscribe for Swift Playgrounds
Is the Thrid-Party Subscribe free?
Replies
1
Boosts
0
Views
531
Activity
Aug ’21
wifi list in app
How to get wifi list in app with flutter?
Replies
0
Boosts
0
Views
463
Activity
Aug ’21