Process user-inputted conditions (==, &&) inside app
I have the task, and I can understand how to deal with it (in what direction I need to start). Application need to understand user-inputted condition like that: ((VAR1 != 1 && VAR2 == 2) OR (VAR3 != 1 && VAR4 == 2)) AND (VAR5 = 2) I have that variables inside my database, so it's no problem to replace VAR1 with real data. How in what way I can process that condition inside application. I thought about separating full condition to little blocks, but I don't understand yet how to separate, there is no symbol that I can split string. So can you help in what direction I need to start working to process such conditions in Swift app?
Thanks to #Sulthan, NSPredicate is solution. let expressionString = "((1 == 1) or (1 == 2)) and (1 == 2)" let predicate = NSPredicate(format: expressionString) print(predicate.evaluateWithObject(nil)) // Output: false
HOWTO get the correct Frame Pointer of an arbitrary thread in iOS?
Programmatically Create Popover Menu Swift
How can I pass body parameters along with file in multipart file upload using Alamofire in Swift
Xcode 7 UI Testing with Cocoapods fails on device
Error using performSegueWithIdentifier Swift 2.1
Twitter does not return email id after whitelisting in iOS
Delphi 10 Seattle missing libsqlib.a
How to convert date like \/Date(1440156888750-0700)\/ to something that Swift can handle?
Calling Class level code inside block crashes objective c
How to add number of rows in section dynamically in tableview? [closed]
iOS Network Connection Failure Policy suggestions
TTTAttributedLabel link font changing when UIAlertView presents
tell an array to hold instances of an array?
Add Vibrancy effect to custom UIButton?
Image buffer display order with VTDecompressionSession
What is that? Cell or Table? [closed]