コード例 #1
0
XIBObject *ObjectConverter::ConverterForStoryObject(const char *className, pugi::xml_node node)
{
    XIBObject *ret = NULL;

    IS_CONVERTER(ret, className, "objects", XIBArray)
    IS_CONVERTER(ret, className, "subviews", XIBArray)
    IS_CONVERTER(ret, className, "constraints", XIBArray)
    IS_CONVERTER(ret, className, "variation", XIBVariation)
    IS_CONVERTER(ret, className, "items", XIBArray)
    IS_CONVERTER(ret, className, "connections", XIBArray)
    IS_CONVERTER(ret, className, "string", XIBObjectString)
    IS_CONVERTER(ret, className, "viewController", UIViewController)
    IS_CONVERTER(ret, className, "placeholder", UIProxyObject)
    IS_CONVERTER(ret, className, "tabBarController", UITabBarController)
    IS_CONVERTER(ret, className, "navigationItem", UINavigationItem)
    IS_CONVERTER(ret, className, "navigationBar", UINavigationBar)
    IS_CONVERTER(ret, className, "navigationController", UINavigationController)
    IS_CONVERTER(ret, className, "tabBarItem", UITabBarItem)
    IS_CONVERTER(ret, className, "tabBar", UITabBar)
    IS_CONVERTER(ret, className, "view", UIView)
    IS_CONVERTER(ret, className, "scrollView", UIScrollView)
    IS_CONVERTER(ret, className, "label", UILabel)
    IS_CONVERTER(ret, className, "toolbar", UIToolbar)
    IS_CONVERTER(ret, className, "color", UIColor)
    IS_CONVERTER(ret, className, "barButtonItem", UIBarButtonItem)
    IS_CONVERTER(ret, className, "outlet", UIRuntimeOutletConnection)
    IS_CONVERTER(ret, className, "segue", UIStoryboardSegue)
    IS_CONVERTER(ret, className, "fontDescription", UIFont)
    IS_CONVERTER(ret, className, "tableViewController", UITableViewController)
    IS_CONVERTER(ret, className, "tableView", UITableView)
    IS_CONVERTER(ret, className, "textField", UITextField)
    IS_CONVERTER(ret, className, "textView", UITextView)
    IS_CONVERTER(ret, className, "button", UIButton)
    IS_CONVERTER(ret, className, "webView", UIWebView)
    IS_CONVERTER(ret, className, "searchBar", UISearchBar)
    IS_CONVERTER(ret, className, "searchDisplayController", UISearchDisplayController)
    IS_CONVERTER(ret, className, "activityIndicatorView", UIActivityIndicatorView)
    IS_CONVERTER(ret, className, "imageView", UIImageView)
    IS_CONVERTER(ret, className, "action", UIRuntimeEventConnection)
    IS_CONVERTER(ret, className, "switch", UISwitch)
    IS_CONVERTER(ret, className, "constraint", NSLayoutConstraint)
    IS_CONVERTER(ret, className, "layoutGuides", XIBVariation)
    IS_CONVERTER(ret, className, "viewControllerLayoutGuide", _UILayoutGuide)
    IS_CONVERTER(ret, className, "datePicker", UIDatePicker)
    IS_CONVERTER(ret, className, "slider", UISlider)

    if ( ret == NULL ) {
#ifdef _DEBUG
        printf("Unrecognized tag <%s>\n", className);
#endif
        ret = new XIBObject();
    }

    ret->ScanStoryObjects(node);

    return ret;
}
コード例 #2
0
XIBObject* ObjectConverter::ConverterForStoryObject(const char* className, pugi::xml_node node) {
    XIBObject* ret = NULL;

    IS_CONVERTER(ret, className, "objects", XIBArray)
    IS_CONVERTER(ret, className, "subviews", XIBArray)
    IS_CONVERTER(ret, className, "constraints", XIBArray)
    IS_CONVERTER(ret, className, "variation", XIBVariation)
    IS_CONVERTER(ret, className, "items", XIBArray)
    IS_CONVERTER(ret, className, "connections", XIBArray)
    IS_CONVERTER(ret, className, "string", XIBObjectString)
    IS_CONVERTER(ret, className, "viewController", UIViewController)
    IS_CONVERTER(ret, className, "splitViewController", UIViewController)
    IS_CONVERTER(ret, className, "placeholder", UIProxyObject)
    IS_CONVERTER(ret, className, "tabBarController", UITabBarController)
    IS_CONVERTER(ret, className, "navigationItem", UINavigationItem)
    IS_CONVERTER(ret, className, "navigationBar", UINavigationBar)
    IS_CONVERTER(ret, className, "navigationController", UINavigationController)
    IS_CONVERTER(ret, className, "tabBarItem", UITabBarItem)
    IS_CONVERTER(ret, className, "tabBar", UITabBar)
    IS_CONVERTER(ret, className, "view", UIView)
    IS_CONVERTER(ret, className, "scrollView", UIScrollView)
    IS_CONVERTER(ret, className, "label", UILabel)
    IS_CONVERTER(ret, className, "toolbar", UIToolbar)
    IS_CONVERTER(ret, className, "color", UIColor)
    IS_CONVERTER(ret, className, "barButtonItem", UIBarButtonItem)
    IS_CONVERTER(ret, className, "outlet", UIRuntimeOutletConnection)
    IS_CONVERTER(ret, className, "outletCollection", UIRuntimeOutletCollectionConnection)
    IS_CONVERTER(ret, className, "segue", UIStoryboardSegue)
    IS_CONVERTER(ret, className, "fontDescription", UIFont)
    IS_CONVERTER(ret, className, "tableViewController", UITableViewController)
    IS_CONVERTER(ret, className, "tableView", UITableView)
    IS_CONVERTER(ret, className, "tableViewCell", UITableViewCell)
    IS_CONVERTER(ret, className, "tableViewCellContentView", UITableViewCellContentView)
    IS_CONVERTER(ret, className, "textField", UITextField)
    IS_CONVERTER(ret, className, "textView", UITextView)
    IS_CONVERTER(ret, className, "button", UIButton)
    IS_CONVERTER(ret, className, "webView", UIWebView)
    IS_CONVERTER(ret, className, "searchBar", UISearchBar)
    IS_CONVERTER(ret, className, "searchDisplayController", UISearchDisplayController)
    IS_CONVERTER(ret, className, "activityIndicatorView", UIActivityIndicatorView)
    IS_CONVERTER(ret, className, "imageView", UIImageView)
    IS_CONVERTER(ret, className, "action", UIRuntimeEventConnection)
    IS_CONVERTER(ret, className, "switch", UISwitch)
    IS_CONVERTER(ret, className, "constraint", NSLayoutConstraint)
    IS_CONVERTER(ret, className, "layoutGuides", XIBVariation)
    IS_CONVERTER(ret, className, "viewControllerLayoutGuide", _UILayoutGuide)
    IS_CONVERTER(ret, className, "datePicker", UIDatePicker)
    IS_CONVERTER(ret, className, "slider", UISlider)
    IS_CONVERTER(ret, className, "collectionReusableView", UICollectionReusableView)
    IS_CONVERTER(ret, className, "collectionViewCell", UICollectionViewCell)
    IS_CONVERTER(ret, className, "collectionView", UICollectionView)
    IS_CONVERTER(ret, className, "collectionViewController", UICollectionViewController)
    IS_CONVERTER(ret, className, "pickerView", UIPickerView)
    IS_CONVERTER(ret, className, "segmentedControl", UISegmentedControl)
    IS_CONVERTER(ret, className, "stepper", UIStepper)
    IS_CONVERTER(ret, className, "panGestureRecognizer", UIPanGestureRecognizer)
    IS_CONVERTER(ret, className, "swipeGestureRecognizer", UISwipeGestureRecognizer)
    IS_CONVERTER(ret, className, "tapGestureRecognizer", UITapGestureRecognizer)
    IS_CONVERTER(ret, className, "window", UIWindow)

    // Stubbed mapping - full functionality is not provided but these stubs will unblock the import process
    IS_CONVERTER(ret, className, "pageControl", UIPageControl)
    IS_CONVERTER(ret, className, "mapView", MKMapView)
    IS_CONVERTER(ret, className, "stackView", UIStackView)
    IS_CONVERTER(ret, className, "progressView", UIProgressView)
    IS_CONVERTER(ret, className, "pongPressGestureRecognizer", UIPongPressGestureRecognizer)

    IS_CONVERTER(ret, className, "customObject", ObjectConverterSwapper)

    if (ret == NULL) {
        TELEMETRY_EVENT_DATA(L"UnRecognizedTag", className);
        ret = new XIBObject();
    }

    ret->ScanStoryObjects(node);

    return ret;
}