Post

Replies

Boosts

Views

Activity

Comment on How to set instance of a property of the same class type
I have decided to convert a lib into Swift since it's the one library that works for me in Android. And the Clipper libraries do not work with the data that I am using. The instance of "this" is the class itself. e.g. this class https://github.com/ChristianLutz/gpcj/blob/master/gpcj/src/main/java/com/seisw/util/geom/Clip.java line 1536. Currently, I added a setter method instead as a workaround. But i dont think it will work in this scenario PolySimple.java (please use same url) line 333
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’23
Comment on Incorrect rounding off result
i didnt know what the use for the roundingmode was. i just chose whatever option in the list that popped up in xcode
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Comment on How To Loop Video In SwiftUI
@dave450 were you able to show the player controls as well? I read the comments and while they say it does loop, the problem is showing the player controls
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’23
Comment on How To Loop Video In SwiftUI
Thank you. will check this out
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’23
Comment on Replace substring using regex in a string
I can confirm yours works too. I used it and checked.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Comment on Replace substring using regex in a string
Hi @claude31 it is solved now. my function works. The problem was my isCelsius parameter kept returning false, hence why I thought nothing was changed. But i think my conversion between farehnheit and celsius has issues regarding the roundOff() function. 75.2 returns 76, instead of 75.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Comment on Replace substring using regex in a string
@claude31 what was not working was, nothing was replaced. But, after checking your code, i think the mistake might have been mine. My isCelsius parameter returned is always false, hence why i thought nothing was replaced.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Comment on How to register background tasks in a pure SwiftUI app
I am also trying this in a SwiftUI app. However, while .register() does indeed get called, it does not get inside its closure. I have no clue why. Followed the docs, enabled background options, added permission background identifiers and then the code. Those should be it only right?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’23
Comment on Why does date only object always has 16:00:00 time? instead of 00:00:00
I made an extension of Date instead to convert utc timezone to user's timezone. Just my assumption, they probably did it this way since ios is meant for front end use, so Date() with UTC is the best option to start with. Then users can just convert it to their local timezone.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Comment on Why does date only object always has 16:00:00 time? instead of 00:00:00
there is no other way without having to set a timezone? i thought the default would be the users current timezone. i just want a date at 12 midnight. will try converting to string then date. may be overkill but if it works, im ok with it
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Comment on How to set instance of a property of the same class type
I think for the second scenario, i will just have to add a new parameter to the function to pass the instance if there is no other possible way.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Comment on How to set instance of a property of the same class type
I have decided to convert a lib into Swift since it's the one library that works for me in Android. And the Clipper libraries do not work with the data that I am using. The instance of "this" is the class itself. e.g. this class https://github.com/ChristianLutz/gpcj/blob/master/gpcj/src/main/java/com/seisw/util/geom/Clip.java line 1536. Currently, I added a setter method instead as a workaround. But i dont think it will work in this scenario PolySimple.java (please use same url) line 333
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Comment on For Loop Conversion in Swift
Not much in there. but guess the while loop is the only way to go. Thank you.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Comment on What does "#if DEBUG" really mean in Swift?
@eskimo im curious since im new to swift. is it possible to mix #if debug with another conditional? Like i need to have 2 conditionals and one of them is if it's debug.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23
Comment on Possible to set body view's background to transparent?
@Claude31 it didnt work out though. the background of the view is all white.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23
Comment on Possible to set body view's background to transparent?
lol. .clear, i didnt expect that keyword . thanks claude31!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23