Blog
Blog copied to clipboard
How to become an iOS wizard
Hi Ahmed, Thank you for dropping by.
I think you meant to open this issue here instead, but it's ok ☺️
I think the question is too broad. I'm not sure if I can define what an 'iOS wizard' is, but I'll assume you mean how to be a better iOS developer, and maybe keep getting better.
I'll just skim through concepts and skills by name. How you feel confident reading each of those is your guide. I originally intended to go into some detail in each, but that would take so long. So, maybe we can open discussions for each one if needed.
In no particular order:
Swift
- Value types vs reference types.
- Memory management (reference counting, weak/strong/unowned, what are retain cycles and how to break them).
- Closures (what is
@escaping
and capture semantics). - Enums (raw types, associated values,
CaseIterable
, indirect enums). - Computed properties.
- Default arguments.
- Type inference.
- Generics.
- Opaque return types (reverse generics).
- Access modifiers (why gradual access from private to open is a good thing).
- Protocols (protocol with associated types, conditional conformance, limiting conforming types, limiting to reference types with
AnyObject
). - Extensions (extending generic types conditionally).
- Higher-order functions (map, flatMap, reduce, filter, ...etc, why use these instead of loops?)
- Optionals (reducing optionals).
- Method dispatch (static, dynamic, table).
- ObjC interoperability.
- Codable.
- Immutability (why it's a good thing, why
let
is preferred overvar
when possible). - The standard library (important collection types: Array, Dictionary, Set, String, Slices, Ranges)
- Subscripts.
- Custom operators.
- Switch and pattern matching.
- Result<T, E: Error>
- Throwing functions (throws, rethrows, do, try, catch).
- Self-executing closures (what are they, what are their uses?).
- Lazy variables.
- Lazy sequences.
- Type erasure.
- Property observers.
Objective-C
- Swizzling.
- Selectors.
-
atomic
vsnonatomic
. - Categories.
- Runtime (
objc_setAssociatedObject
andobjc_getAssociatedObject
). - KVO and KVC.
Foundation
- Data.
- Working with date and time (Date, Calendar, DateComponents, TimeInterval).
- Formatters and Locale (DateFormatter, NumberFormatter).
- UserDefaults.
- NSUbiquitousKeyValueStore.
- URL.
- URLSession.
- Timers.
- NotificationCenter.
UIKit
- Auto Layout (layout anchors, priorities,
UILayoutGuide
, compression resistance, hugging priorities, intrinsic content size). - Interface Builder (XIBs, Storyboards, IBDesignable).
- Programmatic UI.
-
UIStackView
(distribution, alignment, how to minimize constraints by using stack views, how to show/hide views by usingisHidden
properties of views embedded in stack views). -
UITableView
(avoiding cell reuse issues, self-sizing cells). -
UICollectionView
(custom layouts). - Splitting view hierarchy into multiple focused view controllers.
- Container view controllers (
UINavigationController
,UITabBarController
,UIPageViewController
, ...etc). - Custom view controller presentations.
- Custom view controller transitions (
UIPercentDrivenInteractiveTransition
). - Manual layout (overriding
layoutSubviews
and manually calculating frames). - Simple animations (
UIView.animate(withDuration)
and co.). - Subclassing
UIView
(override draw(_:) or utilize Core Animation layers? see Core Graphics and Core Animation sections). - Subclassing
UIControl
. - Gesture recognizers.
- What is
point(_ inside:)
? When do we need this? - Working with scroll views (
scrollViewWillEndDragging(_:withVelocity:targetContentOffset:)
) and pagination. -
CGAffineTransform
.
Core Graphics
- What is a graphics context?
- Filling rectangles and drawing shapes with paths.
- Off-screen rendering (drawing
NSAttributedString
to image contexts, and building bitmaps of complex hierarchies in advance for performance gains).
Core Animation
- Drawing non-rectangular views with
CAShapeLayer
. -
CAGradientLayer
. - Drawing vast areas asynchronously with
CATiledLayer
. - Syncing with screen refreshes with
CADisplayLink
. - Masking (drawing holes) with
CALayer
and co. - Animation classes (
CABasicAnimation
,CAKeyframeAnimation
).
Concurrency
- Why go concurrent? for speed? for responsiveness? for both?
- What is the significance of the main thread?
- Serial and concurrent queues.
- DispatchQueue.sync vs DispatchQueue.async.
- What is thread safety? how to achieve it? is it worth it every time?
- What is locking? why we needed it? how to lock resources? does it introduce other problems? what is a deadlock?
- What is priority inversion? how can it happen? how to avoid it?
- What is
DispatchGroup
? it it relevant in the presence of FRP frameworks? (for FRP see later sections).
Persistence
- When does
UserDefaults
stop being a good persistence solution? - What Core Data is good for? is it a general purpose database?
- Is sqlite still relevant? are you familiar with relational databases?
- CloudKit integration.
Patterns
- Delegation
- DataSource
- Observers
Anti-Patterns
- Why singletons are dangerous?
Concepts and Paradigms
- Functional programming.
- (Functional-)Reactive programming.
- Why use functional-reactive programming frameworks opposed to custom-tailored observers or
NotificationCenter
. - Protocol-oriented programming.
- Why string-typing is bad? What can we do to limit it?
- Composition over inheritance? and why?
Architectures
- MVC (what went wrong with Apple's MVC?)
- MVP, MVVM, VIP, VIPER. What do they solve? how do they differ? what do you prefer and why?
Build
- CocoaPods. Is it only for using libraries? can we split our projects into private pods? (same for Swift Package Manager)
Testing
- Pyramid of testing (unit, integration, and UI/end-to-end tests).
- What is code coverage? why is it important? is it really important?
- What is the purpose of unit testing if we're not testing real data?
- What is mocking? why some people don't like it?
- How to test async code?
CI/CD
- What?
- Why?
Debugging
- Breakpoints, step over, step into, step out, backtrace.
- Are you familiar with lldb commands?
- Do you use Objective-C exception breakpoints/Swift Errors/Symbolic break points?
- Do you use Xcode's View hierarchy debugger?
Git
- What?
- Why?
- How do you organize your branches? What do you think about GitFlow?
How to broaden your knowledge
- Browse top voted iOS-related Stack Overflow questions. Read every answer and comment. Take your time.
- Browse the Swift forums often.
- Follow some newsletters (iOS Goodies, iOS Dev Weekly, Swift Weekly Brief)
- Follow popular iOS-related blogs (Swift By Sundell, Hacking with Swift, NSHipster, ObjC IO, ...etc).
- Watch WWDC videos.
- Watch top conferences talks.
- Read open source code (begin with the libraries you use). Read issues and discussion between contributers.
Hone your skills
- Write code every day. If not possible: think about code every day.
- If you find a problem in an open source library you use, investigate it, and submit a PR when you reach a solution.
- Try to engage with the iOS community and maybe help answers other people's questions.