https://gist.github.com/lalkrishna/c1b33cba4dbacddbc1ecc9d619877c42
-
Project settings -> Select Framework Target -> Build settings add
-fembed-bitcodein Other C Flags -
click + Button -> Add User-Defined Setting Key: BITCODE_GENERATION_MODE
https://gist.github.com/lalkrishna/c1b33cba4dbacddbc1ecc9d619877c42
Project settings -> Select Framework Target -> Build settings
add -fembed-bitcode in Other C Flags
click + Button -> Add User-Defined Setting Key: BITCODE_GENERATION_MODE
| import UIKit | |
| class SelfSizedTableView: UITableView { | |
| var maxHeight: CGFloat = UIScreen.main.bounds.size.height | |
| override func reloadData() { | |
| super.reloadData() | |
| self.invalidateIntrinsicContentSize() | |
| self.layoutIfNeeded() | |
| } |
| // MARK: - Usage | |
| func application(_ application: UIApplication, | |
| didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { | |
| UIFont.registerAllCustomFonts() | |
| // Or You can add manually, | |
| // https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app | |
| return true | |
| } | |
| // Using Default family name |
| enum Storyboard: String { | |
| case main = "Main", | |
| onboarding = "Onboarding" | |
| } | |
| protocol Instantiatable { | |
| static var storyboard: Storyboard { get } | |
| static func instantiate() -> Self | |
| } |
| struct UpdateManager { | |
| let updateURL = "https://api.github.com/repos/{user_name}/{repo_title}/releases/latest" | |
| static let shared = UpdateManager() | |
| private init() { } | |
| func checkForUpdates(updateAvailable: @escaping (String?) -> Void) { | |
| let session = URLSession(configuration: .default) | |
| let updateTask = session.dataTask(with: URL(string: updateURL)!) { (data, response, error) in | |
| DispatchQueue.main.async { | |
| guard let data = data else { |
| class UseItHere { | |
| func readFile() { | |
| let fileReader = StreamingFileReader(path: logFile) | |
| while let line = fileReader.readLine() { | |
| // Do something with the line | |
| } | |
| } | |
| } | |
| class StreamingFileReader { |
| extension UIApplication { | |
| var topViewController: UIViewController? { | |
| if #available(iOS 13.0, *) { | |
| if UIApplication.shared.supportsMultipleScenes, let keyWindow = UIApplication.shared.windows.first(where: { $0.isKeyWindow }) { | |
| return keyWindow.visibleViewController | |
| } else { | |
| return UIApplication.shared.keyWindow?.visibleViewController | |
| } | |
| } else { | |
| return UIApplication.shared.keyWindow?.visibleViewController |
| https://medium.com/swift2go/mastering-generics-with-protocols-the-specification-pattern-5e2e303af4ca | |
| https://www.hackingwithswift.com/read/30/4/fixing-the-bugs-slow-shadows | |
| https://www.raywenderlich.com/261-how-to-make-a-uiviewcontroller-transition-animation-like-in-the-ping-app#toc-anchor-007 | |
| https://medium.com/@phanquanghoang/using-gitlab-ci-cd-fastlane-for-ios-project-part-1-5e7db82a3566 | |
| https://developer.apple.com/documentation/metrickit/improving_your_app_s_performance/ |