Post

Replies

Boosts

Views

Activity

Reply to Weak references
I believe weak references are not required when using self inside the dispatch queues. I do not understand what you mean. There may be many cases you should use weak even when using self inside the dispatch queues.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to How should I learn Swift?
One thing you should know is that there is not the best for everyone. You should better spend some time and try as much resource as you can touch. Some Apple's resource would be a good starting point, but it is not clear if it would be the best for you. And forget about Roblox LuaU, experiences of other languages may not always get things better when learning a new language.
Aug ’21
Reply to Text - Formatted HTML
Is there a way to use Text directly, but keeping break lines and lists? Can you show some examples of some formatted text? Generally, Text is not intended to show HTML content. Using the new feature AttributedString of iOS 15, you may be able to show some limited sets of HTML as formatted text, but depends on the actual contents you want to show.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Implementing a RandomNumberGenerator for testing
Seems the value generated by next() needs to be large enough in the current implementation of random(in:using:). (randomElement(using:) may very probably be using the similar method internally.) class MockRandomNumberGenerator: RandomNumberGenerator { var current: UInt64 = 0 func next() -> UInt64 { defer { current += 1 } return current &* (UInt64.max/10) } } The header doc says Each call to next() must produce a uniform and independent random value. You may need to generate seemingly uniform values to make future algorithms of random(in:using:) work as you expect.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Initializer 'init(_:)' requires that 'Villager' conform to 'StringProtocol'
Your code causes bunch of errors -- Cannot find type 'Villager' in scope, Expected '}' in struct or Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project. And if I fix one error, many other errors generated. Please show enough code which can reproduce the error Initializer 'init(_:)' requires that 'Villager' conform to 'StringProtocol'. Please do not forget to use Code Block when you show some code.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Where does the swift student challenge
want to try for next year swift student challenge The details of Swift Student Challenge would change the next year. You can check the details of this year and keep an eye on the coming announcements for WWDC 22. News and Updates would be one place you should better watch. And if you have not yet enabled emails from Apple on your Developer Account, you should better enable it. Installing Developer app will bring you many news as fast as many other sources.
Aug ’21
Reply to Code Example Does not work
As far as I tried, it compiles without any problems with Xcode 12.5.1 on Intel Mac mini (2018). So, it might be the M1 Mac only issue and you should better send a bug report soon. The official documentation of systemThickMaterial does not have any descriptions about unavailability on M1 Mac.
Aug ’21
Reply to Swift can't find the Entity Core Data
I have downloaded your GitHub project and tried to build it, and showed Succeeded. Some classes (not structs) representing Core Data entity are generated dynamically. So, some errors might be shown until the classes are acknowledged by the editing support. You can try Building the project (Cmd+B) even when some errors are still shown.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to How to scroll UICollectionView cell automatically according to the time of day
Thanks for the additional explanation. I believe I understand far better. You may need to call scrollToItem at launch time and at every minute (every second?) the next bus is changed.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Weak references
I believe weak references are not required when using self inside the dispatch queues. I do not understand what you mean. There may be many cases you should use weak even when using self inside the dispatch queues.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Can't create ARView for non AR application
The doc says that init(frame:cameraMode:automaticallyConfigureSession:) is only available for iOS 13+, no macOS. Are you sure you made the project for iOS?
Replies
Boosts
Views
Activity
Aug ’21
Reply to How should I learn Swift?
One thing you should know is that there is not the best for everyone. You should better spend some time and try as much resource as you can touch. Some Apple's resource would be a good starting point, but it is not clear if it would be the best for you. And forget about Roblox LuaU, experiences of other languages may not always get things better when learning a new language.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Text - Formatted HTML
Is there a way to use Text directly, but keeping break lines and lists? Can you show some examples of some formatted text? Generally, Text is not intended to show HTML content. Using the new feature AttributedString of iOS 15, you may be able to show some limited sets of HTML as formatted text, but depends on the actual contents you want to show.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to How to scroll UICollectionView cell automatically according to the time of day
Can you clarify what you mean by even if the application is closed? When the application is closed, no collection view is shown so scroll automatically does not make sense.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Implementing a RandomNumberGenerator for testing
Seems the value generated by next() needs to be large enough in the current implementation of random(in:using:). (randomElement(using:) may very probably be using the similar method internally.) class MockRandomNumberGenerator: RandomNumberGenerator { var current: UInt64 = 0 func next() -> UInt64 { defer { current += 1 } return current &* (UInt64.max/10) } } The header doc says Each call to next() must produce a uniform and independent random value. You may need to generate seemingly uniform values to make future algorithms of random(in:using:) work as you expect.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Initializer 'init(_:)' requires that 'Villager' conform to 'StringProtocol'
Your code causes bunch of errors -- Cannot find type 'Villager' in scope, Expected '}' in struct or Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project. And if I fix one error, many other errors generated. Please show enough code which can reproduce the error Initializer 'init(_:)' requires that 'Villager' conform to 'StringProtocol'. Please do not forget to use Code Block when you show some code.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Where does the swift student challenge
want to try for next year swift student challenge The details of Swift Student Challenge would change the next year. You can check the details of this year and keep an eye on the coming announcements for WWDC 22. News and Updates would be one place you should better watch. And if you have not yet enabled emails from Apple on your Developer Account, you should better enable it. Installing Developer app will bring you many news as fast as many other sources.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Can swift be more like this?
What do you mean by like this? As far as I see the code-like things in your post, Swift would never be like this, in my opinion.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Core Bluetooth Characteristic Value mismatch between iOS and macOS
One possible interpretation is that the device is showing a different value only when connected to iOS device. What does that characteristic mean?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Code Example Does not work
As far as I tried, it compiles without any problems with Xcode 12.5.1 on Intel Mac mini (2018). So, it might be the M1 Mac only issue and you should better send a bug report soon. The official documentation of systemThickMaterial does not have any descriptions about unavailability on M1 Mac.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Swift can't find the Entity Core Data
I have downloaded your GitHub project and tried to build it, and showed Succeeded. Some classes (not structs) representing Core Data entity are generated dynamically. So, some errors might be shown until the classes are acknowledged by the editing support. You can try Building the project (Cmd+B) even when some errors are still shown.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to looping picker
Apple's platforms do not support such looping picker. You can find some articles or repositories implementing pseudo infinite picker searching with "ios infinite picker".
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Editor placeholder in source file
Sometimes, Xcode might pick us some old errors and show them. Please try Clean Build Folder or restarting Xcode or restarting your mac and see what happens.
Replies
Boosts
Views
Activity
Aug ’21