Search results for #iostipschallenge
#iostipschallenge day 29 📝🔐 TIL you can set ITSAppUsesNonExemptEncryption to NO in your Info.plist, after which App Store Connect won't ask you to fill the encryption exemption form ever again😤 (that is, if your usage is exempt of course, e.g. using HTTPS)
#iostipschallenge day 28 Did you know that you can sort your files/groups by name in Xcode? 🤯 I was manually sorting them before learning that.
#iostipschallenge day 27 Add: -Xfrontend -warn-long-function-bodies=100 -Xfrontend -warn-long-expression-type-checking=100 to your "Other Swift Flags" to see which functions/expressions are taking more than 100ms to type-check. I was amazed to see some methods taking >450ms
#iostipschallenge day 26 Using `UIGraphicsImageRenderer`? Perf tip: *Keep a reference to your renderer to reuse it* The renderer keeps a cache of Core Graphics contexts, so reusing the same renderer can be more efficient than creating new renderers.
#iostipschallenge day 25 Instead of importing a whole module, you can import individual structs, classes, enums, functions, variables, and more. It helps reduce the API surface your swift file is exposed to. For example:
#iostipschallenge day 24 Instead of calling `view.layoutIfNeeded` on your animated views in an animation block, you can use the `.layoutSubviews` animation option. UIKit will take care of laying out the views you animate.
#iostipschallenge day 23 ASO trick 📈 2x your app's keyword (100 → 200 chars) on App Store Connect by utilizing unused localizations. Example: a US App Store search uses both en_US and es_MX. Add your extra english keywords to es_MX if your app isn't localized for it.
#iostipschallenge day 22 If you have: `var myVar: Int?` Did you know that: `myVar!` and `myVar.unsafelyUnwrapped` are not the same? `unsafelyUnwrapped` trades safety for performance. Debug build = similar behavior. Optimized build = undefined behavior if value is nil.
#iostipschallenge day 21 PSA: if your app offers a free trial, make sure to dynamically check the user's eligibility status before displaying your e.g. "7 day free trial" text. The user might have already consumed their introductory price (= used trial and then canceled).
#iostipschallenge day 20 TIL about GroupBox. You don't need to think about corner radius and background color every time: SwiftUI does it for you! Credits: @gaudioaffectus for image and discovery.
#iostipschallenge day 19 At first, I found it weird that some SwiftUI views required a label or a title (e.g. Picker, ProgressView, ColorPicker, etc..) If you don't want the label to be visible, don't use `EmptyView`, but instead use the `labelsHidden` view modifier.
#iostipschallenge day 18 I use a simple extension on `View` to center my views horizontally or vertically:
#iostipschallenge day 17 Today's tip is a list of small examples that could help make your Swift code cleaner and avoid repetition. Did you know all of them?
#iostipschallenge day 16 Advanced: Have you used libdispatch's target queues before? Coupled with resume/suspend, it makes it super easy to pause work and resume it later. Libdispatch handles it all for you! Can you guess what happens in this example?
#iostipschallenge day 15 Want a rounded rectangle, with a corner radius only applied to *some* corners? Use this extension on View:
#iostipschallenge day 14 Using auto-layout and occasionally forget to call ``translatesAutoresizingMaskIntoConstraints = false`? We've all been there. Instead, use a `@UsesAutoLayout` property wrapper that automatically makes the call for you.
#iostipschallenge day 13 Give your text a friendlier, more fun vibe by using a `.rounded` design instead of the default one. The system will opt for "SF Pro Rounded".
#iostipschallenge day 12 Audit your app through the Accessibility Inspector (Xcode menu → Open Developer Tool → Accessibility Inspector) to find potential usability/accessibility issues in seconds.
#iostipschallenge day 11 Combine's `assign(to:on:)` captures the `on` parameter strongly, potentially creating reference cycles. Likewise, I'm forced to do the [weak self] dance in Combine's `sink(receiveValue:)` to avoid cycles. `weakAssign` and `weakSink` to the rescue:
#iostipschallenge day 10 To add a gradient to your navigation bar large title: - Create a CAGradientLayer from my color array - Convert layer to image - Creating a UIColor from the image via UIColor.init(patternImage:) - set scrollEdgeAppearance.largeTitleTextAttributes