Articles

App Review Request in iOS

An important task that mobile app developers often face is encouraging users to rate and write reviews of their apps on the App Store or Google Play Store. In addition to increasing the popularity of the app, this can help you improve your app by getting users feedback. In this article, we will learn the best methods to request user ratings and reviews on the iOS platform. We will also look at how you can implement this process in both development frameworks with UIKit and SwiftUI.

Automatically Delete Screenshots on macOS

If we regularly take screenshots on our desktop or in a particular folder, these images can accumulate over time and consume unnecessary disk space. Additionally, these screenshots can be difficult to find and edit later. However, setting the default screenshot folder on macOS and clearing this folder regularly can help solve these problems. In this article, you will learn how you can set the default screenshot folder and set an automatic task to clean this folder regularly.

Higher Order Functions in Swift: A Guide to Improving Code Reusability and Readability

Higher Order Functions (HOFs) are powerful tools in Swift that can greatly improve the readability and reusability of code. These functions allow developers to pass functions as parameters or return functions as values from other functions, enabling the same functionality to be used across different functions. This can significantly reduce code repetition and make it easier to maintain and scale the codebase. Additionally, HOFs can make code more readable by using simple, concise functions with meaningful names.

How I Became an iOS Developer?

“I wrote this blog in Turkish about 1.5 years ago and it attracted a lot of attention. I wanted to share the English version with you again.” Last week, I posted a tweet to share my happiness, receiving more attention than expected, reaching 70,000+ people. Many people who have gone through similar paths or who want to start this journey have reached out to me and the questions were quite similar.

Hangi Dijital Araçları Kullanıyorum?

Teknoloji alanında hayatımı bir noktada kolaylaştırdığını düşündüğüm araçları kullanmayı oldukça seviyorum. Bu yüzden yeni çıkan araçları sürekli olarak deneyimleyip işime yarayanlar ile hayatıma devam ediyorum. Bu blogda yer alan araçların tamamını bir süredir (min. 2 ay) kullanıyorum ve bu deneyimlerimi sizlerle paylaşmak istedim. Blogu okumayı bitirdiğinizde, bahsettiğim toollardan bir tanesi dahi hayatınızı kolaylaştırmaya yardımcı olursa yazı amacına ulaşmış demektir. Araçları tanıtmaya başlamadan önce telefon ve bilgisayar tarafında Apple ekosistemini kullandığımı belirtmek isterim, bu bağlamda araçların bazıları diğer işletim sistemlerine uygun olmayabilir.

Swift'te Değer ve Referans Tipleri

Merhaba, bu blogda value/reference (değer/referans) tiplerinin özelliklerini, benzerliklerini ve farklılıklarını öğreneceksiniz. Aynı zamanda bu soyut kavramları aklınızda daha iyi canlandırmak için kod örnekleri ile pekiştireceğiz. Swift’teki türler iki kategoriye ayrılır. İlk kategori olan değer tipinde (value type) struct, enum, Tuple, Int, Bool, String ve Dictionary bulunur. Bu tiplerden biri ile tanımladığınız verilerin her biri hafızada benzersiz (unique) bir değer ile eşitlenir. Diğer kategori olan referans tipine örnek olarak class verilebilir. Class’tan oluşturduğumuz bir nesneyi farklı onlarca değişkene atasak bile hafızada karşılık geldiği değer aynı kalacaktır.

iOS Geliştiricilerinin 2022'de Odaklanması Gereken 5 Başlık!

Yeni bir yıl başladı ve çoğumuz muhtemelen bu yıl alanımızla alakalı neye odaklanmamız gerektiğini düşünüyoruz. iOS geliştirme dünyasında öğrenilecek ya da tekrar edilecek pek çok konu var. Donny Wals’un yazmış olduğu ve topluluğa katkı sağlayacağını düşündüğüm bu blogu Türkçeye çevirdim, keyifli okumalar! Bu kısa blogda, 2022’de daha iyi bir geliştirici olmanıza yardımcı olacağına inandığım beş şeyi listeledim. Daha doğrusu, 2022’nin ilk yarısı. Apple’ın bu yılki WWDC’de yeni ilginç şeyler yayınlamasını bekliyorum, yılın ikinci yarısı için yeni özelliklere göz atmak daha iyi olabilir.

Nasıl iOS Developer Oldum?

Geçtiğimiz hafta yalnızca mutluluğumu paylaşmak için attığım bir tweet, “beklediğimden” fazla ilgi gördü ve 70.000+ kişiye ulaştı. Benimle benzer yollardan geçen ya da bu yolculuğa başlamak isteyen pek çok kişi bana ulaştı ve aslında sorular birbirine oldukça benzerdi. Ben de tüm bu yolculuğu ve soruları tek bir blog yazısında toparlayarak topluluk için daha yararlı ve kalıcı bir hale dönüştürmeyi amaçladım. İşte karşınızda Sıfırdan Bire — iOS Developer Olmak! iOS Öncesi Üniversitenin ilk yıllarından itibaren günümüzün en popüler alanlarından biri olan yapay zeka, makine öğrenimi konularına ilgi duyuyordum fakat bir süre geçtikten sonra bu alanda çalışırken çok da keyif almadığımı “belki de benim için doğru alan bu değildir.

Swift ve Sınıflar

Bu yazıda Nesneye Yönelik Programlama’nın temel kavramlarından biri olan sınıfların (classes) Swift dilinde nasıl kullanıldığından bahsedeceğim. Olabildiğince sade ve gerçek hayattan örnekler vererek açıkladığım bir yazı olacak, şimdiden keyifli okumalar. Sınıf Nedir? Sınıf, nesne yönelimli programlama dillerinde nesnelerin özelliklerini, davranışlarını ve başlangıç durumlarını tanımlamak için kullanılan şablonlara verilen addır. Evet bu tanım biraz soyut olmuş olabilir, daha somut hale getirmek için gerçek hayattan örneklersek bu konunun daha net anlaşılacağını düşünüyorum.

SwiftUI ve Butonlar

Apple, butonları “Bir eylemi başlatan kontrol.” olarak tanımlıyor. Bu yazımda sizlere SwiftUI’da butonların işlevini ve bu butonları özelleştirmeyi anlatacağım. SwiftUI ve Butonlar Kapak Fotoğrafı Button nedir? Butonların ne olduğunu uzun uzadıya anlatmaya gerek olmadığını düşünüyorum, hepimizin bildiği gibi kullanıcıların dokunmasıyla aksiyon alan bir kontrol. Daha önce UIKit deneyiminiz var ise orada bulunan “UIButton” ile oldukça benzer. Fakat daha esnek ve çok daha kolay özelleştirilebilir. Az sonra bir kaç satırda oldukça güzel bir buton oluşturduğumuzu göreceksiniz.

Hangi Dijital Araçları Kullanıyorum?

Markdown desteği, yeni buton stili, özelleştirilebilir listeler ve daha fazlası Apple’ın her yıl düzenlemiş olduğu Worldwide Developers Conference yani kısaca WWDC, 2021 yılında bizleri pek çok yenilik ile karşıladı. Bu yazımda SwiftUI 3.0 ile birlikte gelen yenilik ve geliştirmelerden bahsedeceğim. SwiftUI 3.0’ın iOS 15, iPadOS 15, macOS 12 ve watchOS 12 ve üzeri sürümlerle uyumlu olduğunu hatırlatmakta fayda var. Tüm bu güncellemeleri anlatmaya başlamadan önce minik bir değişiklikten bahsetmek isterim, bir Xcode projesinde Info.

Python 3.9 - Bilmeniz Gerekenler

Python, topluluğun ihtiyaçları doğrultusunda sürekli olarak güncellenmeye devam ediyor. Aynı zamanda yakın gelecekte en çok kullanılan dil olma konusunda da büyük bir aday. Python’ın yeni versiyonu olan 3.9 sürümünde pek çok yenilik mevcut. Bu yazımda bu yeniliklerden bahsedeceğim. Beta Versiyon Kurulumu Beta versiyonu kullanabilmek için bazı kurulumlar yapmamız gerekiyor. Bu kurulumları yapmak için ihtiyacımız olan adımlar şunlar: wget [https://www.python.org/ftp/python/3.9.0/Python-3.9.0a5.tgz tar](https://www.python.org/ftp/python/3.9.0/Python-3.9.0a5.tgztar) xzvf Python-3.9.0a5.tgz cd Python-3.9.0a5 ./configure — prefix=$HOME/python-3.9.0a5 make make install $HOME/python-3.

Flutter’da Dinamik Tema Oluşturmak

Flutter’da çok pratik ve hızlı bir şekilde mobil uygulamalar oluşturabiliyoruz. Aynı zamanda Flutter uygulamamız için dinamik temalar oluşturmak da bir bu kadar kolay. MaterialApp widget’ın içinde koyu ve açık renk temalar için renk paleti belirleyebilirsiniz. Ayrıca uygulamanızın bazı kısımlarında Theme widget kullanarak temayı özelleştirebilirsiniz. Bununla birlikte, uygulamanızı geliştirirken kendi özel temanızı uygulamak isteyebilirsiniz. Flutter’da bulunan yerleşik tema, daha gelişmiş Flutter projeleri için yeterli gereksinimleri sağlayamayabilir. Diyelim ki uygulamanızın bir bölümünde çok fazla metin kutusu (textbox) var ve hepsine belirli renkler tanımlamak istiyorsunuz.

En Çok Kullanılan Python Metod ve Fonksiyonları

En Çok Kullanılan Python Metod ve Fonksiyonları Fonksiyonların, Python’ın en büyük avantajlarından olduğunu söylesek yanılmayız sanıyorum. En azından Veri Bilimi ile uğraşırken bizlere pek çok kolaylık sağlarlar. Ben de bu yazıda sizlere Veri Bilimi’nde en çok ihtiyacımız olan fonksiyon ve metodları derledim. Bir çoğumuz bu fonksiyonlara hakim olsak da zaman zaman unutulan veya eksik kalan kısımlar olabiliyor. O yüzden en temelden başlayalım! Aşağıdaki gibi bir değişkenimiz olduğunu varsayalım: a = ‘selam!

VS Code ile Jupyter Notebook

Bir çok yazılımcının en sevdiği IDE muhtemelen Visual Studio Code. Gerek stabilliği, gerek bilgisayarı az yorması ve temiz arayüzü sayesinde gönülleri fethetmeyi başarıyor. VS Code sayesinde pek çok yazılım dilini tek bir IDE ile yazabilmek mümkün. Az sonra VS Code üzerinde Jupyter Notebook kullanımı için gerekli kurulumları sizlere anlatacağım. Öncelikle, neden Jupyter Notebook? Kodun sadece belirli bir kısmını çalıştırabilirsiniz. (Yüzlerce satırlık programın sadece revize ettiğiniz yerini çalıştırarak daha çabuk çıktıya ulaşırsınız.

Google Developer Student Clubs Yolculuğu!

Herkese selam, bu yazıda sizlere Developer Student Clubs maceramdan ve deneyimlerimden bahsedeceğim. Öncelikle, Nedir bu Developer Student Clubs nam-ı diğer DSC? Google Developers tarafından desteklenen öğrenci topluluklarıdır. Adından da belli olduğu üzere teknolojiyle ilgilenmeyi seven geliştirici öğrencileri bir araya toplamayı amaçlıyor. Ayrıca tüm lisans ve lisans üstü öğrencileri kapsıyor. Bir çok yerde bu şekilde tanımlanıyor DSC, fakat bu kadar mı? Hayır, çok daha fazlası. :) Developer Student Clubs sayesinde öncelikle kendinizi ve core ekibinizi, daha sonrasında ise topluluğunuzdaki insanları güncel teknolojiler, bilhassa Google Teknolojileri hakkında bilgilendirip, Study Jam olarak isimlendirdiğimiz workshoplar düzenleyebiliyorsunuz.

Higher Order Functions in Swift: A Guide to Improving Code Reusability and Readability

Planted March 5, 2023

Higher Order Functions (HOFs) are powerful tools in Swift that can greatly improve the readability and reusability of code. These functions allow developers to pass functions as parameters or return functions as values from other functions, enabling the same functionality to be used across different functions. This can significantly reduce code repetition and make it easier to maintain and scale the codebase. Additionally, HOFs can make code more readable by using simple, concise functions with meaningful names. In this blog post, we will explore how HOFs work in Swift and how they can be used to improve the efficiency and readability of your code.

Why are Higher Order Functions Important?

  • They increase code reusability
  • They help us write less code
  • They help us write more readable code
  • They help us make fewer mistakes
  • They offer a more convenient way to combine functions

Higher Order Functions How to Improve Code Reusability and Readability?

Increasing code reusability:

  • HOFs enable functions to be passed as parameters to other functions or returned as values from other functions, allowing the same functionality to be used in different functions that perform similar operations.
  • HOFs eliminate repeated code blocks, making the code more reusable. This reduces errors and makes code maintenance easier.

Increasing code readability:

  • HOFs use simple and clear functions that increase code readability. This makes complex code more readable and understandable.
  • HOFs use meaningful names for code blocks that correspond to their purpose. This makes the intentions of the code clearer and more understandable.
  • HOFs enable code to be written in fewer lines, which makes the code less cluttered and easier to understand.

By improving code reusability and readability, Higher Order Functions help to make code cleaner, more readable, and easier to maintain. This makes the development and maintenance of code more accessible and reduces the time it takes to write code.

1) Map

  • Map is a function that takes an array and applies a given transformation to each element, returning a new array with the transformed elements.
  • For example, you can use the map to convert an array of integers to an array of strings:
let numbers = [1, 2, 3, 4, 5]   
let doubledNumbers = numbers.map { $0  *  2 }   
print(doubledNumbers) // [2, 4, 6, 8, 10]  

2) Filter

  • The filter is a function that takes an array and applies a given condition to each element, returning a new array with only the elements that satisfy the condition.
  • For example, you can use a filter to get all the even numbers from an array:
let numbers = [1, 2, 3, 4, 5]   
let filteredNumbers = numbers.filter { $0  %  2  ==  0 }   
print(filteredNumbers) // [2, 4]  

3) Reduce

  • Reduce is a function that takes an array and applies a given operation to each element, accumulating the result into a single value.
  • For example, you can use reduce to calculate the sum of an array of integers:
let numbers = [1, 2, 3, 4, 5]  
let sum = numbers.reduce(0) { $0 + $1 }  
print(sum) // 15  

4) Sort

  • Sort is a function that takes an array and sorts the elements according to given criteria.
  • For example, you can use sort to sort an array of strings in alphabetical order:
var numbers = [5, 3, 2, 4, 1]  
let sortedNumbers = numbers.sorted()  
print(sortedNumbers) // [1, 2, 3, 4, 5]  

5) Compact Map

  • Compact Map is a Higher Order Function particularly useful when working with arrays containing Optional values. It transforms an array into another array by removing any nil values and unwrapping any non-nil values from their Optional wrapper.
  • For example, let’s say you have an array of String values that can be converted to Int, but some values are not valid Int values. You can use compactMap to convert only the valid values to Int and remove the invalid values:
let numbers = ["1", "2", "three", "4", "five"]  
let mappedNumbers = numbers.compactMap { Int($0) }  
print(mappedNumbers) // [1, 2, 4]  

Relationship Between Closures and Higher Order Functions in Swift

Closures are self-contained blocks of functionality that can be passed around and used in your code. They are similar to functions in that they can take arguments and return values, but they are defined inline as part of the code that uses them.

Closures are often used with higher-order functions in Swift. For example, the map, filter, and reduce functions all take closures as arguments to specify the behavior that should be applied to each element in an array.

Here’s a more complex example that uses a closure with the filter function:

let numbers = [1, 2, 3, 4, 5]  
let filteredNumbers = numbers.filter { number in  
 return number % 2 == 0  
}  
print(filteredNumbers) // [2, 4]  

In this example, we start with an array of numbers and use the filter function to only keep the even numbers in the array. The closure we pass to the filter the function takes an integer argument (number) and returns a Boolean value (true if the number is even, false otherwise).

The closure syntax can be a bit confusing at first, but it’s quite simple once you get used to it. The closure is defined inside a set of curly braces ({ }) and starts with a list of arguments (in this case, just one argument of a type Int called number). After the arguments, you specify the return type (Bool in this case) with an arrow (->). Finally, you write the body of the closure, which in this case is just a single line that checks whether the number is even and returns true or false.

Overall, closures are a powerful tool in Swift that allows you to write flexible, reusable code that can be passed around and used in a variety of contexts, including with higher-order functions.

Conclusion

Higher Order Functions are an important concept in Swift programming. They allow you to write cleaner, more readable, and more reusable code. By using functions like map, filter, reduce, sort, and compactMap, you can manipulate arrays and collections in powerful ways that would otherwise require more verbose code.

The use of Higher Order Functions not only makes your code more readable and maintainable, but also helps you avoid common programming errors, such as off-by-one errors in loops, or unexpected nil values.

By mastering Higher Order Functions, you can take your Swift programming skills to the next level, and write more elegant and efficient code. Keep in mind that there are many other Higher Order Functions available in Swift and that you can even create your own custom Higher Order Functions, so be sure to explore and experiment to find the functions that best fit your needs.

In summary, Higher Order Functions are a powerful tool in the Swift programmer’s toolbox and can help you write code that is more efficient, elegant, and easier to maintain.

For feedback and questions, you can reach me on Twitter, Superpeer, or hi@dogancan.dev.