Skip to content

Using Cosmos settings in Objective C

Evgenii Neumerzhitckii edited this page Sep 21, 2016 · 5 revisions

This is how to set and read Cosmos settings in Objective-C apps.

  1. Add CosmosSettingsObjCBridge.swift to your project.

  2. Import swift code in your Objective-C file: #import "YOUR_PRODUCT_MODULE_NAME-Swift.h"

  3. Access Cosmos view settings from Objective-C code:

- (void)viewDidLoad {
    [super viewDidLoad];
  
    [CosmosSettingsObjCBridge setStarSize:30 inCosmosView:self.cosmosView];
    [CosmosSettingsObjCBridge setFillMode: 0 inCosmosView: self.cosmosView];
    [CosmosSettingsObjCBridge setFilledColor: [UIColor redColor] inCosmosView:self.cosmosView];
    [CosmosSettingsObjCBridge setUpdateOnTouch: NO inCosmosView:self.cosmosView];
}
Clone this wiki locally