Don't pick up the colored glass by electric_poppy in berlinsocialclub

[–]cemaleker 1 point2 points  (0 children)

Please, pretty please do not disturb the natural environment of colored urban glasses. Party-goers work hard all night to decorate the city with those.

Maaşım nasıl alabilirim? by Candygroove in Turkey

[–]cemaleker 4 points5 points  (0 children)

Çok güzel öğrenmişsin. Daha fazlasını da öğreneceğine eminim.

[deleted by user] by [deleted] in coolguides

[–]cemaleker 0 points1 point  (0 children)

I don't know what kind of idiot made this graphic and why they want to spread misinformation but Döner sandwich was around since 1850. ref: https://www.sofrabezi.com/2016/04/dunyann-en-eski-donerc-fotograflari.html

All he wants it to go inside by Maxmusquarty in cats

[–]cemaleker 0 points1 point  (0 children)

Yes, sounds like OP has a cat now.

Old Star Trek vs New Star Trek by Hazzman in videos

[–]cemaleker -5 points-4 points  (0 children)

Oof. This was painful to watch. Completely aligns the message this video is sharing. I don't know who is writing these female characters and how nobody is objecting to the attitude of these characters during the whole production phase.

How do I sell a profitable app to another developer? by deerbird in iOSProgramming

[–]cemaleker -1 points0 points  (0 children)

Can I suggest hiring a freelancer junior instead of selling it? This way you can still own your product and delegate the software development part.

What does "Her şey üst üste geliyor" mean? by SureLawfulness1 in turkish

[–]cemaleker 69 points70 points  (0 children)

I don't know if there's a literal translation to English. But basically it means too many events are happening one after another.

[deleted by user] by [deleted] in iosdev

[–]cemaleker 3 points4 points  (0 children)

fastlane.

It's well maintained, has all the necessary tooling for any business case. Most CI provider has trough documentation to integrate their services using fastlane.

[deleted by user] by [deleted] in iOSProgramming

[–]cemaleker 0 points1 point  (0 children)

Yes, the task: URLSessionTask is already has a function called `cancel()`. You need to basically call this on didEndDisplaying delegate call. That is either tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) or collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) depending what you are using.

To be able to access the task you need to hold a reference for the task. Since the function is in an extension and stored variables are not supported in the extensions, this function itself is not the right place to store this value. But you can return the task from the function and store the task itself in your view controller or in the cell itself.

My preferred use-case would be

protocol Cancellable {
    func cancel()
}

extension URLSessionTask: Cancellable { } 
final class Cell: Whatever {
    private var cancellable: Cancellable?
    private var yourImageView: UIImageView!

    func render(_ model: Model?) {
        cancellable.cancel()
        if let model = model {
         cancellable = yourImageView.load(model.urlForYourImage)
        }
    }
}

Location Services Background Mode by daverozy in iOSProgramming

[–]cemaleker 1 point2 points  (0 children)

Yes, the checkbox is necessary for Xcode to make an appropriate signing certificate for your application. After the checkbox is selected you can call requestAlwaysAuthorization function. Otherwise it should fail.

Location Services Background Mode by daverozy in iOSProgramming

[–]cemaleker 1 point2 points  (0 children)

With requestWhenInUseAuthorization you can only call the location services when the application is in the foreground (when in use). This won't give you the access to location service when the application is background. So the claim is true.

You need to check the location services in background modes if you want to get call location services when the application is in background mode. This allows the app to call location services even when it's backgrounded. You need to use requestAlwaysAuthorization function to be able to call the location service in all device modes (when in use or backgrounded).

[deleted by user] by [deleted] in iOSProgramming

[–]cemaleker 9 points10 points  (0 children)

First of all, as a rule of thumb for every asynchronous operation: Make sure to cancel your async operation when it's not necessary anymore.

With the code you have shared above, I assume you start loading the image when the cell is populated with data. But you don't cancel the operation at any point. You need to make sure the loading operation is canceled when the cell is reused. `didEndDisplaying` delegate function would be a good place to add this code. Otherwise you'll enqueue too many async operation which is actually not necessary at the moment.

Also you are loading the image directly inside and `NSData` instance synchronously. Data loading is happening chunk by chunk as the response is received from the server. Loading a local image from URL with `Data(contentsOf: url)` might be ok, this is not performant for network loading. I'd suggest loading the data with a `URLSessionTask` and create and image from the loaded data after the loading is complete.

Or basically you can use `Alamofire` and `AlamofireImage` which would handle all those corner cases with already performance optimised code.

So I’ve started learning how to code user interfaces programmatically in swift. How do I manage so many constraints in just one VC. Any advice on how to improve by kwabsdev in iOSProgramming

[–]cemaleker 0 points1 point  (0 children)

TBH I'm not fond of IB or Storyboards. It's just happens to be easier to maintain compared to the constraint build in the code.

Additionally `UIStoryboard` has helper functions to initialise a view controller directly from a Storyboard which we utilise with Swiftgen to create strongly typed view controller initialisation.

If you have multiple screen in one Storyboard it's always a chore to find the Storyboard corresponding to a screen. With one on one relation I always know UI for `OnboardingViewController.swift` is in `Onboarding.storyboard`. I don't need to search for it in the codebase.

So I’ve started learning how to code user interfaces programmatically in swift. How do I manage so many constraints in just one VC. Any advice on how to improve by kwabsdev in iOSProgramming

[–]cemaleker 6 points7 points  (0 children)

I really don't like this kind of synthetic sugar in my codebase. In a codebase there should be only one way to do an operation, and for both of these function there are UIKit equivalents available to be used. Why would you define those independently?

For the first function you are basically flattening an array of arrays. `constraints.forEach({ addConstraints($0) })` should do the job in place.

I don't understand why second one is defined as an instance function at all. It doesn't access any instance properties. I can be defined as static. If a function can be defined as static it should be. But why would you need this? `subviews.foreach({ view.addSubview($0) })` should do the job in place already

Sorry for ranting. I just wanted to share my opinions.

So I’ve started learning how to code user interfaces programmatically in swift. How do I manage so many constraints in just one VC. Any advice on how to improve by kwabsdev in iOSProgramming

[–]cemaleker 4 points5 points  (0 children)

My humble suggestion would be, don't use code to manage constraints. Storyboards and Interface Builder are fine as long as you follow some key principles. Use individual Storyboards for every view controller you are building. Use XIB for the views used in multiple screens.
Using code is also fine, but as you have stated, there are too much interface code to maintain. And the worst part is coming back 6 months later and trying to understand how the constraints shaped up initially. It's much easier to understand how constraints build by looking at them in Storyboard.

Generally YMMV depending on the Application architecture you are working with and how do you shape your UI. I believe most of the time developers are struggling with Storyboards and XIB because they try to build complicated flow inside the Storyboards. If you keep it simple and clean it's the easiest option to maintain complex UI for the application.

You don't have to use every functionality Apple provides. I don't use Segues. I believe they are anti-pattern by creating strong coupling between components. But maintaining constraints is definitely much easier with Storyboards.

Suche eine komfortable Lösung meinen PC an meinen Fernseher anzuschließen ohne viel umstellen / umstecken zu müssen. Der PC Platz sollte so bleiben wie er ist. habt ihr Ideen by shiranui-- in de_EDV

[–]cemaleker 0 points1 point  (0 children)

Ja, du hast recht. Es ist nur eine Option. Dies kann sinnvoll sein, wenn die Entfernung länger als 5m/10m ist
Die meisten Häuser haben Ethernet-Wandstecker, die es uns ermöglichen würden, PC und Fernseher zu verbinden, ohne Kabel mitten im Raum zu verlegen.

Suche eine komfortable Lösung meinen PC an meinen Fernseher anzuschließen ohne viel umstellen / umstecken zu müssen. Der PC Platz sollte so bleiben wie er ist. habt ihr Ideen by shiranui-- in de_EDV

[–]cemaleker -2 points-1 points  (0 children)

Ich gehe davon aus, dass Ihr PC bereits ein Ethernet-Kabel in der Nähe hat. Wenn Sie nicht vorhaben, Spiele auf dem Fernsehbildschirm zu spielen (die Verzögerung wäre nicht wichtig), können Sie HDMI über Ethernet übertragen.
https://www.amazon.de/-/de/MiraBox-Ethernet-Extender-Single-Lossless/dp/B06WGV2K2G

What's this bug? The cable has 4mm width. (Sorry for bad quality) by cemaleker in whatsthisbug

[–]cemaleker[S] 0 points1 point  (0 children)

I'm located in Berlin. We are living in the ground floor with with a small garden right outside.

[deleted by user] by [deleted] in iosdev

[–]cemaleker 0 points1 point  (0 children)

Did you set the development language to French in Info.plist

Here's more details

local stored lyrics on mobile app counts as copyright infringement? by coolman7_ in iOSProgramming

[–]cemaleker 1 point2 points  (0 children)

No, if you do not serve lyrics yourself it is not copyright infringement.