#SceneDelegate
Explore tagged Tumblr posts
Text
Cleaning AppDelegate or SceneDelegate Using ViewControllerFactory
Factory Design Pattern Illustration Overview AppDelegate or SceneDelegate is the main file that we as iOS developers know to configure, inject, or instantiate a global instance or frameworks. This place become essential, especially because it is actually the starting point of our app. Because it knows so many things, like configuring the frameworks, handling push notifications routing,…
View On WordPress
#AppDelegate#Design Pattern#Factory Design pattern#Factory in iOS#Good Programming Practice#iOS#Ios Development#SceneDelegate#Software Development#Software Engineering
0 notes
Text
iOS 13, SwiftUI and older devices like the iPhone 6.
There's a lot of talk about iOS 13 and SwiftUI. It's a much more programatically pure way of building simple interfaces or initial interfaces in Swift. It's fantastic!
However, older Apple devices are not going to support iOS 13 or SwiftUI, at least that is the current rumor as of mid August 2019.
Have no fear though, you can have your apps know the difference and still use the existing UIView elements (which are in iOS 12) to be able to support them.
You'll first need to change the iOS Deployment target to 12.4 on both the Project Info and the Project Build Settings. Make sure it's also set that way in the Project Target Build Settings.
After that you'll need to exclude any declarations in your Swift code that use SwiftUI from being used when the iOS version is less than 13.0
Here's how to apply #available to differentiate between iOS versions.
if #available(iOS 13.0, *) { // code for iOS versions greater than 13.0 } else { // code for iOS versions less than 13.0 }
You can use it to include or exclude an entire func, struct, protocol, class or any other declaration.
You will need to use this in SceneDelegate, AppDelegate and of course any other swift files where you have declarations that use SwiftUI.
@available(iOS 13.0, *) struct ContentView: View { }
The last thing you'll have to do in order to have the project work on both iOS 12.4 and iOS >13.0 is remove the SwiftUI Framework and re-add it as optional rather than required.
In the left pane in XCode, right click on SwiftUI.framework within Frameworks and delete it. Then go to the Project Target Build Phases and open Link Binary With Libraries. Click the + to add a new library, select SwiftUI and click Add. Once it's added on the Build Phases page you'll see the Status is set to Required, change it to Optional.
Here are the devices iOS 13 runs on.
iPhones iPhone XS iPhone XS Max iPhone XR iPhone X iPhone 8 iPhone 8 Plus iPhone 7 iPhone 7 Plus iPhone 6s iPhone 6s Plus iPhone SE iPod touch (7th generation)
Apple has dropped support for iPhone 5s, iPhone 6, and iPhone 6 Plus.
iPads
12.9-inch iPad Pro 11-inch iPad Pro 10.5-inch iPad Pro 9.7-inch iPad Pro iPad (6th generation) iPad (5th generation) iPad mini (5th generation) iPad mini 4 iPad Air (3rd generation) iPad Air 2
Apple has dropped support for iPad mini 2, iPad mini 3, and the original iPad Air.
2 notes
·
View notes
Text
HackingWithSwift Day 33/34/35 - Project 7
Here introduce to UITabBarController
“Swift has built-in support for working with JSON using a protocol called Codable. When you say “my data conforms to Codable”, Swift will allow you to convert freely between that data and JSON using only a little code.”
Definition by the author, let’s see how powerful is this.
So it’s quite convenient to parse the json data into swift native support data type, instead of self declare and unwrap it layer by layer.
Only 1 thing is the window code to add a new tab, I think it’s time to update it using SceneDelegate since window is omitted from AppDelegate with the latest Xcode.
Seems like Codable usage is very wide, might need more research on this
0 notes
Text
Week 394
Happy Thursday! I wrote last week that Xcode 13 Beta 3 was released, and indeed it was. And then, two days later, it was re-released. According to @XcodeReleases it seems it's mostly the same, but the re-release fixes something related to Xcode Could (for those who were lucky to get access to the beta 🥺).
Marius Constantinescu
Tips from Twitter
Hacking with Swift: Live! diversity scholarship: Paul Hudson and his team are organizing the 3rd edition of Hacking with Swift: Live! and they have a huge batch of free diversity tickets, so if you're from an under-represented category in our community, reach out to Paul to apply.
Watch out for retain cycles: a reminder from Eneko Alonso to avoid retain cycles when working with Combine.
Articles
Benchmarking Swift Code Properly with Attabench, by @rockbruno_
Dependency Injection in Swift using latest Swift features, by @twannl
How to add an AppDelegate and a SceneDelegate to a SwiftUI app, by @zntfdr
Cooperative Task Cancellation, by @peterfriese
Experimenting with ShazamKit- Let’s Shazam Everything!, by @rudrankriyam
Fixing a hard-to-find bug in Dark Mode, by @jesse_squires
SwiftUI Swipe Actions, by @kharrison
Dynamic button configuration in iOS 15, by @sarunw
Tools/Controls
EUDCCKit - EU Digital COVID Certificate Kit for the Apple Platform (unofficial), by @SvenTiigi
Business/Career
Launching an Indie App - Part 13: Growing in Momentum, by @michael_tigas
Videos
Never use User Defaults to store sensitive data!, by @v_pradeilles
Contributors
zntfdr, peterfriese, SvenTiigi, mecid, michael_tigas, sarunw
0 notes