Data dodania Pytanie
2017-11-30 01:11 How does one use Swift protocol extensions to create shared code that can modify private properties? »
Hypothetical scenario: There are classes: ClassA; and ClassB. Both implement ProtocolC, which contains the single requirement func createKey(). Proto...
(2) odpowiedzi
2017-11-29 17:11 'Normal' is excplicitly unavailable in Swift 2 »
I'm taking a course on Udacity, the program has been taught with an older version of Xcode. Still trying to figure out the differences with the new v...
(2) odpowiedzi
2017-11-29 13:11 Understanding breakpoints and threads in swift »
I am trying to wrap my head around debugging and threads in Swift/Xcode. I have added a breakpoint to the beginning of a method and in the callstack, ...
(1) odpowiedzi
2017-11-29 12:11 Record callback function in Swift with Superpowered or AudioKit audio libraries »
My app (coded in swift) does realtime processing based on audio signals. I need to get a function with the left and right buffers coming from the inp...
(2) odpowiedzi
2017-11-29 02:11 Request location on the Apple Watch only, without code on the paired phone »
I've looked everywhere including Apple's sample app. But I can't find anywhere when I can request location without needing any code running on the pho...
(1) odpowiedzi
2017-11-28 20:11 UITableViewCell reordering style in iOS 11 »
I have a UITableView which allows reordering. In all iOS versions before 11 the cell that is currently reordered is shown properly (just slightly tran...
(1) odpowiedzi
2017-11-28 20:11 Swift UITableView Show Different Cell Every 10th Cell »
I'm trying to show a different cell after every 10 cells using two arrays: "ads" and "requests" I want my TableView to look like this: "Request" "Req...
(3) odpowiedzi
2017-11-28 16:11 Wrong camera position playing 360 degree video, using SceneKit and CoreMotion »
I am playing around with a 360 degree video player using SpriteKit, SceneKit and CoreMotion. The player is working so far, but the video is always zoo...
(1) odpowiedzi
2017-11-28 10:11 Reference class definition from prefix header in swift »
I'm adding swift code to an existing Objective-C project. I'm having problems referencing a definition from the existing prefix header. I have a clas...
(1) odpowiedzi
2017-11-28 08:11 Reading Data into a Struct in Swift »
I'm trying to read bare Data into a Swift 4 struct using the withUnsafeBytes method. The problem The network UDP packet has this format: data: 0102 ...
(3) odpowiedzi
2017-11-27 23:11 Can I force the compiler to fail when some protocol functions change their signature? »
Is there a way to mark some Swift functions as implementing some protocol functions so that if the protocol's signature changes, the compiler can mark...
(3) odpowiedzi
2017-11-27 19:11 Matchmaking and Swift »
I'm working with a multiplayer game using Swift, SpriteKit and Firebase. It's the first time I'm using multiplayer and GameKit so I don't get the co...
(0) odpowiedzi
2017-11-27 14:11 Sort Array of Objects With Some Conditions »
I have an array of Users objects: Class Users { var firstName:String! var lastName:String! var status:Int! override init(fn: Strin...
(3) odpowiedzi
2017-11-26 22:11 Adding dark mode to iOS app »
I am trying to add a theme to my app (a dark theme). So when the user clicks an activity switch it would then make the whole app go into the dark mode...
(2) odpowiedzi
2017-11-26 12:11 Why Locale.current.identifier is invalid? »
The problem arises when setup the "Language & Region" (Settings => General => Language & Region) as follows: "iPhone Language" to "English (...
(2) odpowiedzi
2017-11-26 06:11 UITextfield text going beyond bounds »
How do I keep a textfield's text from going beyond its showable bounds? I am trying to make the textfield's width grow as the text inside of it gro...
(1) odpowiedzi
2017-11-25 19:11 "unrecognized selector" error with bridging header even it's added in settings »
I added the .h and .m files of this project and created a bridging header. I made sure that the bridging header location is entered correctly in proje...
(2) odpowiedzi
2017-11-25 15:11 Accessing Objective-C Pointers in Swift »
I have this Objective-C Code fragment, which I want to express in Swift CFArrayRef windowList; AXUIElementCopyAttributeValue(appRef, kAXWindowsAttrib...
(2) odpowiedzi
2017-11-25 14:11 Unresolved Identifier from #define in imported Objc header file »
i have an Obj-c class "constants.h" that looks like this: // constants.h #import <Foundation/Foundation.h> @interface constants : NSObject #...
(2) odpowiedzi
2017-11-25 12:11 Binary operator '>=' cannot be applied to operands of type 'String.IndexDistance?' (aka 'Optional<Int>') and 'Int' »
in Swift 4 I'm trying to compare the length of the text of an UITextField with a minimum length: if textFieldPassword.text?.count >= 8 { ...
(1) odpowiedzi
2017-11-25 12:11 JTAppleCalendar Custom cell bug on cellForItemAt date in Swift 3.2 »
I added JTAppleCalendar inside my project and I want to add some tags in some of my calendar cells. I have success adding them, but when I scroll left...
(2) odpowiedzi
2017-11-25 01:11 sqlite3_open works in swift playground not swift app »
when I run the following code in swift playground it returned success. When I copied it to my Xcode project it returned failure. I figure it has som...
(1) odpowiedzi
2017-11-24 19:11 Retreive data from Firebase »
I have been trying (without success) to retrieve a list of users in a group from a Firebase database; and I was wondering if its possible based on my ...
(1) odpowiedzi
2017-11-24 13:11 Creating MIDI files on the fly using Audiokit »
I'm currently using the following method to play stems in a song: Load stem_01.mp3 into AKAudioFile Add AKAudioFile to AKMIDISampler Add AKMIDISampl...
(0) odpowiedzi
2017-11-24 10:11 Generate JWT for Apple Music API with online editor »
I read the full documentation https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/AppleMusicWebServicesReferenc...
(0) odpowiedzi
2017-11-24 09:11 Passing a swift function as a parameter in objective-c »
I have a swift class, A, which accepts delegates. I have another swift class, B, which implements the delegates. Now the object of A is instantiated f...
(1) odpowiedzi
2017-11-23 19:11 Cast from '(NSNumber) -> NSNumber' to unrelated type '(Any) -> Any' always fails »
I convert this Objective-C function: - (NSArray *)grt_map:(id (^)(id))block { NSMutableArray *newArray = [NSMutableArray array]; [self enumer...
(1) odpowiedzi
2017-11-23 15:11 Preventing completion handler to be executed synchronously »
I'm writing some networking code in Swift that prevents initiating a download that is already in progress. I do this by keeping tracking of the identi...
(2) odpowiedzi
2017-11-23 13:11 TextView not moving up with keyboard »
I am using JSQMessageController in my chat application. In that view controller i have added one more text view at the top to add recipients. JSQMessa...
(0) odpowiedzi
2017-11-23 13:11 AudioKit File Normalization »
I'm trying to normalize audio file after record to make it louder or vice versa, but i'm getting error WARNING AKAudioFile: cannot normalize a silent ...
(1) odpowiedzi
2017-11-22 22:11 How works "guard case let" for non-enums »
Please, can anyone explain why this works? func howMany() -> Int {return 11} guard case let output = howMany(), output > 10 else {return} I u...
(1) odpowiedzi
2017-11-22 22:11 How to extract AVMetadataObject info from UIImage »
I am trying to read QR from UIImage. I know we can do this using AVFoundation from iOS 7 (AVMetadataObject.ObjectType.qr). i ended with sample app whi...
(0) odpowiedzi
2017-11-22 19:11 Can't use FBSDKShareVideo without ENABLE_BITCODE Linker command error »
I have the latest Bolts, FBSDKCoreKit, FBSDKLoginKit and FBSDKShareKit as part of the Facebook SDK frameworks which I am using in Swift. In a Swift fi...
(0) odpowiedzi
2017-11-22 18:11 Create a weak container in Swift that accepts a native Swift protocol »
Here's the standard boilerplate weak container in Swift. struct Weak<T: AnyObject> { weak var value: T? init(value: T) { self.value = v...
(1) odpowiedzi
2017-11-22 11:11 Why my #selector is not working? »
I have a function: @objc func handleLongPress(data: SkelbimasModel, _ gestureRecognizer:UIGestureRecognizer){ if gestureRecognizer.state != .be...
(2) odpowiedzi