cocoa-touch

understanding TTNavigator

こ雲淡風輕ζ 提交于 2020-01-22 04:33:29
问题 following situation: in a TTTableViewController i added some Cells with URLs. they are opening a class with @"tt://photos" for example. this works quite fine. the first thing is, i saw some urls in TT Examples like @"tt/photos/1". is it possible to fetch this "1" in my photos class and say, for example okay, please open picture one, ore is this only another URL that was declared in TTNavigatior to open a specific Class? the other thing is: is it possible to forward an object to the linked

Take screenshot from camera view

廉价感情. 提交于 2020-01-21 22:57:44
问题 Updated I'm using the sinch library to make video call in my app. I've button to take screenshot for the whole screen during the video call : @IBAction func photoAction(_ sender: Any) { let result = UIImage(view: self.videoView) UIImageWriteToSavedPhotosAlbum(result, nil, nil, nil) let result2 = UIImage(view: self.videoController!.localView()) UIImageWriteToSavedPhotosAlbum(result2, nil, nil, nil) } call is SINClient videoController is SINVideoController localView is UIView, the camera view

Creating video file from images and audio( pre-recorded )

﹥>﹥吖頭↗ 提交于 2020-01-21 19:00:26
问题 I have come across some sample codes where set of images are added to make a QTmovie. I am targeting this for OS X platform without any QT frameworks. I have ague idea of creating a file with extension and embed it with appropriate metadata and find a way to insert images and audio in required format. So when the file is created it can simply be played. I am not sure of what format/extension is better. pointers are much appreciated. 回答1: Without QuickTime (or an equivalent multimedia

Xcode 4 and Interface Builder: Editing Vertical Spacing Constraint (Anchor Top, not Bottom)

谁都会走 提交于 2020-01-21 04:31:20
问题 I've got a widget that is not laying out correctly on device (its looks OK in IB, but its not quite right). The widget is a label and its located about mid-screen. Interface Builder gave it a Vertical Space Constraint with a 'Bottom Anchor'. Here, bottom means bottom of the screen (rather than a widget below, or anchor to top screen). I'm in the inspector, but I don't see how to change to a top anchor (preferably, to the widget above). I tried reading Apple's docs and Editing Constraints in

Line spacing and paragraph alignment in CoreText

六月ゝ 毕业季﹏ 提交于 2020-01-21 03:35:08
问题 I am using CoreText to render multiple columns of text. However, when I set the first letter of the 1st paragraph to a bold, larger font than the rest of the text, I incur 2 issues (both visible in the attached image): The spacing underneath the first line is too big (I understand that this is because the 1st character could be a g,y,p,q etc. Lines below the first line now do not line up with corresponding lines in the next column. Any advice on how to overcome these 2 issues would be greatly

how do I detect the iPhone orientation before rotating

爷,独闯天下 提交于 2020-01-20 17:09:48
问题 In my program I'm moving things based on rotation, but I'm not rotating the entire view. I'm Using : static UIDeviceOrientation previousOrientation = UIDeviceOrientationPortrait; - (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview:viewController.view]; [window makeKeyAndVisible]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:@"UIDeviceOrientationDidChangeNotification" object:nil]; } - (void) didRotate:

how do I detect the iPhone orientation before rotating

旧街凉风 提交于 2020-01-20 17:07:11
问题 In my program I'm moving things based on rotation, but I'm not rotating the entire view. I'm Using : static UIDeviceOrientation previousOrientation = UIDeviceOrientationPortrait; - (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview:viewController.view]; [window makeKeyAndVisible]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:@"UIDeviceOrientationDidChangeNotification" object:nil]; } - (void) didRotate:

Why doesn't UITableViewCell background color work (set in interface builder)?

自作多情 提交于 2020-01-20 12:54:05
问题 Why doesn't UITableViewCell background color work (set in interface builder)? I note from some searching that the follow code set in your custom subclass of UITableViewController does work (see below): - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundColor = [UIColor redColor]; } But I would still like to just understand why interface builder has a background color setting for the TableViewCell,

Finding a particular instance in an array by a property

╄→尐↘猪︶ㄣ 提交于 2020-01-20 08:52:27
问题 I have an array containing various instances of MyClass , which has four properties: int id , int valueA , int valueB , and int valueC . On occasion, I need to modify a property for a specific instance (for this example let's say it is the one with id equal to 5 ). Currently I do it like this: MyClass *myClass = [[MyClass alloc] init]; for (int i = 0; i < [myMutableArray count]; i++) { myClass = [myMutableArray objectAtIndex:i]; if(myClass.id == 5) { myClass.valueA = 100; myClass.valueB = 200

Displaying UIImagePickerController within another UIView

杀马特。学长 韩版系。学妹 提交于 2020-01-20 08:17:25
问题 I've been working pretty extensively the last couple months with UIImagePickerController, particularly with the new capabilities in OS3.1 and newer to overlay views on-top of the camera view. This has worked just fine. However, I am currently working on a project where I'd like to be able to display the camera view of the UIImagePickerController within an existing view. Essentially, the exact opposite of what I've currently been doing. An example would be a View Controller with navigation