円グラフをアニメーション付きに。下のような感じで。 gifちらつきますが.. 真ん中くりぬきと、そうじゃないバージョンで。 まずはObjective-C版を。 valueとcolorを渡すイメージで実装。 #import "PieGraphView.h" @implementation PieGraphView { NSArray *_params; float _end_angle; } -(PieGraphView*)initWithFrame:(CGRect)frame params:(NSArray*)params { self = [super initWithFrame:frame]; if (self) { _params = params; self.backgroundColor = [UIColor clearColor]; _end_angle = -M_PI / 2
![【iOS】【Objective-C】アニメーション付き円グラフ - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/5beed05f8c724add4e25b1b069d377f6909be53e/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-9f5428127621718a910c8b63951390ad.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTkxNiZoPTMzNiZ0eHQ9JUUzJTgwJTkwaU9TJUUzJTgwJTkxJUUzJTgwJTkwT2JqZWN0aXZlLUMlRTMlODAlOTElRTMlODIlQTIlRTMlODMlOEIlRTMlODMlQTElRTMlODMlQkMlRTMlODIlQjclRTMlODMlQTclRTMlODMlQjMlRTQlQkIlOTglRTMlODElOEQlRTUlODYlODYlRTMlODIlQjAlRTMlODMlQTklRTMlODMlOTUmdHh0LWNvbG9yPSUyMzIxMjEyMSZ0eHQtZm9udD1IaXJhZ2lubyUyMFNhbnMlMjBXNiZ0eHQtc2l6ZT01NiZ0eHQtY2xpcD1lbGxpcHNpcyZ0eHQtYWxpZ249bGVmdCUyQ3RvcCZzPTBjZTYyYzE2YjdlMTI5ZGQ3MDZhN2U0ODhiOGY5ZmU0%26mark-x%3D142%26mark-y%3D112%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTYxNiZ0eHQ9JTQwa2l0YW5vb3cmdHh0LWNvbG9yPSUyMzIxMjEyMSZ0eHQtZm9udD1IaXJhZ2lubyUyMFNhbnMlMjBXNiZ0eHQtc2l6ZT0zNiZ0eHQtYWxpZ249bGVmdCUyQ3RvcCZzPTA3YTM3MDdjODMyMmVkZTljZjI3YmJiMGQ1OTE5ODgy%26blend-x%3D142%26blend-y%3D491%26blend-mode%3Dnormal%26s%3Dc5f5099d1c49f3f7f76886419eb453f0)