Post not yet marked as solved
I'm not able to run my app on my device as Xcode is unable to create a provisioning profile for my app without the paid developer membership.
I followed the troubleshooting steps on stack overflow here but to no avail.
Any help?
I am taking a reference to a VC in app delegate and using a UIColorPickerController extension with the following code, I'm setting this VC as a delegate to the picker. I need to take these lengthy steps because there is no reference to the picker that a UIColorWell displays!
This way, I can set the background color of the VC while the user selects different colors from picker, one after another. This is the give a live effect or color change.
However, I dont see this happening. The delegate is not being called.
Any help?
import Foundation
import UIKit
extension UIColorPickerViewController{
open override func viewDidLoad() {
super.viewDidLoad()
let appDelegate = UIApplication.shared.delegate as! AppDelegate
delegate = appDelegate.addOrEditVC
}
}```
Post not yet marked as solved
When I add or delete data of my entity type I can see the updates (between the simulator and the phone) but when i edit I dont see the updates although table view is reloaded. The console says
Ignoring remote change notification because it didn't change any entities tracked by persistent history
When I rebuild the app for both device and simulator I see it reflecting the most current changes.
Any help?
Neerav
In my app, the user can set a timer for an activity. I want to show a simple progress bar that progresses every 1 second and stops (100%) at the end of the time interval of the timer.
example, think of the progressbar of a song being played which finishes on the length of the song.
I've read about TimerPublisher but am not sure how to implement it. Can someone help me out over here please?
Thanks
Neerav
Post not yet marked as solved
I have a couple of actions in the leading and the trailing swipes of a table view cell. Like in the mail app, I want to unswipe the cell as soon as an action is selected. Notice how the 'Mark as read' blue colored action disappears when its selected.
Any guesses how it can be done?
Neerav
Post not yet marked as solved
In my app, its optional that a user sets a timer for a given thing. For that, I wanted to show 0hrs and 0 mins as default selected time interval of the countdown timer. if there is a change, the timer is automatically set to that value using event handling (did end editing).
However, 0hrs and 1 mins is what the default timer shows which can come across as the timer being preset to 1 minute. How can I design my user-interface such that the default is indicated as 0hr 0mins and if the user changes it, its set to that time.
This is more of a design question. Maybe something in HIG?
Here is how it currently looks...
Before the code...
CloudKit, background mode (remote notifications) and push notifications are added to Capabilities.
Background sync is working fine and view loads current store on manual fetch.
Code that initialises the persistent container in app delegate...
- (NSPersistentCloudKitContainer *)persistentContainer {
// The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it.
@synchronized (self) {
if (_persistentContainer == nil) {
_persistentContainer = [[NSPersistentCloudKitContainer alloc] initWithName:@"Expenses"];
[_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) {
if (error != nil) {
__block NSPersistentStoreDescription *sDescription = storeDescription;
dispatch_async(dispatch_get_main_queue(), ^(){
[sDescription setOption:[NSNumber numberWithBool:YES] forKey:@"PersistentHistoryTracking"];
[sDescription setOption:[NSNumber numberWithBool:YES] forKey:@"NSPersistentStoreRemoteChangeNotificationOptionKey"];
});
#ifdef DEBUG
NSLog(@"Unresolved error %@, %@", error, error.userInfo);
#endif
abort();
}
else
#ifdef DEBUG
NSLog(@"Store successfully initialized");
#endif
}];
}
}
return _persistentContainer;
}
In Home view controller which is the initial view controller i am adding an observer for the remote notification...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadViewONCKChangeNotification) name:NSPersistentStoreRemoteChangeNotification object:[appDelegate.persistentContainer persistentStoreCoordinator]];
I am not receiving any store change notifications. Have added breakpoints to see if selector is fired. no go.
CloudKit Console also doesn't show any pushes for the concerned time period.
Is it possible to use Swift Charts in my ObjC project using bridging headers? The documentation names its Swift Charts but its seems they can only be used in SwiftUI projects.
Post not yet marked as solved
I was trying to toggle Debug settings in Build Settings to check if NSLog statements between #ifdebug and #endif stop printing in the debugger.I ended up deleting the settings thinking cmd+z will undo it. Can you help me get them back?
I'm asking about the one that says DEBUG=0 or DEBUG=1
Also, If I can know how to toggle them?
Thank you.
Post not yet marked as solved
I have two macs at home. One in my bedroom which is my development mac and one in my living room which is an old mac i put to good use. i would like to occasionally sit in my living room and continue my work from there to avoid fatigue sitting at my desk all day. i have enabled source control using local git repo. how can i continue with my xcode project on my second mac which runs the same os x?
I read the article here... https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_swift_into_objective-cand this is what I did.Created a header file for swift file.added @class SwiftFile.h#import MyAppTargetName-Swift.h in the objc file from where I want to reference my swift code.Now in my swift file when I write...@interface ClassName
{
MySwiftClass *swiftClass;
}I get error message Unknown Type Name "MySwiftClass".How can I resolve this and get going?Am I doing something wrong?Does the bridging header i created along with the swift file need to me edited?Neerav
Post not yet marked as solved
Below is my code that cancels previous notification and should trigger a new one for the set time. Code runs without error but i dont see any notification. I have taken concrete authorisation for the same and there are no run time errors in the trigger below.
previously when the authorisation was provisional, the notification would fire fine upon subsequent time changes. Not it just doesnt show up. Please help me out.
-(void)makeNotificationFromDateComponents:(NSDateComponents *)dateComponents
{
[[UNUserNotificationCenter currentNotificationCenter] removeAllPendingNotificationRequests];
UNMutableNotificationContent *notificationContent = [[UNMutableNotificationContent alloc] init];
notificationContent.title = @"title";
notificationContent.body = @"body.";
notificationContent.sound = [UNNotificationSound defaultSound];
UNCalendarNotificationTrigger *notificationtrigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:dateComponents repeats:YES];
UNNotificationRequest *notificationRequest = [UNNotificationRequest requestWithIdentifier:@"AddReminderNotification" content:notificationContent trigger:notificationtrigger];
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:notificationRequest withCompletionHandler:^(NSError *error){
if (error!=nil) {
NSLog(@"Notification error: %@",error.userInfo);
}
}];
}
Post not yet marked as solved
I want to share my app analytics data with someone. how do i do it? i dont see a share or a download option.
Post not yet marked as solved
I have a collection view with vertical flow layout. On bigger iPhones there is empty space after the 5 items in the row. Height and width and fixed at 30. There is empty space horizontally after the 5th item in the row. If i turn height and width constraint to be 'greater that of equal to' then i see just 3 items in the row and the remaining 2 appear in the row below.
I find constraints very challenging and want guidance with setting them right so that the items resize on all screens to have exactly 5 items in a row from edge to edge of the collection view.
Post not yet marked as solved
I have a collection view with custom items and the last item (Miscellaneous) of the last section appears in the centre of the row (3rd out of 5 items on the iPhone SE simulator).
In the horizontal layout it appears in 2nd row in the last section (out of the 3 rows).
What am I doing incorrectly?
Thanks.
Neerav