[Solved] swift date and time ios [closed]

That should do the trick: let date = NSDate() let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = “yyyy-MM-dd” let timeFormatter = NSDateFormatter() timeFormatter.dateFormat = “HH:mm:ss.S” println(dateFormatter.stringFromDate(date)) println(timeFormatter.stringFromDate(date)) 2 solved swift date and time ios [closed]

[Solved] how to call a method after a delay? [closed]

you can try: having a bool property called completed. perform selector after delay //(some selector showBusy, some delay) completed = NO; dispatch_queue_t myqueue = dispatch_queue_create(“queue”, NULL); dispatch_async(myqueue, ^{ //your long time operation (must not do any UI changes here) dispatch_async(dispatch_get_main_queue(), ^{ //UI here completed = YES; hideBusy; }); }); -(void)showBusy{ if(!completed)….. } 2 solved how … Read more

[Solved] Calculate next date in week

Use [NSCalendar currentCalendar] to get NSDateComponents from the current date, especially NSWeekdayCalendarUnit and NSWeekOfYearCalendarUnit. the components will have a member weekday, that ranges from 1 — sunday to 7 — saturday. if it is 1 or 2, create a new componets with weekday 2, if it is 7, add one to weekOfYear and set weekday … Read more

[Solved] Swift – Create charts(bar, line, pie, column) programatically [closed]

After you look into documentation for charts a bit more, you would probably for example if you make a line chart LineChartView() you can have different update functions to change how it looks, for example here is one of mine: func lineChartUpdate(dataPoints: [String], values: [Double]) { //Graph data management var lineChartEntry = [ChartDataEntry]() for i … Read more

[Solved] How to add a UITableview inside a UIImageview programmatically in Swift 3

You can not add a UITableView inside UIImageView. You can take a UIView and add UIImageView and UITableView inside this view. let bgView = UIView.init(frame: self.view.frame) //Frame of the view let imageView = UIImageView.init(frame: CGRect.init(x: 0, y: 0, width: bgView.frame.width, height: bgView.frame.height)) imageView.image = #imageLiteral(resourceName: “imgDefault”) let tableView = UITableView.init(frame: CGRect.init(x: 0, y: 0, width: … Read more

[Solved] how to fix error of “Cannot assign to property: ‘setBarTintGradientColors’ is a method” [closed]

setBarTintGradientColors is a method, meaning it must take an argument (a list of colors). Therefore, you will need something like this instead of assignment: CRGradientNavigationBar.appearance().setBarTintGradientColors(colors) As a rule of thumb, whenever you have set in the name, it is a function, not an attribute, meaning that you will need to pass an argument instead of … Read more

[Solved] application life cycle issue

I solved this problem, just overrides the UINavigationBar & in LayoutSubViews set the height of navigationBar. @implementation UINavigationBar (customNAvigBar) – (void)layoutSubviews { [self setFrame:CGRectMake(0, 0, 320, 55)]; } @end that means whenever i draws the navigationBar it calls automatically & sets the height. solved application life cycle issue

[Solved] My application crashes with this error – ‘NSInvalidArgumentException’

ShopCollectionObject.h #import <Foundation/Foundation.h> @interface ShopCollectionObject : NSObject @property (nonatomic) int message_id; @property (strong, nonatomic) NSString *Name; @property (nonatomic) int TimeAsPrice; @property (strong, nonatomic) NSString *Avathar;//user,Name_User,LocationOfUser,message_id @property (strong, nonatomic) NSString *user; @property (strong, nonatomic) NSString *Name_User; @property (strong, nonatomic) NSString *LocationOfUser; -(instancetype) initWithID: (int)msgID Name:(NSString *)Profile_name TimeAsPrice:(int) GivenTimeAsPrice Avathar:(NSString *) PhotoOfAvathar user:(NSString *)UserAvathar Name_User: (NSString *) … Read more