https://blog.csdn.net/bjrxyz/article/details/73435407 ⭐️⭐️⭐️⭐️⭐️
https://github.com/CivelXu/iOS-Lame-Audio-transcoding ⭐️⭐️⭐️⭐️
class GradientView: UIView { | |
var gradientLayer: CAGradientLayer { | |
return layer as! CAGradientLayer | |
} | |
override class var layerClass: AnyClass { | |
return CAGradientLayer.self | |
} | |
} |
// https://www.avanderlee.com/swift/authentication-alamofire-request-adapter/ | |
/// The storage containing your access token, preferable a Keychain wrapper. | |
protocol AccessTokenStorage: class { | |
typealias JWT = String | |
var accessToken: JWT { get set } | |
} | |
final class RequestInterceptor: Alamofire.RequestInterceptor { |
import UIKit | |
class ViewController: UIViewController { | |
var textField: UITextField! | |
var textView: UITextView! | |
private let maxLength = 20 | |
override func viewDidLoad() { | |
super.viewDidLoad() |
https://academy.realm.io/posts/krzysztof-siejkowski-mobilization-2017-rxswift-deep-cuts/ https://www.polidea.com/blog/8-Mistakes-to-Avoid-while-Using-RxSwiftPart-1/
Judging by the number of talks, articles and discussions related to reactive programming in Swift in general and the RxSwift library in particular, it looks like the community has been taken by the storm. The concept of reactiveness, however, is not a new shiny thing. The idea of using it for the development within the Apple ecosystem had been played with for a long time. Frameworks like ReactiveCocoa had existed for years and did an awesome job at bringing the reactive programming to the Objective-C. When Swift appeared with its new and exciting features, the way was paved for RxSwift, the elegant and compact port of C#-originated Reactive Extensions. It became even more convenient to go full in on the “signals as your apps’ building blocks” model.
https://www.avanderlee.com/ 有几篇还不错的可以拿来用的代码
https://www.swiftbysundell.com/ 有很多值得学习的编程思想
https://www.vadimbulavin.com/ 推荐他的底层原理系列文章
// https://www.avanderlee.com/swift/asynchronous-operations/ | |
class AsyncOperation: Operation { | |
private let lockQueue = DispatchQueue(label: "com.swiftlee.asyncoperation", attributes: .concurrent) | |
override var isAsynchronous: Bool { | |
return true | |
} | |
private var _isExecuting: Bool = false |
//https://developer.apple.com/videos/play/wwdc2019/212 | |
extension UserDefaults { | |
private static let isInfoBarHiddenKey = "IsInfoBarHidden" | |
@objc dynamic var isInfoBarHidden: Bool { | |
get { bool(forKey: UserDefaults.isInfoBarHiddenKey) } | |
set { set(newValue, forKey: UserDefaults.isInfoBarHiddenKey) } | |
} | |
} |