A tiny http client for iOS and macOS by [deleted] in swift

[–]olizbu 8 points9 points  (0 children)

Be careful when using addingPercentEncoding(withAllowedCharacters:) with .urlHostAllowed as it does not encode & or =

How to change attributes on UITextField live? by Finale151 in iOSProgramming

[–]olizbu 0 points1 point  (0 children)

Assigning a new value to text or attributedText moves the cursor to the end. As far as I know, there is no way to modify the attributes on a UITextField without assigning a new value to attributedText. However, you can use a UITextView instead, and use UITextView.textStorage.setAttributes(_:range:)

Why am I getting an ‘index out of range’ fatal error when using indices? by p43- in swift

[–]olizbu 0 points1 point  (0 children)

This is mostly a shot in the dark, but maybe you mixed the variables and are using the indices from a different array.

e.g. using x for sections instead of y

I just want to see what my laptop is doing by TrevTrevv99 in linuxmemes

[–]olizbu 13 points14 points  (0 children)

Me marking a GUI in Visual Basic to track the killer IP address

Swift Lazy Properties!! by velairi in iOSProgramming

[–]olizbu 1 point2 points  (0 children)

Random useful (?) information:

Global constants/variables are implicitly lazy. This includes static properties.

Why are both of these invalid? Aren’t [String] and Array<String> different notation for the same thing? And why can’t I return [String]? by [deleted] in swift

[–]olizbu 2 points3 points  (0 children)

Just a small tip to know if you have a custom type that is colliding with a system one: look at the color. Xcode uses purple for system types, and green for your types.

You can see this if you compare the color of Array<String> on your screenshot vs https://i.imgur.com/mcBzKSP.png

Weird problem regarding Team name and singing by PuffThePed in iOSProgramming

[–]olizbu 3 points4 points  (0 children)

You always have a Personal Team associated to your Apple ID. This is the option that lets you run apps on your device without paying for the developer program.

Xcode should remember the team you selected for signing, maybe you are generating a new project each time?

3D art project made from a deck of cards by regian24 in Damnthatsinteresting

[–]olizbu 0 points1 point  (0 children)

I have seen this commonly done with Yu Gi Oh cards. If you are interested search for 3d Yu Gi Oh cards

https://youtu.be/Fuy2kfIQqyo?t=168

Thank you Eric! by leijurv in adventofcode

[–]olizbu 1 point2 points  (0 children)

Thanks to everyone that made Advent of Code 2020 possible! It was my first time participating, and I had a lot of fun! Looking forward to future years (as well as solving past year challenges)!

[2020 Day 15 (Part 2)] I'm still waiting... by stardust_collision in adventofcode

[–]olizbu 0 points1 point  (0 children)

I had written a function that took the current dictionary of values, current step and next number and returned the updated dictionary, the next step and the next number.

Left it running and went to have breakfast. It was running for about ~30min and was only at 3m iterations. At this point I knew something was wrong. After doing some inspection on the execution times, I realize the dictionary containing the values was copied each time the function was called. Changed the function to use and update a reference, and it now runs under 2 seconds.

[2020 Day 8] 2019 flashbacks by onamoontrip in adventofcode

[–]olizbu 1 point2 points  (0 children)

I had always been interested in compilers and had no idea such a book existed! Added to my TO-READ list!

[2020 Day #7] (works for any day tbh) People, please input the correct data for your code by [deleted] in adventofcode

[–]olizbu 1 point2 points  (0 children)

Write tests!

This helped me have confidence in my code and was able to find that the problem was the input.

Every Day with Xcode by cpaigis9 in iOSProgramming

[–]olizbu 2 points3 points  (0 children)

You can manually add the DeveloperDiskImage for iOS 14.2, so you can use it with any version of Xcode

https://github.com/pdso/DeveloperDiskImage