written by objective-c and swift