Swift
たまにプラグインで必須じゃないメソッドがあるProtocol(インターフェイス)みたいなのをたまに見る。 実装というか準拠先にインターフェイス ※プロトコルの場合は「継承する(させる)」ではなく「準拠する(させる)」 どうやるのか調べた。 https://stackove…
ez-net.jp Any.Type, AnyClassとかある。
Hoge みたいな型を配列として入れたい var nonScorllVCs: [Any.Type] = [Hoge.self] Swift の変数で型を扱う
hogeRecognizer よりも他のtableViewの優先順位を高める const hogeRecognizer = UILongPressGestureRecognizer( target: self, action: #selector(self.hogeMethod) ) みたいな hogeRecognizer がある時 以下のようにする if let gestureRecognizers = tabl…
reactive programming - What is the difference between .subscribe and .drive - Stack Overflow xxx.rx.isOn.asObservable() .subscribe(onNext: { [weak self] bool in xxx.rx.isOn.asObservable() .subscribe を asObservable() なしで subscribe xxx.r…
0 じゃないとだめなのか 0.0でやるか? as Doubleいるかどうか。 let a: Double = 0 if a == 0 { print("== 0") } else { print("== 0じゃない") } if a == 0 as Double { print("== 0 as Double") } else { print("== 0 as Doubleじゃない") } if a == 0.0 …
https://stackoverflow.com/questions/67925525/async-call-in-a-function-that-does-not-support-concurrency-swift-ios-xcode-asy Task で囲むっぽい そうしないと await できないみたい。
func application( _: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { for item in options.userActivities { if item.activityType == NSUserActivit…
UIProgressBarの色の変更 一見、XcodeのbackgroundColorとtintColorを使うのと思ってしまうが それをやると微妙に色合いが変になる! こいつらは.clearとかにしておく。 https://developer.apple.com/documentation/uikit/uiprogressview 実際のゲージprogre…
Xcodeではできないが、 UITextfieldのplaceholderの色の変更は不可能と思われていたが TextFieldのattributedPlaceholderのパラメーターで可能 self.myTextField.attributedPlaceholder = NSAttributedString( string: "文字", attributes: [NSAttributedStr…
must register a nib or a class for the identifier or connect a prototype cell in a storyboard 右から4番目の「Restoration ID」ではなく、右から3番目の「identifier」
video保存 neos21.net
nilなので let tmpTimeStamp: Timestamp? = data["date"] as? Timestamp if let timeStamp = tmpTimeStamp { date = timeStamp.dateValue() } else if let tmpDate = message.get("date", serverTimestampBehavior: .estimate) as? Timestamp { // FieldValu…
https://gist.github.com/FromAtom/f078bbe73301ec6a4e2e12a1b3ec62de 隠したいものの親ビュー作るのがミソ(対象はUICollectionViewでもOK)、上下を左右にするには // 左右にする gradient.startPoint = CGPoint(x: 0, y: 0.5) gradient.endPoint = CGPoin…
kt-zoe.com shibuya-3percent.hatenablog.com
まずUIViewControllerで拡張変数作成 addedBool public extension UIViewController { private struct additional { static var addedBool: Bool = false } var addedBool: Bool { get { guard let theBool = objc_getAssociatedObject(self, &additional.ad…
UIViewControllerを拡張して、StringやBoolが保存できる vc.addedString = "Str" vc.addedBool = true public extension UIViewController { private struct additional { static var addedString: String = "" static var addedBool: Bool = false // TODO:…
https://stackoverflow.com/questions/35766425/hide-navigation-bar-after-dismiss-controller https://www.codegrepper.com/code-examples/swift/how+to+remove+the+nav+bar+from+navigation+controller+in+swift
let calendar = Calendar.current これは年を使うときに危ない危険 ↓このiPhone設定が仏暦とか和暦だとやばい。 iphone-howto.jp dev.classmethod.jp let calendar = Calendar(identifier: .gregorian) かならずgregorian を使うこと。
Combine: Asynchronous Programming with Swift (First Edition) Combine: Asynchronous Programming with Swift (First Edition)作者:Tutorial Team, raywenderlich,Gardner, Scott,Mishali, Shai,Pillet, Florent,Todorov, Marin発売日: 2019/12/05メディ…
Details Failed to set plugin placeholders for com.shinriyo.taskmaster Domain: IXErrorDomain Code: 2 Failure Reason: Failed to create promise. User Info: { FunctionName = "+[IXPlaceholder _placeholderForBundle:client:withParent:installType:…
https://hacknote.jp/archives/13726/ UIApplication.shared.applicationState == .backgroundはバックグラウンド
https://qiita.com/motokiee/items/cf83b22cb34921580a52 qiita.com
https://qiita.com/k5n/items/44ef2ab400f47fb66731 RxSwift subscribe RxCocoa drive RxSwift における subscribeOn と observeOn の違い RxSwift における subscribeOn と observeOn の違い - Qiita
Swift UI https://developer.apple.com/tutorials/swiftui/creating-a-watchos-app 古い?TODO https://pusher.com/tutorials/to-do-list-apple-watch#building-our-watchos-app Qiita watchOS 6 の注目点をふまえてSwiftUIでWatch Appを作ってみた!! - Qiita
わかりやすい記事 どこよりも分かりやすいSwiftの"?"と"!" - Qiita https://tech.pjin.jp/blog/2016/06/24/%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%8A%E3%83%AB%E5%9E%8B%E3%81%AE%E5%BE%A9%E7%BF%92%E3%81%9D%E3%81%AE4/ Thread 1: Fatal error: Unexp…
[LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2)…
Swift
SwiftUIでカメラ https://stackoverflow.com/questions/58250976/i-need-to-be-able-to-open-the-camera-in-swiftui-and-take-a-photo-in-an-app swift - I need to be able to open the camera in SwiftUI and take a photo in an app - Stack Overflow Fac…
http://www.366service.com/jp/qa/bb01b73f1b93b54cecb08193232db9f3 /Users/name/Library/Developer/Xcode/Archives/2020-04-27/Runner 2020-04-27 15.36.xcarchive/Products/Applications/Runner.app nm Runner | grep UIWeb