Questions tagged [ios]
243689 questions
1
votes
2
answer
3.1k
Views
Custom PageControl image - Swift
I am trying to set an image for UIPageControl dots.
I need to change the default dots, instead of that I need an image.
I used the below code
self.pageCtrl.currentPageIndicatorTintColor = UIColor.init(patternImage: UIImage(named: 'Page Indicator_Selected')!)
self.pageCtrl.pageIndicatorTintColor = UI...
1
votes
1
answer
527
Views
filter objects with two nested levels in a query with Realm
I have a model like this:
class CalendarEvent: Object, Mappable {
dynamic var exId = ''
@objc dynamic var title:String = ''
@objc dynamic var desc:String = ''
dynamic var fullDate = Date()
dynamic var date = ''
dynamic var time = ''
dynamic var location = ''
dynamic var subcategory:Subcategory?
dyna...
1
votes
1
answer
736
Views
react native xcode library not found for -lBranch-SDK
I have react native v0.49.
After installing react-native-branch with this link
link to react-native-branch, I try to run with xcode and I get the error
ld: library not found for -lBranch-SDK
in addition,when I run react-native-link I get
react-native-branch ERR! Failed to add file to project
1
votes
3
answer
416
Views
Create a UICollectionView with a reversed flow layout
I want to create a view that resembles a chat view, where the newest message appears at the bottom of the screen. I would like the UICollectionViewCells to be 'pinned' to the bottom of the screen - the opposite of what the default flow layout does. How can I do this?
I've got this code from another...
1
votes
1
answer
1.3k
Views
Swift Query Into Firebase Firestore Nested Array
I have nested data that I'd like to display in a tableView.
My data is structured like so...
/users
/userid
name: 'John'
age: 23
/likedPosts
0:post1
1:post2
For the tableview I'd like to display these posts (which have their own collection of data).
In order to do that I need to...
1) Get the coun...
-1
votes
3
answer
24
Views
How to convert Array of string to Array of URL?
Need to convert array of string value to array of URL. Some one help me to convert the String array to URL array in swift.
0
votes
0
answer
17
Views
Why is iOS not showing keyboard for input after js has unset a readonly tag?
I have a text field in HTML form set to readonly. Upon entry javascript should test if the field is currently being edited by someone else, if not the readonly will be set to false and editing of that field is allowed. For this I have used the onFocus() event.
This works fine in Chrome and Firefox b...
0
votes
0
answer
3
Views
Is markup formatting just for Swift playgrounds?
In swift file, I don’t see editor _ show rendered markup button.
For example.
//: - Experiment:
//: Modify the anyCommonElements(_:_:) function to make a function that returns an array of the elements that any two sequences have in common.
//:
How can I show this in rendered markup mode in swift f...
3
votes
1
answer
71
Views
iOS Resuming HLS download and deleting partially downloaded file
I am implementing HLS streaming as per Apple Docs
But the problem that I am facing is for resuming the download when the user kills the app. If a download is in progress and say its 50% done and the user kills the app or app is killed by the system due to any reason and when the app is alive again...
1
votes
1
answer
100
Views
Find nearest number in Core Data without iterating over data
I know it's currently not possible to find the nearest geo-location in Core Data without loading all data and doing it manually in code,
but is it at least doable with simple numbers?
Can I, for example, have a table with entries, with the values 1, 2.5, 4, I search for 3.6 and get back the entry wi...
1
votes
1
answer
407
Views
ARKit floating planes
Sometimes ARKit creates plane over existing one. It doesn't merge them. I am testing ARKit with iPhone 7 in closed space. Object placed on that plane appears to float in space. This scenario doesn't happen often, and I can't reproduce it all the time. Can someone tell me how to prevent overlapping a...
1
votes
1
answer
203
Views
UIGestureRecognizer created in UIView code not working
I've got a custom subclass of UIStackView that's got some UIImageViews inside it. I want the view to accept a pan gesture to track a slow swipe across its surface. When I configure a UIPanGestureRecognizer in Interface Builder it works, but not in code. Here's an abbreviated version of the class:
@I...
1
votes
1
answer
628
Views
iOS - Trigger outgoing VOIP Call on clicking the caller in the native iOS Recent call table view
I have implemented the CallKit for my App to trigger/receive both Audio and Video Call within our App by using WebRTC. Which is working seamlessly without any problem.
As I see there are 3 ways to trigger a call from Call Kit.
Performing an interaction within the app
Opening a link with a supported...
1
votes
1
answer
1.2k
Views
Copy file with swift
I am copying a file database with this code
try fileManager.copyItem(atPath: storeURL.path, toPath: storeCopyURL.path)
I can see that a new sqlite database is created
later, when I try to use this function
try! sharedInstance.managedObjectStore.addSQLitePersistentStore(atPath: storeURL.path, fromSe...
1
votes
1
answer
185
Views
Stop Sound playing on Node in SceneKit
I have the following code for a gesture recogniser that plays a horn, when tapped, and stops when it is released:
@objc func didPressHorn(_ sender: UILongPressGestureRecognizer) {
let tapLocation = sender.location(in: sceneView)
if sender.state == .began {
if (wasNodeTapped(node: hornNode!, tapLocat...
1
votes
2
answer
254
Views
Can't get permission to firebase database IOS
I can't get permission to database.
In xcode console I am getting this message:
[Firebase/Database][I-RDB038012] Listener at /skelbimai failed: permission_denied
So I went to firebase database, then Rules and changed like this:
service cloud.firestore {
match /databases/{database}/documents {
matc...
1
votes
3
answer
562
Views
Can I upload two versions of the application for review in the iTunes connect?
I have 1.1 version of my application already in review process now I also want to upload 1.1 version of the application for review process.
So that if anything bad happens to version 1.1, I could directly release 1.2 without going through review process (as it would have been done already). So, I w...
1
votes
2
answer
520
Views
Getting memory usage Live/Dirty Bytes in iOS app programmatically (not Resident/Real Bytes)
According to what I've read so far, real/resident bytes indicates the number of bytes allocated to the app including bytes that the app is no longer using but hasn't been reclaimed by the OS.
And live/dirty bytes is the bytes the the app is actually using and the OS can't reclaim.
I think that the...
1
votes
1
answer
111
Views
Why does resizing a label require a delay to update as expected when coming from NotificationCenter?
I'm in the process of adding dynamic type to my app and I'm trying to update the frame of a programmatically created UILabel when the UIContentSizeCategoryDidChangeNotification notification is fired through the following code:
private func configureNotificationCenter() {
NotificationCenter.default.a...
1
votes
4
answer
69
Views
Stored UIColor as Strings in NSMutableArray but unable to display the colors
Below is my NSMutableArray:
NSMutableArray *bgColorArr = [NSMutableArray arrayWithObjects:
@'[UIColor colorWithRed:0.90 green:0.22 blue:0.21 alpha:1.0]',
@'[UIColor colorWithRed:0.26 green:0.63 blue:0.28 alpha:1.0]',
@'[UIColor colorWithRed:0.85 green:0.11 blue:0.38 alpha:1.0]',
@'[UIColor colorWith...
1
votes
2
answer
2.6k
Views
Flutter increase height of TextFormField
I am creating a Flutter app. i made the design like this.
My TextFormField form field for email and password heights are small. I want it to be the same size of the button.
final email = TextFormField(
keyboardType: TextInputType.emailAddress,
autofocus: false,
initialValue: '[email protected]'...
1
votes
1
answer
1.2k
Views
Swift 4 Alamofire multipart upload not working
I am using alamofire 4.7 and swift 4
I need to upload image and json to server.
I am using the following code below for uploading bu I am getting result failure but data is inserting in server but not getting response, showing some serialization error as something like this
▿ result : FAILURE: re...
1
votes
1
answer
124
Views
UITests failing when run in group but succeed when run independently
I'm currently working on a project with many asynchronous code and I'm writing the UITests for this project. During the development I run them one by one but never in a group. So I thought the tests are succeeding. But when testing them all together most of them are failing. I implemented the setup...
1
votes
1
answer
499
Views
Swift - Is There A “Dictionary With Duplicate Keys” Workaround?
Currently I am working with alamofire to send post requests to a certain site. In the paramaters of the post request, there is a duplicate key entry that is required to send the post request, but when I am making the dictionary and enter both keys as string literals, I receive the nasty 'Duplicate K...
1
votes
1
answer
1.3k
Views
What is the proper way to change the name of a ViewController class in Swift?
When I change my ViewController class name after it's been created and assigned to a view controller in storyboards I run into problems with the IBOutlets of that view controller, and Xcode does not automatically show the corresponding class in the assistant editor when I click the scene.
I've chang...
0
votes
1
answer
25
Views
Custom views are not showing up properly
I am trying to show 3 custom views in an iOS screen but only one of them is showing up. 2nd one started showing up a bit in improper way after putting alot of constraints and third one is completely not showing up.For test I am calling the same view three times. See the code. I have just started doi...
0
votes
2
answer
19
Views
Accessing rightBarButton function from another ViewController in Swift
I'm trying to access the rightBarButton function for showing cart from an another ViewController, although I can call that function but it won't display any image i.e cart image
Below code show how am i calling this function.
override func viewDidLoad() {
super.viewDidLoad()
// Adding Right Bar Butt...
0
votes
0
answer
12
Views
error values Optional(Error Domain=kCLErrorDomain Code=8 “(null)”)
I am using mapkit to show locations, for search location, when the user type the location that location showed in mapkit. implemented custom search with autofilled locations, all are working fine. but when I click the some locations name in tableview it is showing
Error Domain=kCLErrorDomain Code=8...
0
votes
0
answer
4
Views
TouchUpInside without LinkAttribute in ASTextNode
I have one text (ASTextNode)
let contentNode = ASTextNode()
contentNode.maximumNumberOfLines = 7
contentNode.truncationMode = .byTruncatingTail
contentNode.isUserInteractionEnabled = true
contentNode.delegate = self
and in contentNode have link
I setup touchUpInSide for contentNode
contentNode.addTa...
0
votes
0
answer
5
Views
How to retrieve an environment texture (MTLTexture) cubeMap and change to Spherical Harmonics
I would like to save the auto-generated environment texture from an ARWorldTrackingConfiguration, and then load that same texture later into a different tracking configuration to be added to a model. How is this done?
I have looked through everything I could find online and looked through Apple's do...
0
votes
0
answer
4
Views
Build grpc in qT for iOS / Android Targets from Mac
I am having undefined errors when attempting to build qt app in Xcode for iOS target. Errors are lib issues with arm64 and undfined grpc methods. I added the protobuf 3.7.1 lib root project folder and referenced in pro file. Also, added grpc 1.20 cpp libs.
Now I am not sure if my cross platform com...
1
votes
1
answer
140
Views
Make circle with slice cut out? iOS Swift 4
I'm trying to create a very simple colored circle inside a UIView with a slice cut out or in a different color, something like this:
I expected that this would be very simple and would only require a few lines of code since CAShapeLayer allows you to create all sorts of shapes. However, it seems tha...
1
votes
2
answer
54
Views
In Xcode, how would you go about having view controllers which are only accessible to the user if they perform a certain action in the app?
The app I am making has multiple pages which the user swipes between. I need the user to be able to press a button and that create a new page in the app, and then also for the user to be able to delete that page of the app. Is there a way to generate/delete a view controller while the app is in use?...
1
votes
1
answer
270
Views
How to remove bottom border of navigation bar with large title?
For navigation bar with small title, we could add these 2 lines in viewDidLoad to make the border disappear:
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
navigationController?.navigationBar.shadowImage = UIImage()
However, when I do this for navigatio...
1
votes
1
answer
228
Views
3D Touch: registerForPreviewing in UICollectionViewCell
Here the scenario is, UICollectionView is in UITableViewCell and UITableView is on UIViewController, now I have to use UILongPressGestureRecognizerif 3D Touch is not available I need to register it in UICollectionView Cell, UILongPressGestureRecognizer is working perfectly, but I'm not able to regis...
1
votes
1
answer
390
Views
Setting HTTP Header Fields for AVURLAssets
I'm attempting to load a video file that requires a token in the header. I learned on Stackverflow that this may be possible from looking at the following question. The problem is that I don't believe AVURLAssetHTTPHeaderFieldsKey is public or I have written my asset variable incorrectly. What I'...
1
votes
1
answer
1.6k
Views
Module 'react' does not exist in the Haste module map
I am trying to do LinkedIn integration in my app.
So, I have done as below :
Installed dependency as below :
npm install react-native-linkedin --save;
So, while launching the app, am getting below error :
Failed to load bundle(http://localhost:8081/index.bundle?
platform=ios&dev=true&minify=false...
1
votes
1
answer
787
Views
In App Purchases in React-Native Expo?
I'm wondering if there is a way to implement in-app purchases in Expo for an app that I'm developing. As I researched online, I haven't found a clear answer.
Could anyone help Please?
1
votes
1
answer
58
Views
How to fix blink issue Create Checkbox using image in Xamarin Forms?
This is the CheckBox.xaml
This is CheckBox.Xaml.cs .
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace CheckBoxSample.Controls
{ ///
/// Custom checkbox control
///
[XamlCompilation(XamlCompilationOptions.Compile)]
public pa...
1
votes
2
answer
415
Views
Black screen is coming below the presented view controller
I am trying to present a view controller modally. It is like a pop up view controller.
I am using animateTransition method to animate the transition.
This is my code:
extension PopUpViewController: UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning {
func transitionDuratio...