iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Refreshing UITableView Asynchronously after Core Data Loaded Swift

I have a UITableView, tViewNews I have a refresh function which downloads data from my server, stores it into core data, and then the table view loads this data from core data. It works perfectly func refresh(refreshControl: UIRefreshControl) { self.newsArray = [NewsItem]() self.newslists = [[NewsItem]]() self.getNewsFromServer() self.getNewsFromCoreData() self.tViewNews.reloadData() refreshControl.endRefreshing() } Now, when the user first […]

Swift: How to Open local pdf from my app to iBooks

I was in objective-c before. and this code below in objective C is working fine: in. h @property (retain)UIDocumentInteractionController *docController; and in .m NSString *path = [[NSBundle mainBundle] pathForResource:@”book” ofType:@”pdf”]; NSURL *targetURL = [NSURL fileURLWithPath:path]; docController = [UIDocumentInteractionController interactionControllerWithURL:targetURL]; if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@”itms-books:”]]) { [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; NSLog(@”iBooks installed”); } else { NSLog(@”iBooks not […]

Overriding method with selector '***' has incompatible type '****' parse

I am using Parse. I am trying to query a list of the object in the database. I am using swift programming language. I think the reason cause this error is because obj-c and swift bridge. Can anyone help me ? Here is my code. override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { […]

iOS Share Extension crashes when sharing from iOS 11 Screenshot

I’m working on an iOS app that uses a photo share extension, where the image is processed and our main functionality is triggered.. In the simulator on the Photo’s app this works great. I decided to run on device from the Photo’s app and it also works great, but when I screenshot and try to […]

app with Objective-C and swift code crash at launch in release mode, debug mode fine

My project is Objective-C based, and have some third party swift code. The app runs fine at debug mode, however, when I archive the app as release mode, the app will crash at launch screen. Set swift optimization level to None still has the same issue. I have crashlytics 3.7 installed, but it crashes at […]

Swift :Segmented control with a swipe gesture between views

I’m using a UIContainer to switch between views using segmented control + swipe gesture. My storyboard is like this one. Override func viewDidLoad() { super.viewDidLoad() var swipeRight = UISwipeGestureRecognizer(target: self, action: “respondToSwipeGesture:”) swipeRight.direction = UISwipeGestureRecognizerDirection.Right self.view.addGestureRecognizer(swipeRight) } I tired many open resources for Github but it is written in objective-C? Can anyone help

FileManager and urlsForDirectory Error in Swift 3 Xcode 8

I just went to Xcode 8 beta 4 from beta 3 but for what ever reason I am getting this error that has worked with no errors or issued until beta 4. here is the error” Value of type ‘FileManager’ has no member ‘urlsForDirectory’ “ my code: func setupRecorder(){ let audioSession:AVAudioSession = AVAudioSession.sharedInstance() //ask for […]

How to calculate percentage using % as a postfix unary operator in Swift 3 and still be able to use % for modulo?

I declared the % token as a post-fix operator in order to calculate percentage but Xcode reports `% is not a postfix unary operator` My test code below is based on an example found here. I’ve also checked Appleā€™s latest documentation for the syntax for Operator Declaration but it gave no clue why Xcode complains. […]

how to get start and end time of today's date in ios?

This question already has an answer here: NSDate beginning of day and end of day 14 answers

oAuth Instagram login

I am trying to get access token from Instagram using oAuth 2, to use it in scopes. I couldn’t understand how should I configure “redirect_uri” (tried a lot of combinations) if I use it in native app, it means I don’t need any websites to have redirected, I need redirect to app itself, after logged […]