|
23 | 23 | #import <Foundation/Foundation.h> |
24 | 24 | #import <UIKit/UIKit.h> |
25 | 25 |
|
26 | | -FOUNDATION_EXPORT double TOSegmentedControlFrameworkVersionNumber; |
27 | | -FOUNDATION_EXPORT const unsigned char TOSegmentedControlFrameworkVersionString[]; |
28 | | - |
29 | 26 | NS_ASSUME_NONNULL_BEGIN |
30 | 27 |
|
31 | 28 | /** |
@@ -98,102 +95,105 @@ IB_DESIGNABLE @interface TOSegmentedControl : UIControl |
98 | 95 |
|
99 | 96 | @param items An array of either images, or strings to display |
100 | 97 | */ |
101 | | -- (instancetype)initWithItems:(nullable NSArray *)items; |
| 98 | +- (instancetype)initWithItems:(nullable NSArray *)items NS_SWIFT_NAME(init(items:)); |
102 | 99 |
|
103 | 100 | /** |
104 | 101 | Replaces the content of an existing segment with a new image. |
105 | 102 |
|
106 | 103 | @param image The image to set. |
107 | 104 | @param index The index of the segment to set. |
108 | 105 | */ |
109 | | -- (void)setImage:(UIImage *)image forItemAtIndex:(NSInteger)index; |
| 106 | +- (void)setImage:(UIImage *)image forItemAtIndex:(NSInteger)index NS_SWIFT_NAME(set(_:for:)); |
110 | 107 |
|
111 | 108 | /** |
112 | 109 | Returns the image that was assigned to a specific segment. |
113 | 110 | Will return nil if the content at that segment is not an image. |
114 | 111 |
|
115 | 112 | @param index The index at which the image is located. |
116 | 113 | */ |
117 | | -- (nullable UIImage *)imageForItemAtIndex:(NSInteger)index; |
| 114 | +- (nullable UIImage *)imageForItemAtIndex:(NSInteger)index NS_SWIFT_NAME(image(for:)); |
118 | 115 |
|
119 | 116 | /** |
120 | 117 | Sets the content of a given segment to a text label. |
121 | 118 |
|
122 | 119 | @param title The text to display at the segment |
123 | 120 | @param index The index of the segment to set. |
124 | 121 | */ |
125 | | -- (void)setTitle:(NSString *)title forItemAtIndex:(NSInteger)index; |
| 122 | +- (void)setTitle:(NSString *)title forItemAtIndex:(NSInteger)index NS_SWIFT_NAME(set(_:for:)); |
126 | 123 |
|
127 | 124 | /** |
128 | 125 | Returns the string of the title that was assigned to a specific segment. |
129 | 126 | Will return nil if the content at that segment is not a string. |
130 | 127 |
|
131 | 128 | @param index The index at which the image is located. |
132 | 129 | */ |
133 | | -- (nullable NSString *)titleForItemAtIndex:(NSInteger)index; |
| 130 | +- (nullable NSString *)titleForItemAtIndex:(NSInteger)index NS_SWIFT_NAME(title(for:)); |
134 | 131 |
|
135 | 132 | /** |
136 | 133 | Adds a new text item to the end of the list. |
137 | 134 | |
138 | 135 | @param title The title of the new item. |
139 | 136 | */ |
140 | | -- (void)addNewItemWithTitle:(NSString *)title; |
| 137 | +- (void)addNewItemWithTitle:(NSString *)title NS_SWIFT_NAME(addItem(with:)); |
141 | 138 |
|
142 | 139 | /** |
143 | 140 | Adds a new image item to the end of the list. |
144 | 141 | |
145 | 142 | @param image The image of the new item. |
146 | 143 | */ |
147 | | -- (void)addNewItemWithImage:(UIImage *)image; |
| 144 | +- (void)addNewItemWithImage:(UIImage *)image NS_SWIFT_NAME(addItem(with:)); |
148 | 145 |
|
149 | 146 | /** |
150 | 147 | Inserts a new image item at the specified segment index. |
151 | 148 |
|
152 | 149 | @param image The image to set. |
153 | 150 | @param index The index of the segment to which the image will be set. |
154 | 151 | */ |
155 | | -- (void)insertItemWithImage:(UIImage *)image atIndex:(NSInteger)index; |
| 152 | +- (void)insertItemWithImage:(UIImage *)image atIndex:(NSInteger)index NS_SWIFT_NAME(insertItem(_:at:)); |
156 | 153 |
|
157 | 154 | /** |
158 | 155 | Inserts a new image title at the specified segment index. |
159 | 156 |
|
160 | 157 | @param title The title to set. |
161 | 158 | @param index The index of the segment to which the image will be set. |
162 | 159 | */ |
163 | | -- (void)insertItemWithTitle:(NSString *)title atIndex:(NSInteger)index; |
| 160 | +- (void)insertItemWithTitle:(NSString *)title atIndex:(NSInteger)index NS_SWIFT_NAME(insertItem(_:at:)); |
164 | 161 |
|
165 | 162 | /** |
166 | 163 | Remove the last item in the list |
167 | 164 | */ |
168 | | -- (void)removeLastItem; |
| 165 | +- (void)removeLastItem NS_SWIFT_NAME(removeLastItem()); |
169 | 166 |
|
170 | 167 | /** |
171 | 168 | Removes the item at the specified index. |
172 | 169 |
|
173 | 170 | @param index The index of the segment to remove. |
174 | 171 | */ |
175 | | -- (void)removeItemAtIndex:(NSInteger)index; |
| 172 | +- (void)removeItemAtIndex:(NSInteger)index NS_SWIFT_NAME(removeItem(at:)); |
176 | 173 |
|
177 | 174 | /** |
178 | 175 | Removes all of the items from this control. |
179 | 176 | */ |
180 | | -- (void)removeAllItems; |
| 177 | +- (void)removeAllItems NS_SWIFT_NAME(removeAllItems()); |
181 | 178 |
|
182 | 179 | /** |
183 | 180 | Enables or disables the item at the specified index. |
184 | 181 |
|
185 | 182 | @param enabled Whether the item is enabled or not. |
186 | 183 | @param index The specific index to enable/disable. |
187 | 184 | */ |
188 | | -- (void)setEnabled:(BOOL)enabled forSegmentAtIndex:(NSInteger)index; |
| 185 | +- (void)setEnabled:(BOOL)enabled forSegmentAtIndex:(NSInteger)index NS_SWIFT_NAME(setEnabled(_:at:)); |
189 | 186 |
|
190 | 187 | /** |
191 | 188 | Returns whether the item at the specified index is currently enabled or not. |
192 | 189 |
|
193 | 190 | @param index The index to check. |
194 | 191 | */ |
195 | | -- (BOOL)isEnabledForSegmentAtIndex:(NSInteger)index; |
| 192 | +- (BOOL)isEnabledForSegmentAtIndex:(NSInteger)index NS_SWIFT_NAME(isEnabled(at:)); |
196 | 193 |
|
197 | 194 | @end |
198 | 195 |
|
199 | 196 | NS_ASSUME_NONNULL_END |
| 197 | + |
| 198 | +FOUNDATION_EXPORT double TOSegmentedControlFrameworkVersionNumber; |
| 199 | +FOUNDATION_EXPORT const unsigned char TOSegmentedControlFrameworkVersionString[]; |
0 commit comments