ios


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

Related Links

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]

Categories

HOME
math
graph
vb.net
svg
collections
android-activity
chronicle
amazon-kinesis
libreoffice
box
android-bluetooth
classloader
binary-search
w3.css
vulkan
chart.js2
lighttpd
numericupdown
python-2.5
libssh
countdown
thrift
cmusphinx
nested-set-model
google-distancematrix-api
liferay-aui
background-subtraction
centos6
yii1.x
esri
unsigned-integer
launchpad
true-type-fonts
plm
file-manager
akka-http
udid
nest-thermostat
mobilefirst-bluemix
rhel7
double-click-advertising
chamilo-lms
nio
transpose
dxgi
logicblox
mdanalysis
ase
okular
replaygain
g-wan
view-source
lcov
surroundscm
ultratree
building
codeigniter-upload
telecommunication
kernighan-and-ritchie
xmllint
android-number-picker
securesocial
benerator
selenium2library
occam-pi
wgs84
multer
dnx
samsung-gear
tun
symbian
cocoon-gem
heroku-toolbelt
wss4j
maven-cargo
pegkit
keypad
omap
ehcache-bigmemory
antiforgerytoken
declaration
epplus-4
openxls
javaw
mks
conditional-statements
android-design-library
esx
sqlhelper
jet.com-apis
catalina.out
express-jwt
datacontractserializer
email-spam
grunt-contrib-copy
sirtrevor
azimuth
confirmation
llblgenpro
flash-cs4
repeating
jquery-data
route-me
chromeless
angularjs-module
android-screen
semantic-zoom
settings.bundle
android-assets
process.start
nntp
replay
regexbuddy
cracker
gendarme
code-statistics
fogbugz-on-demand

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App